Sulat.com / Writing on AISunday, December 6, 2026
Enter →
Agent Engineering/6 December 2026

Google’s Antigravity Python SDK

Google’s Antigravity SDK docs now cover sign-in, models, usage, sessions, streaming and workflows. I installed 0.1.24, ran every thinking level and ran a three-file workflow.

3D Google Antigravity logo above a code terminal and file cards linked by blue lines, for the Antigravity SDK docs
Illustration: Sulat, featuring the Google Antigravity logo

At a glance

  • Google’s Antigravity SDK is a Python package for building agents on Antigravity’s runtime harness; its docs list four sign-in paths, and a Google AI plan login isn’t one of them.
  • In my run on Gemini 4 Hydrogen, four of the five thinking levels the SDK lists worked, and MINIMAL was rejected with a 400 error.
  • A three-file workflow read the files with plain Python, audited them in parallel, and found the command injection, SQL injection and hardcoded key I had planted.
  • The docs say priority-tier requests overflow to standard instead of failing; my requests succeeded, but the tier field came back empty, so I couldn’t see the overflow.
  • Workflows sit in the beta namespace, which the docs say can change between minor releases.

Google’s Antigravity SDK is a Python package for building agents on Antigravity’s runtime harness, and its docs now spell out how to sign in, pick a model, count tokens, keep a session, stream output and script a workflow. I installed google-antigravity 0.1.24, ran one prompt at every thinking level the SDK lists, and ran a three-file workflow on a Gemini API key. Hydrogen rejected the lowest thinking level and accepted the other four.

Four ways to sign in

The Authentication page lists four paths. The default is the Gemini Developer API with a GEMINI_API_KEY. The two Gemini Enterprise paths (formerly Vertex AI) are Express Mode, which takes an API key, and Standard Mode, which takes Application Default Credentials plus a project and a location. The fourth path needs no credentials: LiteRTAgentConfig runs a local checkpoint such as Gemma 4 26B A4B, and LocalOpenAIAgentConfig points at Ollama, LM Studio or vLLM.

Hand-drawn list of four Antigravity SDK sign-in paths: Gemini API key, Enterprise Express, Enterprise Standard, local model with no credentials
Three of the four paths need a Google credential; the local one needs none.

None of the four is a sign-in with a Google AI plan, so SDK usage runs on keys and Google Cloud credentials, not plan quota. That fits the line Google drew in its Antigravity terms rewrite. Two details from the page matter in practice. Explicit keyword arguments beat environment variables in every cloud mode. And the localharness subprocess inherits your whole shell environment, so the docs tell you to pass keys through api_key and restrict run_command with policies when you enable shell execution.

What I ran

The box was 4 cores, 15 GB RAM, Ubuntu 24, with Python 3.13 and a clean virtual environment. pip install google-antigravity pulled 0.1.24, the newest release on PyPI. The default model in the source is gemini-4-hydrogen, and the default image model is gemini-3.1-flash-lite-image. A first turn with the default config took 1.6 seconds, and the usage report showed about 12K prompt tokens for a reply of two.

Then I ran the same prompt at each thinking level, once with the default service tier and once with ServiceTier.PRIORITY. This is the prompt, verbatim:

Code
What is 17*23? Answer with the number only.
Thinking levelDefault tierPriority tier
MINIMAL400 error, not supported for this model400 error, not supported for this model
LOW391 in 2.2 s391 in 1.7 s
MEDIUM391 in 2.2 s391 in 1.6 s
HIGH391 in 1.8 s391 in 1.7 s
EXTRA_HIGH391 in 1.9 s391 in 2.0 s
One run per setting on Gemini 4 Hydrogen, Gemini API key.
Ladder of five thinking levels, Minimal crossed out as rejected on Hydrogen, Low to Extra High ticked
Hydrogen accepted four of the five thinking levels the SDK lists.

The enum has five levels, and the error for the lowest reads “Thinking level MINIMAL is not supported for this model.” A one-line arithmetic prompt shows nothing about answer quality across levels, only which settings the model takes.

The Models page says ServiceTier.PRIORITY requests that exceed rate limits are served on the standard tier instead of failing with a 429 or 503, and that usage_metadata.service_tier tells you which tier answered. My priority requests all succeeded. The tier field came back empty on both default and priority runs, so I couldn’t see which tier served them, and I never hit a limit, so the overflow didn’t fire. The same page documents the retry defaults for transient errors: a 4,000 ms first sleep, a 2.0 multiplier, a 0.4 jitter range and a cap of 4 minutes.

Workflows: Python in charge, models on call

The Workflows page describes google.antigravity.beta.workflows, where control flow is ordinary Python and models handle individual steps that return schema-checked output. call_tool runs a built-in tool such as read_file with no model turn, and parallel fans a function out over a list. The docs say direct call_tool steps skip declarative policies and tool hooks, while the agents a workflow spawns do enforce them.

I planted three small files: one passing a command to os.system, one building an SQL query with string formatting, and one with a hardcoded API key. This is the workflow, as I ran it:

Code
@workflows.define
async def audit() -> None:
    """Reads files and audits them in parallel."""
    workflows.phase("Audit")
    async def one(path: str):
        content = await workflows.call_tool("read_file", Path=path)
        return await workflows.agent(f"Name the main security issue in {path} in one sentence:\n{content}", schema={"type":"string"}, role="Audit", type_name="file_auditor")
    res = await workflows.parallel(workflows.args["paths"], one)
    for r in res: workflows.log(str(r))

The run reported three tool calls, all read_file, with none failed and none denied. The three auditors answered command injection through os.system, SQL injection from string formatting, and a hardcoded API key.

Hand-drawn three-step flow: Python reads files with no model call, models audit them in parallel, one reply per file returns
A workflow reads files in plain Python, then spends model calls only on the audit.

Workflows live in the preview beta namespace, and the docs say beta APIs may change between minor releases.

The rest of the docs

  • Usage. Token counts come per turn from response.usage_metadata, as a running total from agent.conversation.total_usage, and per subagent from trajectory_usages. The fields include cached and thinking tokens and the service tier.
  • Sessions. A save_dir and conversation_id persist a session to disk, CompactionConfig compacts long contexts, and BudgetConfig caps execution. The in-memory history keeps 10,000 steps by default.
  • Streaming. A response streams text, reasoning thoughts and tool calls as separate iterators, takes images, documents, audio and video, and can be cancelled mid-turn.
  • Presets. .lightweight() trims a config for small local models, and .eval() sets autonomous tools, benchmark retries and HIGH thinking.
  • Image target. Overriding model alone still adds the default image target and validates it at session start, even with image generation switched off.

Where this sits

Google now has three ways to run Antigravity outside its app. The SDK is the local one: your Python process starts the harness and calls Gemini or a local model. The docs also point to a managed Gemini API Antigravity Agent for people who want a hosted REST and gRPC API instead. The third is the command-line tool, which I covered when Colab built it in. Google has also lifted the Neon cache hit rate, which matters if you pay per token on any of these, as I reported.

For third-party tools the picture is two routes. Some, like OpenClaw with its Google AI Ultra sign-in, have a Google-approved client. The SDK is the route open to anyone with a key or a Google Cloud project.

How I checked

I read the SDK overview and the Authentication, Models, Observability, Sessions, Streaming and Workflows pages, plus the package source for the model and thinking-level defaults. I ran the hello turn, the thinking-level and tier matrix, and the workflow on a Gemini API key. I didn’t run the Vertex or local-model paths, the OpenTelemetry export, session persistence or streaming.


Sources