Tool execution can move to a company's own infrastructure

Google said on Nov. 11 (Nov. 12 Japan time) that developers can now connect sandboxes (execution environments isolated from the outside) they set up themselves to Managed Agents, the AI agent feature of the Gemini API. The official X account of Google AI Studio, its service for developers, said users can now "bring your own sandbox."

building with Managed Agents on the Gemini API? now you can bring your own sandbox with self-hosted environments start building today: https://t.co/shgEhF5GRX https://t.co/xUBUB9qHWa

Managed Agents uses Linux sandboxes as the place where agents run code and save files. According to the official documentation, Google provides the sandbox by default, and connecting a self-hosted environment lets the agent's tools run inside computing infrastructure the user manages.

Google released Managed Agents in preview on the Gemini API on May 19, initially running it in isolated Linux sandboxes provided by Google. On Nov. 4, ORIENS reported that Google AI Studio was expected to add a screen for managing Managed Agents in one place. Support for self-hosted sandboxes has now been announced officially by Google.

Outbound connections only

According to the documentation, a self-hosted sandbox connects to Google over outbound HTTPS using the Gemini API CLI, which Google publishes as open source. There is no need to open inbound firewall ports.

Connecting takes three steps. First, specify the self_hosted type when creating an environment through the API, and receive the environment ID and a key that is issued only once (environment_key). Next, run the Gemini API CLI's gemini-api environments connect with that key inside the sandbox, then pass the environment ID when running the agent. According to the API reference, the key is included only in the response at creation and is not returned when the environment's details are retrieved later. Fields available only for self-hosted environments include a custom configuration (custom_config) and instructions to the agent (system_instruction). The API is in beta.

The runtime can also run in Docker or rootless Podman containers, and can run on a local machine for testing. When it runs locally, however, the agent's shell commands are executed directly on the machine unless --disable-bash is specified.

Google-side settings unavailable, no pricing given

Among the settings for Google-provided sandboxes, file sources, network restrictions, environment variables and file snapshots cannot be used with self-hosted environments, and specifying them causes the request to be rejected (400 INVALID_ARGUMENT).

On pricing, the documentation says computing resources for Google-provided environments are not charged during the preview, and refers to the pricing page for agent token charges. It does not state the pricing or billing for computing resources in self-hosted environments.

Both environments and Managed Agents are in preview, and Google says features and specifications may change. The documentation says setup steps and example configurations are covered in a separate guide, but the guide could not be located as of the morning of Nov. 12. The Nov. 11 entry in the official changelog covers only a different feature and does not include this support.