Building a SaaS tool or MCP server? Get listed or sponsor AgentStackList →
Gemini Agents By Sarah Mitchell

Gemini's managed agents can now run their code on your own machines, with no inbound ports to open

Managed Agents on the Gemini API run an agent loop (the default is the Antigravity agent) that executes shell and file tools inside a Linux sandbox. Until now that sandbox was hosted by Google; you can now bring your own. You register a self-hosted environment, run Google's open-source Gemini API CLI inside your container, VM or sandbox provider, and the agent's tool calls execute there while Google still runs the model and the loop. The connection is outbound HTTPS only, so you don't open any inbound firewall ports, and Docker, rootless Podman and providers such as Daytona are supported.

Why it matters

Teams that couldn't send code or data into a Google-hosted sandbox can now keep execution, files and network access inside infrastructure they control.

Who it's for

Developers and platform teams building agents on the Gemini API with compliance, data-residency or private-network needs.

How to try it

  1. Call POST /v1beta/environments with {"mode": "self_hosted"} to get an environment id and a one-time environment_key.
  2. Inside your sandbox, install google-gemini/gemini-api-cli and run gemini-api environments connect with that key.
  3. Pass the environment id as environment when you call interactions.create.
  4. For production, provision a fresh sandbox per interaction (environments poll) so no long-lived credentials sit in each box.

Plan & availability: Preview feature of Managed Agents on the Gemini API (features may change). Hosted-sandbox options like sources, network rules, env and file snapshots don't apply to self-hosted environments. Google isn't billing hosted-environment compute during the preview; agent tokens are billed as usual. Announced by Google AI Studio on X and documented on aistudio.google.com, checked November 11, 2026.

Share on X

Source: Google AI Studio on aistudio.google.com

Written by Sarah Mitchell from the original post. Checked Nov 12, 2026. Features, plans and availability can change, so confirm on the source before you rely on it.

gemini-apimanaged-agentsself-hostedsandboxantigravitydaytona

More Gemini tricks

All Gemini tricks →