{"slug": "setting-up-containerized-dev-environments-you-can-spin-up-in-seconds", "title": "Setting up containerized dev environments you can spin up in seconds", "summary": "A developer created a containerized development environment for AI agents that spins up in seconds with limited, controlled access, using a separate GitHub account and specific keys to limit blast radius. The setup runs locally or on Cloud Run, with session management via a dashboard, conversation history preserved across sessions, and optional Tailscale integration for accessing agent-started servers. The project is available on GitHub at github.com/ykdojo/antigravity-cloud-run.", "body_md": "**tl;dr:** I set up a way to spin up containerized dev environments for AI\nagents with limited, controlled access. They only get the credentials and\nnetwork access they need, so they can keep working without asking for\npermission, and without compromising security. Local sessions start in seconds,\nand the same image deploys to Cloud Run when I want it off my laptop.\n\n**Source:** [github.com/ykdojo/antigravity-cloud-run](https://github.com/ykdojo/antigravity-cloud-run)\n\nWith coding agents like Antigravity CLI you have a few options. You can approve\neach request manually. You can configure it in such a way that certain types of\nrequests are accepted automatically. Or you can run it with\n`--dangerously-skip-permissions`\n\nand skip approval entirely.\n\nThe third option is convenient, but it is risky. Running on your main machine with your credentials, it could do a lot of damage, not just to your local environment but to your accounts: GitHub, email, whatever else you are signed into.\n\nSo I decided to put it in a container instead, so I can run it with\n`--dangerously-skip-permissions`\n\nwithout approving every single request. It\ngets a separate GitHub account and only the specific keys it needs. For\nexample, you can give it read-only keys for your accounts if you don’t want it\nto be able to post by itself. That way, its blast radius is limited.\n\nFirst, it gets my OAuth token for Antigravity, so that it’s able to use my\nsubscription’s usage quota. There is no API key option today, only that token\nfile. Until this feature is implemented\n([related](https://github.com/google-antigravity/antigravity-cli/issues/78)\n[requests](https://github.com/google-antigravity/antigravity-cli/issues/592)),\nthis is what I decided to go with. You log in once inside\na container, and every session after that is seeded from that token, locally and\nin the cloud.\n\nYou also give it a list of environment variables, and they get injected into the container automatically every time you spin up a session, locally or in the cloud.\n\nI also built a dashboard to manage sessions, so I can spin one up, stop it, or delete it in a few seconds. That is the nice thing about containers. It is easy to throw one away and start fresh.\n\nConversation history carries across sessions, as long as you name the session the same way. Locally it lives on my machine through a volume mount.\n\nOn Cloud Run it works pretty much the same way. The keys are synced to Secret Manager and wired into the service as environment variables, and conversation history goes to a Cloud Storage bucket, one per session, synced every 60 seconds and again on shutdown. So a session you restart picks up where it left off, same as local.\n\nCloud sessions are IAM-gated and never public. You reach one by running\n`gcloud run services proxy`\n\n, which opens a local port on your machine and\ntunnels it to the container, so you open `localhost`\n\nin your browser and talk\nto the agent and its shell from there. The dashboard does this for you per session.\n\nThis part is optional, but if you already use Tailscale I recommend it for this.\n\nThe reason you need it is that Cloud Run only lets one port per service be reachable from outside, and that port is already taken by the web terminal. So if the agent starts a server inside the session and you want to look at it, there is no way in. Tailscale is the workaround.\n\nEach session joins my private network as its own node, so a server on port 3000\nis at `http://<session-name>:3000`\n\nfrom my laptop, or from any machine on my\ntailnet. Because of how the access rules are set up it only works one way: I\ncan reach the container, and the container cannot reach my machines.\n\nWhen the Tailscale key is present, the session also writes its own address into\nthe agent’s `AGENTS.md`\n\non startup, so the agent knows where it lives and can\nhand you a working URL instead of `localhost`\n\n.\n\nPeople have asked me this, and the assumption behind the question is usually that I want something running 24/7. I don’t, not really.\n\nWhat I do want is somewhere I can let an agent go free, for long running tasks and for tasks I would rather not run on my main machine. Research is one: going through a bunch of YouTube videos, or a bunch of Reddit threads. I don’t necessarily want that running from my main machine.\n\nBuilding a feature on a side project is another one. I don’t necessarily want it using my main machine’s resources, so it’s convenient to run it in a container. For example, I like to have it create a draft PR on its own, take screenshots using Playwright, and attach them to that PR and send it to me so I can approve it and merge it.", "url": "https://wpnews.pro/news/setting-up-containerized-dev-environments-you-can-spin-up-in-seconds", "canonical_source": "https://ykdojo.github.io/antigravity-cloud-run/posts/ephemeral-dev-environments.html", "published_at": "2026-07-26 16:35:55+00:00", "updated_at": "2026-07-26 16:52:25.865094+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-safety", "ai-infrastructure"], "entities": ["Antigravity CLI", "Cloud Run", "GitHub", "Tailscale", "Google Cloud", "ykdojo"], "alternates": {"html": "https://wpnews.pro/news/setting-up-containerized-dev-environments-you-can-spin-up-in-seconds", "markdown": "https://wpnews.pro/news/setting-up-containerized-dev-environments-you-can-spin-up-in-seconds.md", "text": "https://wpnews.pro/news/setting-up-containerized-dev-environments-you-can-spin-up-in-seconds.txt", "jsonld": "https://wpnews.pro/news/setting-up-containerized-dev-environments-you-can-spin-up-in-seconds.jsonld"}}