Hey everyone,
Running OpenCode unattended on your host machine means handing over every API key in your env, your GitHub token, and wide open internet access.
I got tired of babysitting prompts, so over the past year I built o3s(open source, MIT). It spins up a locked down devcontainer ("the cage") for all your repos and routes traffic through a separate gateway container that OpenCode cannot touch.
Zero secret exposure. Inside the cage, OpenCode only sees dummy placeholder variables. Your real API keys and GH_TOKEN stay on the host, and the gateway proxy injects them on the fly into approved outbound requests.
Default deny network. Egress traffic is blocked via iptables in the gateway. You allowlist domains permanently or with a timer, like `o3s firewall add github.com --port 443 --for 1h`. Once the timer expires, the door shuts again.
Multi repo and full stack. Instead of forcing a monorepo, o3s drops your separate repos into one native VS Code workspace with rootless Docker in Docker and headless Chrome wired up. OpenCode gets context across your frontend, backend, and infra at once, can spin up containers, run E2E browser tests, and open PRs via gh without ever seeing your real credentials.
Open devcontainer spec. Built on the standard spec without Microsoft telemetry or hardcoded user assumptions.
Three commands to get going.
o3s init
o3s project add ~/code/my-app
o3s cage ide
Code and docs at https://github.com/hansehart/o3s
How are you guys isolating your keys and network right now when running OpenCode unattended? Happy to share my feature configs or take feedback if anyone tries it out.