Google Antigravity Integration Guide
Technology: antigravity · Category: tooling · Last reviewed: 2026-10-20
Source: https://tech-stack.codeamanilabs.org/guide/antigravity
Insight:
Antigravity is an agent-first platform, not an editor with AI bolted on: you dispatch agents, then verify them through Artifacts (plans, diffs, screenshots, browser recordings) instead of reading logs. One harness now ships as four surfaces: the Antigravity App (desktop command center, v2.24), the
agyCLI (v1.4, the right fit for WSL and CI), editor extensions, and a Python SDK. Everything is configured with plain files under.agents/(rules, skills, custom agents,mcp_config.json,hooks.json), and it readsAGENTS.md, so this repo's mirrored conventions apply with no extra setup. Two dates matter this month: legacy workflows stopped working on 2026-10-19 (migrate them to skills), and Claude 4.6 and GPT-OSS leave on 2026-11-02. After that, Claude (now Sonnet/Opus 5.5) needs a paid Google AI Pro, Ultra, or Enterprise plan.
█████╗ ███╗ ██╗████████╗██╗ ██████╗ ██████╗ █████╗ ██╗ ██╗██╗████████╗██╗ ██╗
██╔══██╗████╗ ██║╚══██╔══╝██║██╔════╝ ██╔══██╗██╔══██╗██║ ██║██║╚══██╔══╝╚██╗ ██╔╝
███████║██╔██╗ ██║ ██║ ██║██║ ███╗██████╔╝███████║██║ ██║██║ ██║ ╚████╔╝
██╔══██║██║╚██╗██║ ██║ ██║██║ ██║██╔══██╗██╔══██║╚██╗ ██╔╝██║ ██║ ╚██╔╝
██║ ██║██║ ╚████║ ██║ ██║╚██████╔╝██║ ██║██║ ██║ ╚████╔╝ ██║ ██║ ██║
╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝
Google Antigravity Integration Guide
Focus: running Antigravity on a Linux / WSL Ubuntu dev box. The Antigravity App is the agent command center and the
agyCLI drives agents from a terminal or CI. Covers install and auth, models and plans, the Agent Manager and subagents, custom agents, rules, skills (and the workflow sunset), MCP configuration, the browser subagent, permissions, hooks, sidecars, headless CI, and the Python SDK. Grounded in theantigravity.google/docsMarkdown pages and the changelog; reviewed 2026-10-20.
Overview
Google Antigravity is Google's agentic development platform. Instead of an editor where you type and an AI suggests, you give an agent a goal; it plans and executes across the editor, terminal, and Chrome, then reports through Artifacts: implementation plans, code diffs, architecture diagrams, images, and browser recordings. It launched in public preview in November 2025. At I/O 2026 (2026-05-19) it pivoted to multi-agent orchestration with a standalone desktop app, the agy CLI, and the Python SDK, plus an enterprise offering through Gemini Enterprise.
One agent harness, four surfaces. Sign-in is shared across all local surfaces.
| Surface | Current version | Reach for it when |
|---|---|---|
| Antigravity App (desktop; launched as "Antigravity 2.0") | v2.24.0 (2026-10-15) | You want the full experience: Projects, parallel agents, Artifact review, automations, Remote Control |
Antigravity CLI (agy) |
v1.4.0 (2026-10-16) | You work in a terminal, over SSH, inside WSL, or need headless CI runs |
| IDE extensions | VS Code v1.8.0, Visual Studio v1.0.261012.0; JetBrains, Zed, Xcode | You want the agent inside your existing editor |
| Antigravity IDE (standalone editor) | v2.5.5 (2026-08-13) | Legacy editor view with Tab completions and the in-editor Agent Manager (Cmd/Ctrl+E). No release since August, and no Gemini 4 Argon |
| Antigravity SDK | google-antigravity 0.1.22 (2026-10-12) |
You build your own agents in Python |
Agent Manager, then and now. In the 2025 IDE, the Agent Manager was the surface for running agents alongside the editor. The Antigravity App replaced it as a standalone app built around Projects. In the CLI, /agents opens a panel the docs still call the Agent Manager panel: it lists custom agents and the live state of background subagents.
flowchart TB
G["Your goal"] --> H["Antigravity agent harness"]
subgraph SURF["Surfaces (shared sign-in)"]
A["Antigravity App<br/>Projects · worktrees · automations"]
C["agy CLI<br/>TUI · headless · remote-control"]
E["IDE extensions<br/>VS Code · JetBrains · Zed · Xcode · VS"]
S["SDK<br/>google-antigravity (py)"]
end
H --> A & C & E & S
H --> M["Models<br/>Gemini 4 Argon · 3.8 Flash<br/>Claude 5.5 · (4.6/GPT-OSS until Nov 2)"]
CFG[".agents/<br/>AGENTS.md · rules · skills<br/>agents · mcp_config.json · hooks.json"] --> H
H --> SUB["Subagents<br/>research · browser · self · custom"]
SUB --> ART["Artifacts<br/>plans · diffs · screenshots · WebM"]
H --> ENV["Editor · Terminal (sandbox) · Chrome"]
See also:
cursor/andvscode/for the other editors this repo covers, andgoogle-ai-studio//google-cloud/for the Gemini API key and Vertex AI side used byGEMINI_API_KEYand ADC auth.
Official Documentation
Every docs page is also served as Markdown: append .md to the path (for example https://antigravity.google/docs/mcp.md). The full page list is in https://antigravity.google/sitemap-0.xml.
Install and authenticate (Linux / WSL)
The agy CLI (primary on a WSL box)
# Inside WSL Ubuntu (or any Linux / macOS shell); installs ~/.local/bin/agy
curl -fsSL https://antigravity.google/cli/install.sh | bash
export PATH="$HOME/.local/bin:$PATH" # if the installer didn't add it
agy --version
agy # first launch: workspace trust prompt + sign-in
Windows outside WSL: irm https://antigravity.google/cli/install.ps1 | iex (PowerShell) or the install.cmd one-liner on the download page. Installer flags: --skip-aliases, --skip-path.
Sign-in options:
| Where | How |
|---|---|
| Local machine | Browser OAuth. The token is stored in the OS keyring (Linux Secret Service/dbus, Apple Keychain, Windows Credential Manager) and reused silently. |
| SSH / headless WSL without a browser | The CLI detects SSH, prints an authorization URL, and you paste the returned code back. |
| Own Gemini API key (CI, no account session) | Set "modelProvider": "gemini" in ~/.gemini/antigravity-cli/settings.json and export GEMINI_API_KEY. Setting the key alone does nothing. The CLI does not read .env files or GOOGLE_API_KEY. |
| Google Cloud / Gemini Enterprise | gcloud auth application-default login --project <id>, then set AGY_ADC_AUTH=true (optional GOOGLE_CLOUD_QUOTA_PROJECT, GOOGLE_CLOUD_LOCATION). Claude Sonnet/Opus 5.5 show up only if the project has access. |
The only secret involved is the Gemini API key. Store it in Hazina, not a dotfile:
GEMINI_API_KEY=AIza...
Non-secret settings:
| Variable / setting | Purpose |
|---|---|
modelProvider: "gemini" (CLI settings.json) |
Use GEMINI_API_KEY instead of an account session |
GOOGLE_GEMINI_BASE_URL |
Point the CLI at a different Gemini-compatible endpoint |
AGY_ADC_AUTH = true |
Sign in with Application Default Credentials (CLI and App) |
GOOGLE_CLOUD_QUOTA_PROJECT, GOOGLE_CLOUD_LOCATION |
ADC project and location |
AGY_CLI_OSC7501 = on / off |
Terminal tab status reporting (CLI 1.4.0+) |
The Antigravity App (desktop)
Download from https://antigravity.google/download: macOS 12+ (Apple Silicon or Intel), Windows 10 64-bit+ (x64 or ARM64), Linux x64 / ARM64 .tar.gz (needs glibc >= 2.28 and glibcxx >= 3.4.25, for example Ubuntu 20+, Debian 10+, Fedora 36+, RHEL 8+). On WSL it needs WSLg. Most WSL work is better served by the CLI.
Changed since the last review: the download page no longer documents an apt repository. Google's old apt repo (
us-central1-apt.pkg.dev/projects/antigravity-auto-updater-dev/, packageantigravity) still answers but serves the 2025 IDE line (1.23.x), not the current App or IDE. Don't use it.
Package trap.
pip install antigravityinstalls the XKCD joke module (PyPIantigravity0.1). Google's SDK isgoogle-antigravity.
Availability: personal Google accounts, age 18+, in listed countries. The United States and Kenya are both listed (/docs/faq). Workspace accounts sometimes fail where @gmail.com works.
Models and plans
Models (/docs/models, 2026-10-20)
| Model | Free & AI Plus | AI Pro | AI Ultra | Enterprise |
|---|---|---|---|---|
| Gemini 4 Argon (App, CLI, extensions; not the standalone IDE) | ❌ | ✅ (paid, not trial) | ✅ | ✅ |
| Gemini 3.8 Flash | ✅ | ✅ | ✅ | ✅ |
| Gemini 3.7 Flash, 3.6 Flash, 3.1 Pro | ❌ | ❌ | ❌ | ✅ |
| Claude Sonnet 5.5 / Opus 5.5 (thinking) | ❌ | ✅ (paid, not trial) | ✅ | ✅ |
| Claude Sonnet 4.6 / Opus 4.6 (thinking) | ✅ | ✅ | ❌ | ❌ |
| GPT-OSS-120b | ✅ | ✅ | ✅ | ❌ |
- Claude 4.6 and GPT-OSS-120b are removed on 2026-11-02. After that the free tier has Gemini 3.8 Flash only, and Claude means 5.5 on a paid plan.
- Each model offers a thinking level (Low / Medium / High; the CLI's
/effortgoes up tomaxon some models). - The model choice persists within a conversation. A change made mid-turn takes effect after the current turn.
- Automations (scheduled tasks) can pick Flash Lite, Flash, or Pro as of App 2.24.0 and default to Flash.
- Image generation uses Nano Banana 2, which you can't change.
Plans and quota (/pricing, /docs/plans, plans blog 2026-05-19)
| Plan | Price | What you get |
|---|---|---|
| Individual | $0 | Weekly quota and rate limit, unlimited Tab completions, core features (scheduled tasks, CLI) |
| Google AI Pro | $20/mo | Quota that refreshes every 5 hours up to a weekly cap; Gemini 4 Argon and Claude 5.5 on paid (non-trial) subscriptions |
| Google AI Ultra | $100/mo (5x Pro) or $200/mo (20x Pro) | The highest 5-hourly and weekly limits |
| Gemini Enterprise (Google Cloud) | Standard/Plus from $30/seat/mo, or pay-as-you-go ($0 seat fee, consumption pricing) | Google Cloud terms, spend caps, admin controls, BYOID/WIF, VPC-SC |
- All Gemini models draw from one shared pool, weighted by API price, so Flash stretches further than Pro or Argon. Claude and GPT-OSS have their own fixed limit.
- Past the baseline quota, Pro and Ultra users can spend AI credits. The AI Credit Overages setting is
NeverorAlways. Check usage in Settings, or with/usageand/creditsin the CLI. - The App has no BYOK for extra quota. The CLI and SDK can run on your own Gemini API key (billed by the Gemini API) instead of plan quota.
The Antigravity App
- Projects replace the old one-workspace-per-agent mapping. A Project can span multiple folders, run in Local mode or New worktree mode (an isolated Git worktree per agent), and carries its own settings and permission grants.
- Permission presets per project: Default (terminal commands run in a sandbox with no network; files limited to the workspace and temp dirs), Request Review, and Turbo (everything allowed). Choose the preset from the message box (App 2.23.0+).
- Artifacts and the side panel. The overview panel (App 2.24.0) collects artifacts, changed files, links, and uploads. Plans can be commented on inline to steer the agent before it edits.
- Useful commands:
/goal(run until verified done),/browser,/schedule,/boost(multi-agent deep reasoning, Pro/Ultra/Enterprise),/teamwork-preview(agent teams for long work, paid plans),/learn(turn corrections into a rule or skill),/compact(summarize a long conversation),/migrate-workflows. - Shortcuts:
Cmd/Ctrl+Kconversation picker,Cmd/Ctrl+Nnew conversation,Cmd/Ctrl+Lfocus input,Cmd/Ctrl+`terminal,Cmd/Ctrl+,settings,Cmd/Ctrl+Shift+Mmaximize the side panel. - Remote Control: turn on Enable Remote Control in settings, then drive the session from a browser on the Remote Control dashboard, with push notifications when an agent needs input. The CLI equivalents are
/remote-control,agy --remote-control, andagy remote-control start|status|stop(an always-on daemon). - Customizations (Settings → Customizations) manages rules, skills, MCP servers (MCP Store, plus Fix with Agent when a server fails to start), plugins from the Marketplace, and hooks.
Customizing the agent: everything lives under .agents/
Antigravity uses an .agents/ folder in the workspace (legacy .agent/ still loads) and ~/.gemini/... for global config. Commit .agents/ so the whole team gets the same agent.
| Customization | Workspace | Global |
|---|---|---|
| Always-on instructions | AGENTS.md or GEMINI.md in any directory (no frontmatter) |
~/.gemini/AGENTS.md, ~/.gemini/GEMINI.md |
| Rules | .agents/rules/*.md (frontmatter required) |
~/.gemini/config/rules/*.md (CLI also ~/.gemini/antigravity-cli/rules/) |
| Skills | .agents/skills/<name>/SKILL.md |
App/IDE ~/.gemini/config/skills/; CLI ~/.gemini/antigravity-cli/skills/ |
| Custom agents | .agents/agents/<name>.md |
~/.gemini/config/agents/ |
| MCP servers | .agents/mcp_config.json |
~/.gemini/config/mcp_config.json |
| Hooks | .agents/hooks.json |
~/.gemini/config/hooks.json |
| Sidecars | none | ~/.gemini/config/sidecars/<id>/sidecar.json |
Rules
Rules are cumulative: global, workspace, and directory rules are all combined, and the more specific directory rule wins a conflict. When the agent touches a file, Antigravity walks up from that file's folder to the workspace root and loads AGENTS.md, GEMINI.md, .agents/AGENTS.md, and .agents/rules/*.md at each level.
AGENTS.md and GEMINI.md take no frontmatter and are always on. Every file in .agents/rules/ must start with frontmatter:
---
trigger: model_decision # always_on | model_decision | glob | manual
description: "Apply when writing or reviewing SQL migrations."
---
# Migration rules
1. Expand-and-contract; never drop or rename a column in one deploy.
2. Create indexes on existing tables with CONCURRENTLY.
model_decisionputs only the description in context and the agent reads the full rule when relevant.globneedsglobs: "*.ts, *.tsx"(quote patterns that start with*).manualloads only when you@-mention the rule.- A missing or camelCase trigger (
alwaysOn,modelDecision) makes Antigravity silently drop the rule. - Only the immediate children of
.agents/rules/are scanned. Nested folders and rules shared across repos need.agents/rules.json(inherits,entrieswithinclude_only/exclude). @[label](path)inlines a file;@pathjust references it.- Limits: 24,000 bytes per rule file and a 20,000-token budget across always-on rules. Over budget, the largest rules are demoted to one-line pointers.
Example: examples/rules-codeamani.md.
Skills, and the end of workflows
Skills follow the open Agent Skills standard (agentskills.io): a folder with a SKILL.md (description required, name optional and defaulting to the folder name) plus optional scripts/, examples/, and resources/. The agent sees only names and descriptions until a skill is relevant. Every skill is also a slash command (/deploy-staging).
Workflows are gone. Legacy workflows (
.agents/workflows/*.md,~/.gemini/config/workflows/, 12,000-character limit) stopped working on 2026-10-19. Google says a new, more dynamic workflow system is coming. Until then, run/migrate-workflowsin the App: it converts each workflow to.agents/skills/<name>/SKILL.mdand renames the original to.md.bak. Where a skill and a workflow share a name, the skill wins. The SDK already has a betabeta.workflowsmodule (0.1.22), which is separate from the App feature.
Example: examples/skills/pre-push-gate/SKILL.md. The CLI can also install skill bundles as plugins: agy plugin install <name|github-url|./path>, with agy plugin validate --strict --json for CI. Gemini CLI users can run agy plugin import gemini.
Custom agents and subagents
A parent agent calls invoke_subagent to start a subagent with its own clean context. The workspace can be the parent's (inherit), an isolated Git worktree (branch), or shared storage (share). Subagents inherit the parent's permission scopes and sandbox, approval requests bubble up to you, and nesting stops at 10 levels.
- Built-in subagents:
research(codebase exploration),browser(only through/browser), andself(a clone of the caller). - Custom agents are Markdown files with YAML frontmatter in
.agents/agents/or~/.gemini/config/agents/. Frontmatter keys:name,description(both required),tools,mainAgent,subagent,model(inherit|flash|pro),commandExecutionPolicy(off|auto|eager|sandbox),mcpServers,skills, andplugins. The body is the system prompt. A custom agent can carry its own subset of skills, MCP servers, and hooks, which keeps context small. - Known issue: a misspelled name in
toolscan hang the subagent. Use exact tool names such asview_file,grep_search,run_command. - In the CLI,
/agents(the Agent Manager panel) switches the main agent and shows each background subagent as active, idle, killed, or failed.Alt+Jjumps to a subagent waiting for you, andCtrl+Kapproves its pending action. Headless runs take--agent <name>.
Example: examples/custom-agent-security-reviewer.md.
MCP servers
All surfaces read the same mcp_config.json with a single mcpServers object. The App manages it from Settings → Customizations → Installed MCP Servers (with an MCP Store), the CLI from /mcp, and the IDE from the agent panel's … → MCP Servers → View raw config. The SDK picks up .agents/mcp_config.json automatically.
{
"mcpServers": {
"codeamani-tech-stack": { "serverUrl": "https://tech-stack.codeamanilabs.org/api/mcp" },
"context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp@4.4.4"] },
"neon": { "serverUrl": "https://mcp.neon.tech/mcp", "disabledTools": ["delete_project"] },
"gcp-service": {
"serverUrl": "https://example.googleapis.com/mcp/",
"authProviderType": "google_credentials",
"disabled": true
}
}
}
| Key | Meaning |
|---|---|
command, args, env, cwd |
stdio server |
serverUrl |
Remote Streamable HTTP or SSE server. url and httpUrl are not supported, which is the most common copy-paste error from other tools' configs |
headers |
Custom HTTP headers (API keys, bearer tokens) |
authProviderType: "google_credentials" |
Use Google ADC (gcloud auth application-default login) |
oauth: { clientId, clientSecret } |
Only for servers without dynamic client registration. Redirect URI: https://antigravity.google/oauth-callback |
disabled, disabledTools |
Turn a server off, or hide specific tools from the model |
OAuth servers that support DCR need nothing beyond serverUrl: click Authenticate in Settings → Customizations. Tokens are stored in ~/.gemini/antigravity/mcp_oauth_tokens.json. Unconfigured MCP tools run in Ask mode. Allow them with mcp(server/tool), mcp(server/*), or mcp(*).
Full example: examples/mcp_config.json.
The browser subagent
/browser <task> hands a web task to the built-in browser subagent. It drives real Google Chrome through the Chrome DevTools MCP server, which Antigravity starts for you. It can navigate, click, fill forms, read the console and network, run Lighthouse and performance traces, and emulate devices and throttled networks. Every session is recorded as a WebM artifact.
/browser Load http://localhost:3000 with a Slow 3G profile and a 375px viewport, then screenshot the hero once it finishes loading
- It runs in its own context, so page snapshots don't fill your main conversation.
evaluate_script(running JavaScript in the page) asks first. The other browser tools are allowed for the subagent.- Chrome asks you to allow remote debugging on first connect. The IDE uses a separate Chrome profile and a URL allowlist and denylist.
/browseris available in the App and CLI, not the standalone IDE. Admins can turn it off.
Permissions, sandbox, hooks
Every sensitive action is a resource: read_file(path), write_file(path), read_url(domain), execute_url(domain), command(prefix) or command(regex:...), and mcp(server/tool). Deny beats Ask beats Allow. In the CLI the lists live in ~/.gemini/antigravity-cli/settings.json:
{
"toolPermission": "request-review",
"enableTerminalSandbox": true,
"permissions": {
"allow": ["command(git)", "command(regex:npm run (build|lint|test))", "write_file(src/)"],
"deny": ["command(rm -rf)", "command(sudo)", "write_file(.git/)", "write_file(/home/dev/.ssh)"],
"ask": ["command(git push)", "mcp(neon/*)"]
}
}
Command substitution ($(...), backticks), brace expansion, and similar constructs turn off prefix matching. Those commands must match a rule exactly or they fall back to Ask. Hooks (hooks.json) run scripts on SessionStart, PreToolUse, PostToolUse (matched by tool name, such as run_command), PreInvocation, PostInvocation, and Stop. A PreToolUse hook can return a decision such as ask with a reason.
Sidecars and scheduled work
/schedule <when> <task>sets a timer or cron schedule inside one conversation.- Sidecars are long-lived processes that Antigravity supervises:
~/.gemini/config/sidecars/<id>/sidecar.jsonwith eithercommand+argsorbuiltin: "schedule"(a five-field cron followed by a command), plusrestart_policy(alwaysby default, oron-failure/never),env,description, anddisplay_name. - Sidecars are off until enabled in
~/.gemini/config/config.json→sidecars.<id>.enabled. AprojectIdis required if the sidecar creates conversations throughagentapi new-conversationoragentapi send-message. - Runtime data goes to
~/.gemini/antigravity/sidecar_data/<id>/(data/,logs/,events/).
Correction:
agentapiis a CLI that Antigravity puts on the sidecar's PATH, not a secondbuiltin. Onlyscheduleis a builtin.
Example: examples/sidecar-nightly-audit/.
The agy CLI
Interactive
agy # TUI in the current directory
agy --mode=accept-edits # start in accept-edits (or --mode auto)
agy --remote-control # this session is also reachable from the Remote Control dashboard
Shift+Tabcycles modes:default(review each edit as a diff),accept-edits(file edits auto-approved; subagents inherit this), andplan(plan first). CLI 1.3.5 added Auto mode (--mode auto, Linux and macOS only): it approves edits and safe commands, prompts before irreversible actions, and has a separate agent review any command that would leave the sandbox. Shell commands still follow your permission rules in every mode.Ctrl+Ropens Artifact Review (y,n,Ato approve all).Ctrl+Oexpands tool output, andCtrl+Gopens$EDITOR.- Commands:
/agents,/tasks,/btw(a side question in the background),/diff,/rewind,/fork,/resume,/compact,/model,/effort,/usage,/credits,/context,/mcp,/skills,/hooks,/permissions,/plugin,/config,/statusline,/voice,/logout. - Main
settings.jsonkeys:toolPermission(request-review|proceed-in-sandbox|always-proceed|strict),artifactReviewPolicy,enableTerminalSandbox,allowNonWorkspaceAccess,useG1Credits,enableTelemetry,editorMode: "vim".
Headless / CI
agy -p "In one sentence, what is a git rebase?" # answer on stdout; everything else on stderr
agy -p "Summarize the diff" --output-format json | jq -r '.response' # one JSON envelope
agy -p "Review the change" --output-format stream-json # NDJSON events
agy -p "Extract the version" --output-format json \
--json-schema '{"type":"object","properties":{"major":{"type":"integer"}},"required":["major"]}' \
| jq '.structured_output'
agy -p "Follow up" --continue # or --conversation <id>
agy -p "..." --model gemini-3.8-flash-medium --effort high --agent security-reviewer --print-timeout 10m
- The output formats are
text,json, andstream-json. The old namestreaming-jsonwas wrong.--input-format stream-json(which requires--output-format stream-json) keeps one process running for many turns over stdin. - The JSON envelope has
conversation_id,status(SUCCESS|ERROR|CANCELED|INTERRUPTED|INVALID|WAITING|RUNNING),response,error,duration_seconds,num_turns,usage, and, when a schema is set,structured_output. - Exit codes:
0on success. A run that produces no response exits non-zero. An unknown--modelexits1instead of quietly falling back. List valid slugs withagy modelsand agents withagy agents. - Permissions: headless runs can't prompt. Anything that needs approval is soft-denied: the run continues, exits
0, and prints a stderr notice. Shell commands default to Ask, so grant them throughpermissions.allow.--dangerously-skip-permissionsapproves everything, so keep it to throwaway sandboxes.--sandboxturns on terminal sandboxing for the run. - Auth on CI: a fresh runner has no keyring. Use the Gemini API key route or ADC (above).
Full CI script: examples/ci-review.sh.
Python SDK: google-antigravity
pip install google-antigravity==0.1.22 # Python >= 3.10; uv add / poetry add also work
import asyncio
from google.antigravity import Agent, LocalAgentConfig
async def main() -> None:
config = LocalAgentConfig(system_instructions="You are a concise senior engineer.")
async with Agent(config) as agent:
response = await agent.chat("What files are in the current directory?")
print(await response.text())
asyncio.run(main())
- Auth is either
GEMINI_API_KEYin the environment or Vertex / Gemini Enterprise throughLocalAgentConfig(vertex=True, project=..., location=...)(or theGOOGLE_GENAI_USE_VERTEXAI,GOOGLE_CLOUD_PROJECT, andGOOGLE_CLOUD_LOCATIONvariables) aftergcloud auth application-default login. LocalAgentConfig(0.1.22) acceptssystem_instructions,tools(Python callables),mcp_servers(McpStdioServer/McpStreamableHttpServer),subagents(SubagentConfig(model=...)for mixed-model teams),skills_pathsorinline_skills(the SDK rejects both together),policies,hooks,response_schema,model,budget_config, andcompaction_config.- New in 0.1.22: the
beta.workflowsorchestration module,InlineSkill,GeminiModelOptions(max_output_tokens=...),CapabilitiesConfig(mcp_max_output_bytes=...), andforce_all_tools_eageron MCP servers.BuiltinTools.START_SUBAGENTis deprecated in favour ofINVOKE_SUBAGENT. - There is also a managed cloud Antigravity Agent in the Gemini API (
ai.google.dev/gemini-api/docs/antigravity-agent), separate from this local SDK. This guide doesn't cover it.
Example (type-checked with mypy --strict): examples/sdk_agent_with_mcp.py.
codeAmani notes
- This repo already configures Antigravity. Antigravity reads
AGENTS.md, notCLAUDE.md. This repo'sAGENTS.mdmirrors the shared convention blocks fromCLAUDE.md(npm run sync:conventions), so an Antigravity agent opened here gets the house rules automatically. In project repos, keep anAGENTS.mdat the root (or a.agents/rules/codeamani.md, seeexamples/rules-codeamani.md) rather than relying onCLAUDE.md. - AI routing after 2026-11-02. The house policy sends complex reasoning and code generation to Claude. In Antigravity that means Claude Sonnet 5.5 or Opus 5.5 (thinking), which require a paid, non-trial Google AI Pro, Ultra, or Enterprise plan. The free tier loses Claude 4.6 on 2026-11-02 and keeps only Gemini 3.8 Flash. Use Gemini 3.8 Flash for mechanical, high-volume work: Gemini models share one quota pool weighted by API price, so Flash goes much further than Argon or Pro. Set this per role, not per chat, with a custom agent's
model: flash|proorSubagentConfig(model=...)in the SDK. - Secrets stay out of the agent's reach. Agents run shell commands, read files, and drive Chrome. Keep live keys in Hazina or
.env.local, adddenyrules for~/.sshand.git/writes, and rungitleaksbefore every push, since an autonomous agent makes accidental commits more likely, not less. MCPheaders,env, andoauth.clientSecretare plain text inmcp_config.json, so prefer servers that use OAuth/DCR orgoogle_credentials, and never commit a workspacemcp_config.jsonthat contains a token. The CLI's keyring storage is the right pattern; for CI, the only secret isGEMINI_API_KEY, served from the CI secret store. - Keep the default permission preset, or tighter. The App's Default preset sandboxes terminal commands with no network. That's the right baseline for unfamiliar repos. Use Turbo or
--dangerously-skip-permissionsonly in disposable environments. - WSL: CLI first, checkout on ext4. Run
agyinside WSL with the repo under~/code, not/mnt/c. Parallel subagents and worktree mode multiply file I/O, and the 9P boundary cost multiplies with them. The App runs on Linux but needs WSLg. For long jobs,agy remote-control startlets you watch a WSL session from your phone. - Migrate workflows now. Any
.agents/workflows/*.mdstopped working on 2026-10-19. Run/migrate-workflows, or hand-convert to.agents/skills/<name>/SKILL.md.examples/skills/pre-push-gate/is a codeAmani-flavoured replacement. - Payments. An Antigravity agent writing payment code should follow the same rules as any other agent: Stripe by default with signing-secret verification, and M-Pesa/Daraja only for Kenya-targeted projects. Put that in an always-on rule so a generic agent doesn't pick a rail on its own. The Stripe and Neon MCP servers in the MCP Store are useful, but scope them with
askrules (mcp(neon/*)) so mutations always prompt. - Kenya-targeted projects. Antigravity is available in Kenya, so a Nairobi-based contributor can sign in with a personal account. Use the browser subagent's throttling to check pages against the
AFRICAN_MARKET_GUIDE.mdbudget, for example/browser Load <url> with Slow 3G and a 360px viewport and report LCP. - Provenance unaffected. Antigravity is a development tool and ships nothing of ours. SLSA policy (
supply-chain/) applies to what a codeAmani project publishes. Agent-authored PRs still get dependency review, secret scanning, and code review. - It moves weekly. The App went from 2.22.0 (Oct 8) to 2.24.0 (Oct 15), and the CLI from 1.3.5 (Oct 14) to 1.4.0 (Oct 16). Re-check
/docs/changelogand/docs/modelson every review, and pin model slugs in CI (--model) so a model change fails loudly instead of silently changing behaviour.
Official docs:
- https://antigravity.google/docs/overview
- https://antigravity.google/docs/getting-started
- https://antigravity.google/docs/changelog
- https://antigravity.google/docs/models
- https://antigravity.google/docs/plans
- https://antigravity.google/docs/mcp
- https://antigravity.google/docs/rules
- https://antigravity.google/docs/skills
- https://antigravity.google/docs/subagents
- https://antigravity.google/docs/commands/browser
- https://antigravity.google/docs/cli/headless
- https://antigravity.google/docs/sdk/overview