Secure OpenCode Remote Access from Mobile
An OpenCode server may read and change source files, execute commands, and invoke configured AI providers. Remote access therefore creates a privileged path into a development machine. HTTPS alone does not make that path safe.
Threats to plan for
Section titled “Threats to plan for”- A public scanner discovers an exposed OpenCode endpoint.
- A weak or reused Basic-auth password is guessed or leaked.
- A lost phone retains a working server URL and credentials.
- A proxy forwards normal HTTP but breaks or exposes realtime and terminal traffic.
- A user approves a dangerous tool action without reviewing the active project or session.
- A temporary tunnel URL is pasted into a public issue, log, or screenshot.
- An untrusted plugin or MCP server is installed without reviewing what runs on the OpenCode host.
Minimum controls
Section titled “Minimum controls”- Bind OpenCode to
127.0.0.1when using a VPN, tunnel, or local reverse proxy. - Configure a unique username and strong password.
- Prefer a private Tailscale route over a public hostname when possible.
- If using Cloudflare Tunnel, keep OpenCode authentication enabled and protect the Cloudflare account.
- Restrict firewall rules and tailnet ACLs to the minimum required scope.
- Keep OpenCode Mobile and the OpenCode server current.
- Review permissions, questions, changed files, and the selected project before accepting completion.
Credential handling
Section titled “Credential handling”On native iOS and Android builds, non-secret connection details use app storage. Server passwords, custom header values, custom CA material, and OIDC access or refresh tokens use Keychain/Keystore-backed secure storage. Treat the device as holding access to the development server. Use device encryption and a strong screen lock, and rotate the OpenCode password after a device is lost or transferred. Browser builds cannot persist credentials through native secure storage.
A custom CA is trusted only for one connection’s host:port; it does not become a device-wide trust anchor. OIDC sign-in uses the system browser with PKCE, never an embedded WebView.
Multiple saved connections each have their own stored password. Editing a connection does not reconnect it automatically, so a stale connection can remain active until you choose Reconnect.
Extensions and plugins execute code on the OpenCode host. Install only targets you trust, review plugin and MCP changes before saving, and treat extension editing as server administration.
OpenCode 2 opencode pair links and Cloud Link pairing links are credentials. They expire quickly and work once, but still grant access while valid. Do not paste them into public issues, logs, chat messages, or screenshots. If a link is exposed, create a fresh pairing link or revoke the machine where available.
Cloud Link adds an optional managed route and store subscription. Review the Cloud Link page and the privacy policy before using it. Cloud Link does not change the fact that your prompts and source code are sent to the OpenCode server you select.
Do not reuse an AI-provider API key as the OpenCode server password. Provider authentication and server connection authentication protect different systems.
Incident response
Section titled “Incident response”If an endpoint or credential is exposed:
- Stop or disable the tunnel or proxy route.
- Rotate the OpenCode username/password.
- Review server, proxy, and provider logs for unexpected activity.
- Revoke affected provider credentials if tool or environment exposure is plausible.
- Update the app connection only after the route is secured again.
Report product vulnerabilities privately through the security page. Use the troubleshooting checklist for failures without security impact.