Google Antigravity Agent: Managed Sandbox on the Gemini API

Coffee Summary

  • Google’s Antigravity agent is a managed agent on the Gemini API: one Interactions API call provisions a Linux sandbox hosted by Google and runs a tool-use loop.
  • Agent id: antigravity-preview-05-2026; default model is gemini-3.8-flash via agent_config (other Flash variants selectable).
  • Default tools: code_execution, google_search, url_context; filesystem tools appear when you set environment. Custom functions and remote MCP (streamable HTTP) are supported.
  • Pricing FACT: pay Gemini tokens + tools; environment compute is not billed during preview. Use max_total_tokens in agent_config as a budget.
  • Preview limits: no temperature/top_p-style generation config, no structured outputs, no file_search / computer_use / google_maps yet; multimodal input is text + image only.

What happened

Google published Antigravity agent docs for the Gemini API (docs page last updated 2026-09-02). The product pitch is a managed agent: you call the Interactions API with agent antigravity-preview-05-2026, and Google hosts a secure Linux sandbox that plans, executes tools, and iterates until the task finishes. Google states it uses the same harness as the Antigravity IDE, with Gemini 3.8 Flash as the default underlying model.

A minimal call passes agent, input, and environment (commonly "remote" for a fresh sandbox). Available through the Interactions API and Google AI Studio.

Why it matters

Builder teams often stitch model calls, bash runners, file I/O, and web fetch into a fragile loop. Antigravity productizes that loop behind one agent id: code execution (Bash/Python/Node), web search, URL context, sandbox filesystem (when environment is set), plus hooks to validate tool runs inside the sandbox.

For long sessions, docs FACT that context compaction triggers around ~135k tokens, so multi-turn agent work can continue without you hand-rolling summarization. Background mode (background=True), polling, and cancel are first-class for jobs that run for minutes.

What changed

Managed API path vs local SDK

| Path | What you get | Notes |

| — | — | — |

| Gemini Interactions API agent | Hosted Linux sandbox + Antigravity harness | Agent id `antigravity-preview-05-2026`; this article’s focus |

| Local Python SDK (`pip install google-antigravity`) | Alternate local/dev path | Mentioned for builders who want the SDK package; not required for the managed API |

Tools and environment

Defaults: code_execution, google_search, url_context. Filesystem tools enable automatically when environment is set. You can add custom functions and remote MCP servers over streamable HTTP. MCP name must be lowercase alphanumeric (docs pattern ^[a-z0-9_-]+$); SSE transport is not supported.

environment accepts "remote", an existing env id, or a full EnvironmentConfig (sources, network allowlists, etc.).

Async, budgets, and cost shape

  • background=True returns immediately; poll until completed / failed; cancel is supported. Background requires store=True (default).
  • Budget FACT: set max_total_tokens inside agent_config (type: "antigravity"). Cached tokens do not count toward that limit; hitting the budget yields status: "incomplete" (best-effort).
  • Pricing FACT: pay-as-you-go for underlying Gemini tokens and tools used in the agentic loop. Environment compute (CPU/memory/sandbox) is not billed during preview.
  • Docs include estimated cost bands for research, document, design, and data tasks (illustrative ranges from Google’s runs — treat as guidance, not a quote for your workload). Complex loops can reach multi-million tokens.

Who should care

  • Teams that want a hosted sandbox agent on Gemini without operating their own executor fleet.
  • Product engineers wiring custom functions or remote MCP into a Google-hosted loop.
  • Cost-sensitive builders who need max_total_tokens and preview-era free sandbox compute while prototyping.

Limitations

  • Preview: schemas and features may change.
  • Unsupported generation config: temperature, top_p, top_k, stop_sequences, max_output_tokens return 400.
  • No structured outputs for this agent.
  • Tools not yet available: file_search, computer_use, google_maps.
  • Multimodal: text and image only (inline base64); audio/video/document inputs unsupported.
  • Function calling is stateful (previous_interaction_id); reconstructing history manually is not supported.
  • Remote MCP: streamable HTTP only; uppercase server names fail with a generic 400.

What to do next

1. Read the Antigravity agent docs and run one environment="remote" task end-to-end (search → code → file write).

2. Set agent_config.max_total_tokens before any unattended loop; plan for incomplete continuations.

3. Restrict tools to what the task needs; register MCP only with lowercase names over streamable HTTP.

4. Prefer background=True + poll/cancel for long jobs; reuse environment_id across turns to keep sandbox state.

5. If you need a local harness instead of hosted sandbox, evaluate pip install google-antigravity separately — do not confuse it with the managed API path.

AIImpish Take

Antigravity on the Gemini API is Google’s “managed sandbox agent in one call” offering: same IDE harness, Flash-class default model, and preview economics that bill tokens/tools but not env compute. It is useful when your bottleneck is running a durable tool loop, not inventing a new model. Ship with budgets and preview caveats in mind — especially missing structured outputs and several Gemini tools — and treat Google’s cost estimate table as a planning aid, not a procurement guarantee.