Security

The network edge is the point.

The app talks to a local bridge. The bridge talks to OpenCode on loopback. Nothing is relayed through a hosted account.

  • Loopback only
  • No telemetry
  • Constant-time auth
  • One-time WS tickets

The boundary

Device Mobile / Web Your token
private network
Host Bridge 127.0.0.1:8787
loopback
Agent OpenCode Your machine
One token The bridge token is equivalent to shell access on your machine. Whoever holds it can ask the agent to read files, run commands, and change code inside the allowed workdirs.

Controls

  • Bearer token with constant-time comparison and failed-auth bans.
  • One-time WebSocket tickets, so the credential never lands in a URL or an access log.
  • Workdir allowlist for sessions, uploads, and downloads.
  • Upload type, extension, magic-byte, size, and filename checks.
  • Loopback-only OpenCode URL; Tailscale or a reverse proxy for remote access.
  • No telemetry, no hosted relay, no account system.
  • Opt-in CORS with exact origins. Wildcards are rejected.

The full threat model, the redaction rules, and the known gaps live in docs/security.md.

Deployment checklist

  • AUTH_TOKEN is at least 32 random characters and unique to this bridge.
  • HOST stays on 127.0.0.1; remote access goes through Tailscale or a tunnel.
  • ALLOWED_WORKDIRS lists only the roots you intend to expose.
  • CORS_ORIGINS is empty unless a browser build needs it.
  • Release files are verified against the published SHA256SUMS.
  • The token is rotated when a device is lost or the machine is shared.