← Back to dashboard
antigravitytoolingfreshReader view (for NotebookLM)

Google Antigravity Integration Guide

What is Google Antigravity?

The real model

App + `agy` CLI on one harness, configured from .agents/, with a hard date or two to watch.

Install the CLI with `curl -fsSL https://antigravity.google/cli/install.sh | bash` (~/.local/bin/agy). Auth is browser OAuth into the OS keyring, an SSH paste-code flow, `"modelProvider": "gemini"` plus GEMINI_API_KEY for CI, or ADC via AGY_ADC_AUTH=true. Headless: `agy -p '...' --output-format text|json|stream-json` (not 'streaming-json'), `--json-schema` gives you .structured_output, `--model` fails loudly on an unknown slug, and headless runs soft-deny unapproved tools, so grant them in permissions.allow. MCP lives in .agents/mcp_config.json or ~/.gemini/config/mcp_config.json, and remote servers must use `serverUrl` (url/httpUrl are rejected). Rules in .agents/rules need a snake_case `trigger` or they're silently dropped. Workflows died 2026-10-19 (run /migrate-workflows). Claude 4.6 and GPT-OSS go away 2026-11-02, so Claude means Sonnet/Opus 5.5 on paid Pro, Ultra, or Enterprise. For codeAmani: Antigravity reads AGENTS.md (already mirrored here), so route reasoning to Claude 5.5 and bulk work to Gemini 3.8 Flash, keep secrets out of mcp_config.json, and gitleaks every agent-authored push. `pip install antigravity` is the XKCD joke; the SDK is google-antigravity.

Six Antigravity primitives

One agent harness, a desktop command center and a terminal CLI, configured from .agents/ and verified through Artifacts.

Text
 █████╗ ███╗   ██╗████████╗██╗ ██████╗ ██████╗  █████╗ ██╗   ██╗██╗████████╗██╗   ██╗
██╔══██╗████╗  ██║╚══██╔══╝██║██╔════╝ ██╔══██╗██╔══██╗██║   ██║██║╚══██╔══╝╚██╗ ██╔╝
███████║██╔██╗ ██║   ██║   ██║██║  ███╗██████╔╝███████║██║   ██║██║   ██║    ╚████╔╝
██╔══██║██║╚██╗██║   ██║   ██║██║   ██║██╔══██╗██╔══██║╚██╗ ██╔╝██║   ██║     ╚██╔╝
██║  ██║██║ ╚████║   ██║   ██║╚██████╔╝██║  ██║██║  ██║ ╚████╔╝ ██║   ██║      ██║
╚═╝  ╚═╝╚═╝  ╚═══╝   ╚═╝   ╚═╝ ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝  ╚═══╝  ╚═╝   ╚═╝      ╚═╝

Google Antigravity Integration Guide

Focus: running Antigravity on a Linux / WSL Ubuntu dev box. The Antigravity App is the agent command center and the agy CLI 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 the antigravity.google/docs Markdown 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.

SurfaceCurrent versionReach 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 extensionsVS Code v1.8.0, Visual Studio v1.0.261012.0; JetBrains, Zed, XcodeYou 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 SDKgoogle-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.

See also: cursor/ and vscode/ for the other editors this repo covers, and google-ai-studio/ / google-cloud/ for the Gemini API key and Vertex AI side used by GEMINI_API_KEY and 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)

Bash
# 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:

WhereHow
Local machineBrowser 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 browserThe 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 Enterprisegcloud 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:

Bash
GEMINI_API_KEY=AIza...

Non-secret settings:

Variable / settingPurpose
modelProvider: "gemini" (CLI settings.json)Use GEMINI_API_KEY instead of an account session
GOOGLE_GEMINI_BASE_URLPoint the CLI at a different Gemini-compatible endpoint
AGY_ADC_AUTH = trueSign in with Application Default Credentials (CLI and App)
GOOGLE_CLOUD_QUOTA_PROJECT, GOOGLE_CLOUD_LOCATIONADC project and location
AGY_CLI_OSC7501 = on / offTerminal 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/, package antigravity) 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 antigravity installs the XKCD joke module (PyPI antigravity 0.1). Google's SDK is google-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)

ModelFree & AI PlusAI ProAI UltraEnterprise
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 /effort goes up to max on 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)

