What is Antigravity Subagents & Hooks? Google's Agent Harness 2.0
What is Antigravity Subagents, Hooks & Async (May 2026)
At Google I/O 2026 on May 20, Google unveiled major upgrades to Antigravity, its agent-first development platform. Three new core primitives — subagents, hooks, and asynchronous task management — turn Antigravity from a single-agent harness into a real multi-agent orchestration framework.
Last verified: May 24, 2026.
TL;DR
- What it is: Google’s agent harness for building, running, and scaling AI agents.
- Original launch: Google I/O 2025.
- 2026 upgrades announced: I/O 2026, May 20, 2026.
- Three new primitives: subagents, hooks, async task management.
- Why it matters: Antigravity is the infrastructure layer behind Gemini Spark and the agentic Gemini era.
What Antigravity is, baseline
Antigravity is the execution harness for Google’s agents. Think of it as the framework code that:
- Takes a model (Gemini 3.5, Gemini 3.5 Flash, or a third-party model via MCP).
- Wires it to tools (functions, APIs, web browsers, file systems).
- Manages the agent loop (model → tool → result → model → …).
- Handles errors, retries, timeouts, observability.
- Integrates with Google Cloud’s agent infrastructure.
It’s roughly equivalent to:
- Anthropic → Claude Agent SDK + Claude Code Routines.
- OpenAI → Agent Builder + Frontier Enterprise Agent Platform.
- Microsoft → Copilot Studio + Agent Builder.
What sets Antigravity apart is its tight coupling with Gemini models, Google Cloud, and Android — including the new Android Halo UI surface for agent visibility.
The three new primitives (May 2026)
1. Subagents
Subagents let an agent spawn child agents to handle subtasks. The parent agent stays in control but can delegate.
Example: A Gemini Spark “plan a trip to Tokyo” agent might spawn:
- A research subagent (flights, hotels, restaurants).
- A booking subagent (actual reservations).
- A itinerary subagent (final document generation).
Each subagent gets:
- A scoped task description.
- Inherited workspace from the parent.
- Its own tool set (potentially different from the parent’s).
- Independent model choice (use Flash for cheap research, Pro for hard booking decisions).
- Results returned to the parent.
This is the same pattern Anthropic established with the Claude Agent SDK and OpenAI established with Agent Builder — multi-agent orchestration is now table-stakes for serious agent frameworks.
2. Hooks
Hooks are lifecycle interception points. You register code to run at specific moments in the agent loop:
| Hook | When it fires |
|---|---|
before_model_call | Before sending a request to the model |
after_model_call | After receiving a model response |
before_tool_call | Before invoking a tool |
after_tool_call | After a tool returns |
on_agent_wait | When the agent is waiting (for user, for async result, etc.) |
on_agent_error | When the agent errors |
on_agent_complete | When the agent finishes |
Practical uses:
- Logging: write every model call to your observability stack.
- Cost tracking: tally tokens spent per session.
- Guardrails: scan tool calls for dangerous operations before executing.
- Redaction: strip PII from model inputs before sending.
- Approval prompts: insert Halo “Approve $487 charge?” prompts on high-stakes actions.
- Custom tool handling: intercept and modify tool calls (replace a slow API with a cached version).
Conceptually borrowed from web framework middleware (Express, Connect, Django). The naming and lifecycle is familiar to anyone who’s built web servers.
3. Async task management
Async lets agents run beyond a single interactive session. Tasks have IDs, persist across sessions, run on Google Cloud infrastructure.
The mechanics:
- User starts a task: “Spark, monitor my flight prices to Tokyo for the next 30 days and book when it drops below $800.”
- Antigravity creates a task ID, persists task state, returns to user.
- Task runs autonomously on Google Cloud — polling prices, evaluating, waiting.
- Live status appears in Android Halo whenever it’s active.
- When the condition triggers, the agent executes — pinging the user via Halo for approval before the booking.
- Result persists to task history.
Async is the foundation that makes “always-on personal AI” possible. Without async, every agent task dies when the user closes the app — which makes a meaningful “personal AI” impossible.
Why these three together matter
Each primitive is useful alone. Together they unlock real multi-agent systems:
- Subagents = decomposition. Break hard tasks into manageable subtasks.
- Hooks = control. Insert governance, observability, and guardrails at any point.
- Async = duration. Tasks survive sessions and run when conditions trigger.
This is the same shape as Anthropic’s Agent SDK and OpenAI’s Agent Builder — the industry is converging on a common architecture for serious agent systems. Antigravity’s differentiation is the Google Cloud + Android Halo integration.
What you can build with Antigravity 2
Concrete examples Google demoed at I/O:
- Gemini Spark itself — the always-on personal AI is built on Antigravity 2.
- Workspace agents — “summarize my Gmail every morning at 7am” using async + subagents for parallel inbox processing.
- Customer support workflows — parent agent handles intake, subagents handle research/escalation/resolution in parallel.
- Long-running monitoring — price monitoring, news monitoring, calendar conflict detection.
- Multi-step automations — IFTTT/Zapier-style workflows but with model-powered decision logic at each step.
Pricing and availability
- Antigravity 2 primitives: available in Vertex AI and AI Studio immediately (May 20, 2026 launch).
- Subagents: priced per child-agent inference (each subagent’s tokens count separately).
- Hooks: free (runs in your code, not Google’s).
- Async task management: priced on a per-task-hour basis ($X/hour of active runtime, plus inference tokens).
- Free tier: AI Studio includes a small monthly allowance for Antigravity tasks.
How to start using it
from google.antigravity import Agent, Hook, SubAgent
# Define a hook for cost tracking
def track_cost(event):
if event.kind == 'after_tool_call':
log_to_observability(event.tokens, event.cost)
# Define an agent with hooks and subagents
agent = Agent(
model='gemini-3.5-flash',
tools=[search, calendar, email],
hooks=[Hook('after_tool_call', track_cost)],
subagents={
'research': SubAgent(model='gemini-3.5-flash', tools=[search]),
'booking': SubAgent(model='gemini-3.5-pro', tools=[booking_api]),
},
async_runtime=True,
)
# Start an async task
task_id = agent.start_task("Plan a trip to Tokyo for August.")
# ... task runs in background, surfaces in Halo when active
Real APIs differ slightly — see Google’s developer docs — but the shape is consistent across Antigravity, Claude Agent SDK, and OpenAI Agent Builder.
How it compares to competitors
| Antigravity 2 | Claude Agent SDK | OpenAI Agent Builder | |
|---|---|---|---|
| Subagents | Yes | Yes | Yes |
| Hooks/middleware | Yes (new) | Yes | Yes |
| Async task management | Yes (new) | Yes (Routines) | Yes (Agent Toolkit) |
| MCP support | Yes (third-party models) | Yes (native) | Yes |
| Mobile integration | Android Halo | None | None |
| Cloud platform tie | Google Cloud / Vertex | Anthropic API | OpenAI / Azure |
| Open source | No (managed service) | No | No |
The three frameworks have converged on similar capabilities. The choice depends on which ecosystem you’re shipping into.
Verdict
Antigravity 2 brings Google to feature parity with Anthropic and OpenAI on serious agent infrastructure. The differentiators are:
- Android Halo integration for mobile agent UX (unique).
- Google Cloud / Vertex tight coupling for enterprises already on GCP.
- Gemini 3.5 Flash as the cheap default model (best price-per-capability in May 2026).
For developers building agentic AI in mid-2026, Antigravity 2 is now a credible choice — not just for Google-shop teams but as a competitive alternative to the Anthropic and OpenAI stacks.