Antigravity SDK Guide: Build Custom AI Agents with Google's Managed Agent API (2026)
The Antigravity SDK is Googleโs programmatic interface for building custom AI agents that run as managed services on the Gemini API. Announced at Google I/O 2026, the SDK is the third surface of the Antigravity 2.0 platform โ alongside the Desktop app and the agy CLI โ giving developers control over agent creation, customization and deployment through code.
Current default: Googleโs September 2 documentation says the Antigravity agent in Gemini Managed Agents and the Antigravity SDK now use Gemini 3.8 Flash by default. This is a Google Managed Agents default, not a claim that every Antigravity-branded or third-party agent surface has migrated.
Migration required by October 5: Google released
antigravity-preview-09-2026on September 17 and will shut downantigravity-preview-05-2026on October 5, 2026. Remote-sandbox consumers that only read final output can normally change the agent identifier. Local tool implementations and applications that parse function calls must also migrate the changed tool schemas described below.
Local and hybrid execution: The Antigravity SDK now supports local model endpoints and offline workflows. After required models and assets are downloaded, a workflow can remain local, or use a cloud planner with a local builder. Googleโs documented OpenAI-compatible path covers Ollama, LM Studio and vLLM. Local support does not make every configuration lightweight: Googleโs Gemma 4 26B-A4B reference recommends more than 24 GB of VRAM or unified memory.
If youโve been looking for a way to spin up AI agents that can reason, write and execute code, manage files, and browse the web โ all without managing infrastructure โ the Antigravity SDK and its Managed Agents API is exactly that.
What Are Managed Agents on the Gemini API?
Managed agents are a new primitive on the Gemini API. Instead of stitching together a model call, a code interpreter, a file system, and a browser tool yourself, a single API call gives you a fully operational agent running inside a secure Linux sandbox hosted by Google.
The concept is straightforward: you describe what you want the agent to do, and Google handles the orchestration layer โ the reasoning loop, tool dispatch, sandbox lifecycle, and state management. You focus on the what, not the how.
This is fundamentally different from traditional agent frameworks where youโre responsible for the execution environment, tool integration, and loop management. With managed agents on the Gemini API, all of that is abstracted away.
How the Antigravity SDK Works
At its core, the Antigravity SDK exposes the Managed Agents API through a clean client library. Hereโs what happens when you create an agent:
- You make a single API call with your agent configuration (instructions, skills, data)
- Google provisions a secure Linux sandbox โ an isolated environment with code execution, file system access, and web browsing capabilities
- The agent reasons and acts within that sandbox, using Gemini 3.8 Flash by default or another supported model you explicitly select
- Results stream back via the API โ structured output, generated files, execution logs
The sandbox supports:
- Code execution โ Python, Node.js, shell scripts, and more
- File management โ read, write, create, and organize files within the sandbox
- Web browsing โ fetch pages, extract data, interact with web content
- Search โ grounded web search for real-time information
- Function calling โ invoke your own tools and APIs
- Structured output โ get typed, parseable responses
Managed, local or hybrid
Choose the execution pattern based on data boundaries and hardware:
| Pattern | Planner | Builder/executor | Best fit |
|---|---|---|---|
| Managed | Google-hosted | Google-hosted sandbox | Fast setup and elastic execution |
| Fully local | Local model | Local machine | Offline work and sensitive codebases |
| Hybrid | Cloud model | Local model and tools | Strong planning with local code execution |
Local providers connect through an OpenAI-compatible endpoint. Google explicitly documents Ollama, LM Studio and vLLM. Download the required model and runtime assets before expecting an offline workflow, then disable network access during a test run to prove that your chosen tools do not make hidden cloud calls.
Local execution changes the trust boundary rather than removing operational work. You are responsible for model serving, memory pressure, tool permissions and updates. A 26B mixture-of-experts model may activate fewer parameters per token, but its weights and KV cache still make the reference setup hardware-heavy.
Migrating from 05-2026 to 09-2026
The September preview is not only a version-name change for every integration. Googleโs remote sandbox continues to execute the built-in tools for you, so an application using environment: "remote" and reading only output_text or model_output generally needs to replace the agent identifier. Applications using local_environment, dispatching the built-in calls themselves, or parsing function_call steps must update their schemas.
| 05-2026 tool | 09-2026 replacement | Important change |
|---|---|---|
write_file(path, content) | write_to_file(TargetFile, CodeContent, Overwrite, Description) | PascalCase parameters and explicit overwrite intent |
write_file(...) for edits | replace_file_content(TargetFile, StartLine, EndLine, TargetContent, ReplacementContent) | Line-range replacement instead of rewriting the whole file |
read_file(path, offset, limit) | view_file(AbsolutePath, StartLine, EndLine, ContentOffset) | Line-oriented file reads |
list_files(path) | list_dir(DirectoryPath) | Renamed tool and parameter |
| Shell-based name search | find_by_name(SearchDirectory, Pattern, MaxDepth) | Dedicated file-name search |
| Shell-based content search | grep_search(SearchPath, Query, IsRegex) | Dedicated content search |
code_execution(command, timeout_seconds) and google_search(queries) remain documented under their existing names. Do not translate every argument mechanically to PascalCase without checking the current tool definition. Generate local schemas from the 09-2026 documentation, update fixtures that assert function names, and test partial file replacements against real line boundaries before switching production traffic.
For a staged migration, run both versions against the same non-destructive task, compare final output and tool traces, then move callers to antigravity-preview-09-2026. The May identifier should not remain as a fallback after October 5 because Google documents that date as a shutdown, not a soft deprecation.
Inline vs Saved Agents
The Antigravity SDK supports two modes for working with managed agents:
Inline Agents
Inline agents are customized at interaction time. You pass instructions, skills, and data directly in the API call. This is ideal for dynamic use cases where the agentโs behavior changes based on context โ think per-request customization in a CI/CD pipeline or a user-facing application.
Saved Agents
Saved agents are persisted configurations that you invoke by ID. You define the agent once โ its instructions, skills, available tools โ and then call it repeatedly without re-specifying the configuration. This is the pattern for production workloads: define once, invoke many times.
Saved agents integrate directly with the Agent Platform on Google Cloud, making them suitable for production deployments with monitoring, versioning, and access control.
Code Example: Creating a Custom Agent
Hereโs how to create an inline managed agent with the Antigravity SDK:
from antigravity import AntigravityClient
client = AntigravityClient(api_key="YOUR_GEMINI_API_KEY")
# Create an inline agent with custom instructions
response = client.agents.create_and_run(
model="gemini-3.8-flash",
instructions="""You are a code review agent. Analyze the provided code for:
- Security vulnerabilities
- Performance issues
- Code style violations
Return a structured report with severity levels.""",
skills=["code_execution", "file_management"],
input="Review the Python files in the uploaded project.",
files=["./src/main.py", "./src/utils.py"],
output_format="json"
)
print(response.output)
And hereโs how to create and invoke a saved agent:
# Create a saved agent (one-time setup)
agent = client.agents.create(
name="code-reviewer",
model="gemini-3.8-flash",
instructions="You are a senior code reviewer...",
skills=["code_execution", "file_management", "search"],
tools=[{
"type": "function",
"function": {
"name": "post_review_comment",
"description": "Posts a review comment to the PR",
"parameters": { ... }
}
}]
)
# Invoke by ID (repeated use)
result = client.agents.run(
agent_id=agent.id,
input="Review PR #142 for security issues",
files=["./diff.patch"]
)
Adding Skills and Instructions
Skills define what capabilities your agent has access to. The Antigravity SDK provides built-in skills and lets you define custom ones:
Built-in skills:
code_executionโ run code in the sandboxfile_managementโ CRUD operations on filesweb_browsingโ navigate and extract from web pagessearchโ grounded Google Searchstructured_outputโ enforce output schemas
Custom instructions shape how the agent reasons and behaves. Best practices:
instructions = """
Role: You are a deployment automation agent.
Context: You operate in a CI/CD pipeline for a Node.js application.
Constraints:
- Never modify production databases directly
- Always run tests before deploying
- Report failures immediately via the notify_team function
Output: Provide a deployment summary in JSON format.
"""
The combination of skills + instructions + data (files, context) gives you fine-grained control over agent behavior without writing orchestration code.
MCP Integration
The Antigravity SDK supports extending agents with MCP (Model Context Protocol) servers. This means your managed agents can connect to external tools, databases, and services through the standardized MCP interface.
agent = client.agents.create_and_run(
model="gemini-3.8-flash",
instructions="You are a database migration agent.",
skills=["code_execution"],
mcp_servers=[
{
"name": "postgres-mcp",
"url": "https://your-mcp-server.com/postgres",
"auth": {"type": "bearer", "token": "..."}
}
],
input="Generate and apply migration for adding a 'status' column to the orders table."
)
MCP integration turns managed agents into connectors for your entire infrastructure โ they can interact with any system that exposes an MCP server.
Use Cases
The Antigravity SDK shines in scenarios where you need autonomous AI agents that operate on code, data, or infrastructure:
CI/CD Automation
Spin up an agent per pull request that reviews code, runs tests, checks for security issues, and posts comments. The agent lives for the duration of the pipeline run and has full access to the codebase in its sandbox.
Custom Coding Pipelines
Build agents that generate code from specs, refactor existing codebases, or migrate between frameworks. The codelabs released alongside the SDK include spec-driven ADK agent development and autonomous developer pipelines.
Research Agents
Create agents that browse the web, synthesize information, and produce structured reports. Combine search + web_browsing + file_management skills for end-to-end research workflows.
Deployment Agents
Agents that manage your deployment process โ running health checks, rolling back on failure, and notifying your team. Pair with MCP servers connected to your cloud infrastructure.
Pricing and Access
The Antigravity SDK and Managed Agents API are available through the Gemini API at ai.google.dev. Pricing follows the standard Gemini API model:
- Model usage โ billed at the rate of Gemini 3.8 Flash or whichever supported model you explicitly select; 3.8โs introductory pricing ends December 31, 2026
- Sandbox compute โ billed per second of sandbox runtime
- Storage โ for saved agents and persistent files
Free tier access is available for experimentation. For production workloads, the Agent Platform on Google Cloud provides enterprise features including SLAs, VPC integration, and audit logging.
FAQ
What is the Antigravity SDK?
The Antigravity SDK is Googleโs programmatic interface for creating and managing AI agents on the Gemini API. Itโs part of the Antigravity 2.0 platform announced at Google I/O 2026, alongside the Desktop app and the agy CLI.
How do managed agents on the Gemini API differ from regular model calls?
Regular model calls return text completions. Managed agents are autonomous entities that can reason across multiple steps, execute code, manage files, browse the web, and use tools โ all within a secure sandbox managed by Google. You get an agent that acts, not just a model that responds.
Do I need to manage infrastructure for managed agents?
No. The entire execution environment โ the Linux sandbox, code runtime, file system, and browser โ is hosted and managed by Google. You interact purely through the API.
Can I use the Antigravity SDK with existing agent frameworks?
Yes. The SDK can be used standalone or integrated into existing agent frameworks. You can also extend managed agents with MCP servers to connect them to your existing tooling.
What models does the Managed Agents API support?
Google currently documents Gemini 3.8 Flash as the default for the Antigravity agent and SDK. Model selection can still be specified per agent creation call where the Managed Agents surface supports the requested model.
Is the Antigravity SDK free to use?
Thereโs a free tier for experimentation and development. Production usage is billed based on token consumption, sandbox compute time, and storage. Check ai.google.dev for current pricing.