PlanPriceWhat you get
Individual$0Weekly quota and rate limit, unlimited Tab completions, core features (scheduled tasks, CLI)
Google AI Pro$20/moQuota 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 Never or Always. Check usage in Settings, or with /usage and /credits in 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+K conversation picker, Cmd/Ctrl+N new conversation, Cmd/Ctrl+L focus input, Cmd/Ctrl+` terminal, Cmd/Ctrl+, settings, Cmd/Ctrl+Shift+M maximize 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, and agy 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.

CustomizationWorkspaceGlobal
Always-on instructionsAGENTS.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.mdApp/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
Sidecarsnone~/.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:

Markdown
---
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_decision puts only the description in context and the agent reads the full rule when relevant. glob needs globs: "*.ts, *.tsx" (quote patterns that start with *). manual loads 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, entries with include_only / exclude).
  • @[label](path) inlines a file; @path just 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-workflows in the App: it converts each workflow to .agents/skills/<name>/SKILL.md and renames the original to .md.bak. Where a skill and a workflow share a name, the skill wins. The SDK already has a beta beta.workflows module (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), and self (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, and plugins. 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 tools can hang the subagent. Use exact tool names such as view_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+J jumps to a subagent waiting for you, and Ctrl+K approves 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.

JSON
{
  "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
    }
  }
}
KeyMeaning
command, args, env, cwdstdio server
serverUrlRemote Streamable HTTP or SSE server. url and httpUrl are not supported, which is the most common copy-paste error from other tools' configs
headersCustom 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, disabledToolsTurn 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.

Text
/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.
  • /browser is 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:

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.json with either command + args or builtin: "schedule" (a five-field cron followed by a command), plus restart_policy (always by default, or on-failure / never), env, description, and display_name.
  • Sidecars are off until enabled in ~/.gemini/config/config.json → sidecars.<id>.enabled. A projectId is required if the sidecar creates conversations through agentapi new-conversation or agentapi send-message.
  • Runtime data goes to ~/.gemini/antigravity/sidecar_data/<id>/ (data/, logs/, events/).

Correction: agentapi is a CLI that Antigravity puts on the sidecar's PATH, not a second builtin. Only schedule is a builtin.

Example: examples/sidecar-nightly-audit/.


The agy CLI

Interactive

Bash
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+Tab cycles modes: default (review each edit as a diff), accept-edits (file edits auto-approved; subagents inherit this), and plan (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+R opens Artifact Review (y, n, A to approve all). Ctrl+O expands tool output, and Ctrl+G opens $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.json keys: toolPermission (request-review | proceed-in-sandbox | always-proceed | strict), artifactReviewPolicy, enableTerminalSandbox, allowNonWorkspaceAccess, useG1Credits, enableTelemetry, editorMode: "vim".

Headless / CI

Bash
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, and stream-json. The old name streaming-json was 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: 0 on success. A run that produces no response exits non-zero. An unknown --model exits 1 instead of quietly falling back. List valid slugs with agy models and agents with agy 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 through permissions.allow. --dangerously-skip-permissions approves everything, so keep it to throwaway sandboxes. --sandbox turns 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

Bash
pip install google-antigravity==0.1.22      # Python >= 3.10; uv add / poetry add also work
Python
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_KEY in the environment or Vertex / Gemini Enterprise through LocalAgentConfig(vertex=True, project=..., location=...) (or the GOOGLE_GENAI_USE_VERTEXAI, GOOGLE_CLOUD_PROJECT, and GOOGLE_CLOUD_LOCATION variables) after gcloud auth application-default login.
  • LocalAgentConfig (0.1.22) accepts system_instructions, tools (Python callables), mcp_servers (McpStdioServer / McpStreamableHttpServer), subagents (SubagentConfig(model=...) for mixed-model teams), skills_paths or inline_skills (the SDK rejects both together), policies, hooks, response_schema, model, budget_config, and compaction_config.
  • New in 0.1.22: the beta.workflows orchestration module, InlineSkill, GeminiModelOptions(max_output_tokens=...), CapabilitiesConfig(mcp_max_output_bytes=...), and force_all_tools_eager on MCP servers. BuiltinTools.START_SUBAGENT is deprecated in favour of INVOKE_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, not CLAUDE.md. This repo's AGENTS.md mirrors the shared convention blocks from CLAUDE.md (npm run sync:conventions), so an Antigravity agent opened here gets the house rules automatically. In project repos, keep an AGENTS.md at the root (or a .agents/rules/codeamani.md, see examples/rules-codeamani.md) rather than relying on CLAUDE.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|pro or SubagentConfig(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, add deny rules for ~/.ssh and .git/ writes, and run gitleaks before every push, since an autonomous agent makes accidental commits more likely, not less. MCP headers, env, and oauth.clientSecret are plain text in mcp_config.json, so prefer servers that use OAuth/DCR or google_credentials, and never commit a workspace mcp_config.json that contains a token. The CLI's keyring storage is the right pattern; for CI, the only secret is GEMINI_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-permissions only in disposable environments.
  • WSL: CLI first, checkout on ext4. Run agy inside 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 start lets you watch a WSL session from your phone.
  • Migrate workflows now. Any .agents/workflows/*.md stopped 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 ask rules (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.md budget, 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/changelog and /docs/models on every review, and pin model slugs in CI (--model) so a model change fails loudly instead of silently changing behaviour.