{
  "manifest_version": "1",
  "slug": "gemini-managed-agents",
  "title": "Gemini Managed Agents",
  "headline": "Self-hosted environment for Gemini Managed Agents",
  "description": "Run the self-hosted environment worker for Gemini API Managed Agents on an always-on exe.dev VM, with the environment key held by exe.dev, not the VM.",
  "category": "ai-agents",
  "tags": [
    "gemini managed agents",
    "self-hosted environment",
    "bring your own sandbox",
    "gemini-api cli",
    "antigravity agent",
    "interactions api",
    "agent sandbox",
    "google"
  ],
  "url": "https://exe.dev/deploy/gemini-managed-agents",
  "markdown_url": "https://exe.dev/deploy/gemini-managed-agents.md",
  "upstream": {
    "website": "https://aistudio.google.com/docs/agents",
    "source": "https://github.com/google-gemini/gemini-api-cli",
    "docs": "https://aistudio.google.com/docs/agent-environment#self-hosted-environments",
    "license": "Apache-2.0 (the gemini-api CLI)"
  },
  "example_vm_name": "my-gemini-sandbox",
  "time": "10 minutes",
  "stack": [
    {
      "name": "Environment worker",
      "detail": "gemini-api 0.4.6 `environments connect`, the gemini-worker systemd service",
      "data": "~/workspace"
    },
    {
      "name": "gemini-env integration",
      "detail": "an exe.dev HTTP proxy to generativelanguage.googleapis.com that adds the environment key"
    }
  ],
  "access": [
    {
      "url": "https://my-gemini-sandbox.exe.xyz:8000/",
      "who": "private",
      "what": "anything the agent serves on a port from 3000 to 9999, behind your exe.dev login"
    }
  ],
  "delivers": [
    "The gemini-api CLI 0.4.6 in /usr/local/bin",
    "The gemini-worker service, restarted on failure and after a reboot, giving the agent ~/workspace",
    "No environment key on the VM; the worker reaches Google through `https://gemini-env.int.exe.xyz`",
    "`Worker ... polling` in `journalctl -u gemini-worker` once the owner has added the gemini-env integration"
  ],
  "owner_runs_after": [
    "ssh exe.dev integrations add http-proxy --name gemini-env --target https://generativelanguage.googleapis.com --header \"x-goog-environment-key:$(jq -r .environment_key gemini-env.json)\" --attach vm:my-gemini-sandbox   # in the folder with gemini-env.json"
  ],
  "deployable": true,
  "deploy": {
    "new_vm_url": "https://exe.dev/new?prompt=Set%20up%20Gemini%20Managed%20Agents%20on%20this%20VM%20by%20following%20the%20exe.dev%20recipe%20at%20https%3A%2F%2Fexe.dev%2Fdeploy%2Fgemini-managed-agents.md%3Fvia%3Ddeploy%20from%20top%20to%20bottom.%0A%0AThe%20recipe%27s%20example%20VM%20name%20is%20my-gemini-sandbox.%20This%20VM%27s%20name%20is%20the%20output%20of%20%60hostname%60%3A%20use%20it%20wherever%20the%20recipe%20writes%20my-gemini-sandbox.%20Skip%20the%20step%20that%20creates%20the%20VM%3B%20you%20are%20on%20it.%0A%0AYou%20are%20done%20when%20all%20of%20these%20are%20true.%20Check%20each%20one%20yourself%3A%0A-%20The%20gemini-api%20CLI%200.4.6%20in%20%2Fusr%2Flocal%2Fbin%0A-%20The%20gemini-worker%20service%2C%20restarted%20on%20failure%20and%20after%20a%20reboot%2C%20giving%20the%20agent%20~%2Fworkspace%0A-%20No%20environment%20key%20on%20the%20VM%3B%20the%20worker%20reaches%20Google%20through%20%60https%3A%2F%2Fgemini-env.int.exe.xyz%60%0A-%20%60Worker%20...%20polling%60%20in%20%60journalctl%20-u%20gemini-worker%60%20once%20the%20owner%20has%20added%20the%20gemini-env%20integration%0A%0ARun%20%22Set%20up%20the%20worker%20by%20hand%22%20from%20%22On%20the%20VM%22%2C%20skipping%20VM%20creation%0Aand%20SSH.%20Install%20exactly%20the%20pinned%20version.%20Don%27t%20ask%20for%20or%20handle%20any%0Akey%3A%20the%20environment%20key%20goes%20into%20an%20exe.dev%20integration%20that%20only%20the%0Aowner%20can%20add%2C%20from%20their%20computer.%20Until%20they%20do%2C%20the%20log%20shows%0A%60integration%20not%20found%20or%20not%20attached%20to%20this%20VM%60%2C%20which%20is%20expected%3B%0Atell%20the%20owner%20to%20run%20the%20%60integrations%20add%60%20command%20from%20%22Connect%20the%0Aworker%22%20in%20the%20folder%20where%20they%20saved%20gemini-env.json%2C%20then%20check%20the%0Alog%20for%20%60polling%60.%20Don%27t%20change%20the%20VM%27s%20egress%20policy.%20Finish%20by%20pointing%0Athe%20owner%20to%20%22Give%20it%20a%20task%22.%0A%0AFinish%20with%20the%20URLs%20I%20should%20open%20and%20these%20commands%2C%20which%20only%20I%20can%20run%2C%20from%20my%20own%20computer%20%28with%20this%20VM%27s%20name%20in%20them%29%3A%0A%20%20ssh%20exe.dev%20integrations%20add%20http-proxy%20--name%20gemini-env%20--target%20https%3A%2F%2Fgenerativelanguage.googleapis.com%20--header%20%22x-goog-environment-key%3A%24%28jq%20-r%20.environment_key%20gemini-env.json%29%22%20--attach%20vm%3Amy-gemini-sandbox%20%20%20%23%20in%20the%20folder%20with%20gemini-env.json%0A",
    "terminal": "curl -fsSL https://exe.dev/deploy/gemini-managed-agents/prompt.txt | ssh exe.dev new --prompt=/dev/stdin",
    "prompt": "Set up Gemini Managed Agents on this VM by following the exe.dev recipe at https://exe.dev/deploy/gemini-managed-agents.md?via=deploy from top to bottom.\n\nThe recipe's example VM name is my-gemini-sandbox. This VM's name is the output of `hostname`: use it wherever the recipe writes my-gemini-sandbox. Skip the step that creates the VM; you are on it.\n\nYou are done when all of these are true. Check each one yourself:\n- The gemini-api CLI 0.4.6 in /usr/local/bin\n- The gemini-worker service, restarted on failure and after a reboot, giving the agent ~/workspace\n- No environment key on the VM; the worker reaches Google through `https://gemini-env.int.exe.xyz`\n- `Worker ... polling` in `journalctl -u gemini-worker` once the owner has added the gemini-env integration\n\nRun \"Set up the worker by hand\" from \"On the VM\", skipping VM creation\nand SSH. Install exactly the pinned version. Don't ask for or handle any\nkey: the environment key goes into an exe.dev integration that only the\nowner can add, from their computer. Until they do, the log shows\n`integration not found or not attached to this VM`, which is expected;\ntell the owner to run the `integrations add` command from \"Connect the\nworker\" in the folder where they saved gemini-env.json, then check the\nlog for `polling`. Don't change the VM's egress policy. Finish by pointing\nthe owner to \"Give it a task\".\n\nFinish with the URLs I should open and these commands, which only I can run, from my own computer (with this VM's name in them):\n  ssh exe.dev integrations add http-proxy --name gemini-env --target https://generativelanguage.googleapis.com --header \"x-goog-environment-key:$(jq -r .environment_key gemini-env.json)\" --attach vm:my-gemini-sandbox   # in the folder with gemini-env.json\n",
    "prompt_url": "https://exe.dev/deploy/gemini-managed-agents/prompt.txt"
  },
  "updated": "2026-11-17",
  "verified": "2026-11-17",
  "related": [
    "claude-managed-agents",
    "agent-secrets",
    "antigravity-cli",
    "gemini-cli",
    "agents",
    "claude-code"
  ],
  "alternatives": [
    "E2B",
    "Fly.io Sprites",
    "Modal",
    "Daytona",
    "Vercel Sandbox",
    "Cloudflare Sandbox"
  ]
}
