Published: 2026-10-26
Summary
Summary
Gemini managed agents: a sandboxed Antigravity agent in one Interactions API call, with reusable environments and credentials that never enter the sandbox
Chapters / key moments (click to jump — plays here on the page)
Gemini managed agents run a coding-agent harness in a Google-hosted sandbox behind a single API call, so you do not provision a container or build a harness. Jack Wotherspoon of Google DeepMind demonstrates a chain of three agents sharing one sandbox. This summary follows the talk and then checks each setting against the Gemini API documentation, which is still marked preview.
Source video
"Build Your Own Team of Managed Agents - Jack Wotherspoon, Google DeepMind" by AI Engineer — Watch on YouTube →
What the talk shows
- The idea. Instead of running a coding agent on your laptop, call an agent in the cloud. The sandbox, the harness and the scaling are handled for you, so adding capacity means making more API calls.
- Building blocks. The harness (the same one that runs in Google's Antigravity products), the environment (the sandbox file system), skills, credentials and triggers.
- Two kinds of state. Interactions hold the conversation, and an interaction's ID is passed to the next turn. Environments hold the files. Because they are separate, a second agent can reuse the first agent's environment with a fresh context window.
- The demo. An SEC-filing researcher agent writes metrics for a company to a file, a "quant" agent reuses the same environment to read that file and run Python for a valuation, and a third agent turns the output into a report. He says connecting MCP servers would let the last step write to Google Docs or Slack.
- Secrets. A proxy sits between the sandbox and the API. The sandbox holds only a placeholder token; the proxy injects the real one when the agent calls the matching API, so the agent never sees your GitHub token.
- Models. He says the model is a one-line setting in the agent config and recommends Gemini 4 Argon for deep reasoning, with Flash for speed, and describes a "long decode" mode in which the 1M-token window is shared between input, thinking and output.
Checked against Google's documentation
From the Gemini API docs (managed agents quickstart, building managed agents, credentials and the antigravity-preview-09-2026 model page), read 2026-10-26.
from google import genai
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-09-2026",
input="...",
environment="remote", # a new sandbox
)
print(interaction.id, interaction.environment_id, interaction.output_text)
# continue the conversation in the same sandbox
interaction_2 = client.interactions.create(
agent="antigravity-preview-09-2026",
previous_interaction_id=interaction.id,
environment=interaction.environment_id,
input="...",
)
- State rules. Omitting
previous_interaction_idkeeps the files but starts a fresh conversation. Usingenvironment="remote"with aprevious_interaction_idkeeps the conversation in a new sandbox. Files can be downloaded fromhttps://generativelanguage.googleapis.com/v1beta/files/environment-{env_id}:download?alt=media. - Saving an agent.
client.agents.create(...)takesid(must not start withgemini-,google-orantigravity-),base_agent(currently onlyantigravity-preview-09-2026),agent_config,system_instruction,tools(defaultcode_execution,google_search,url_context;mcp_serverandfunctionare also supported) andbase_environment. Invoke it withagent="<id>"andenvironment="remote"; each invocation forks the base environment. - Mounts. In
base_environment.sources, an inline source targeting.agents/AGENTS.mdis loaded as system instructions at startup, skills go under.agents/skills/<skill-name>/SKILL.mdand are auto-discovered, and arepositorysource mounts a Git repository. - Credentials. Created with
client.credentials.createand referenced by ID. Types arebearer_token,oauth2andenvironment_variable; secret values are write-only. An environment-variable credential appears in the container as a placeholder named__GEMINI_CRED_<credential-id>__, and the proxy swaps in the real value only for requests to the credential'strusted_domains. Plainenvvalues are readable in the sandbox, so never put secrets there. - Limits. Preview ("features and schemas may change"), up to 1,000 managed agents, no versioning or rollback and no subagent nesting yet. The model page lists a 1,048,576-token input window with compaction at about 135K and a 65,536-token output limit. The docs state no price on these pages.
Where the talk and the docs differ
- Models. The docs list
gemini-3.8-flash(the default),gemini-3.6-flashandgemini-3.5-flash-liteasagent_configmodels, and say the model cannot change at invocation time for a named agent. Gemini 4 Argon is not on that list as of 2026-10-26, although the talk recommends it. - Long output. The shared-window "long decode" mode is not mentioned on the pages we read, and the model page gives a 65,536-token output limit.
- Triggers. The talk describes scheduling an agent (for example every morning before the market opens). The page on building managed agents says it does not cover triggers, so we could not confirm how they are set up.
Gotchas & Caveats
- The speaker works at Google DeepMind, so the talk is a product pitch. The financial examples are demos, not investment advice.
- Everything here is preview. The agent ID changed between versions in the docs (05-2026 then 09-2026), so pin the ID you tested.
Key Takeaways
- One call with
environment="remote"gives you a sandboxed agent; carryenvironment_idforward to share files andprevious_interaction_idto share the conversation. - Mount instructions at
.agents/AGENTS.mdand skills at.agents/skills/so a saved agent behaves the same on every run. - Store tokens as credentials, not in
env, so the proxy injects them and the sandbox never holds the secret.





