The Google Antigravity harness control model, explained
The Antigravity harness (Google’s IDE plus the agy CLI) controls tool calls with allow, ask and deny rules, a terminal sandbox, and five hook events. Its PreToolUse hook can return a native force_ask. ACP sits on that hook. One installer command registers it in ~/.gemini/config/hooks.json, and every tool call is then checked against policy before it runs.
Antigravity is Google’s agent-first development ecosystem. It includes the IDE, the agy CLI that replaced Gemini CLI in May 2026, extensions for VS Code, JetBrains, Zed and Xcode, and an enterprise tier under Gemini Enterprise. It has the same pieces as other harnesses: a permissions engine, a sandbox, hooks and an escape hatch. Several behave differently from the rest of the comparison page, and those differences decide how you control it.
The binary is closed source, but the control surface is documented and mostly checkable from outside. This page is read from the official docs and checked against the shipped agy 1.1.21 binary where possible.
It has two halves. The first covers Antigravity’s own controls and where they stop. The second is Antigravity with ACP: the hook registration, the config file, the decision mapping, and what a blocked call looks like. Just want to install it? The install guide is one command.
The permissions engine: three lists, one shape
Rules live in ~/.gemini/antigravity-cli/settings.json under a permissions object with allow, ask and deny arrays. Every rule is an action(target) resource:
{
"permissions": {
"allow": ["command(git)", "write_file(src/)", "mcp(linter/*)"],
"deny": ["command(rm -rf)", "command(sudo)", "write_file(.git/)"],
"ask": ["command(*)", "execute_url(aws.amazon.com)"]
}
}
Seven actions cover the surface:
read_file,write_fileandread_url.execute_url, which is browser actuation.command, matched by prefix or anchored regex, as incommand(npm run (build|lint|test)).mcp, writtenmcp(server/tool),mcp(server/*)ormcp(*).unsandboxed, covered in the sandbox section.
Precedence is strict: deny, then ask, then allow. A command(*) in ask forces a prompt past any narrower allow. Two implicit rules: allowing write_file on a path grants read_file there, and denying read_file denies write_file.
The defaults are sensible. Files inside the workspace are auto-allowed. Everything else (commands, MCP tools, URLs, files outside the workspace) defaults to ask. At a prompt you can widen a target’s scope for the rest of the turn, for example a file to its parent directory. Terminal commands can’t be scope-edited at the prompt.
The full rule language, including prefix and regex: command matching, the three presets and two worked rule sets, is on the Antigravity permissions reference. The hook contract, with a minimal hook you can write, is on the hooks reference.
This is a good rule language. It is less expressive than the TOML policy engine Gemini CLI shipped, with its per-mode rules, five priority tiers and root-owned admin policy files (the high-water mark of the July survey). But it covers files, commands, URLs, browser actuation and MCP tools in one syntax, and its server/tool MCP granularity is better than most harnesses manage.
Headless: an unanswerable ask is a deny
In print mode (-p) there are no prompts. Antigravity handles the empty chair correctly. An approval nobody can give is soft-denied. The run continues, exits 0, and a stderr notice names the tool and the allow rule you would need to pre-grant it. A mid-2026 changelog entry fixed headless runs that used to hang or silently auto-approve such calls, so the behavior is deliberate and recent.
dsh, Grok Build’s dontAsk and Gemini CLI’s old policy engine do the same. Hook-issued asks inherit this resolution too.
The hook system: five events, and the first native ask
Hooks register in hooks.json. The file is either workspace-local at .agents/hooks.json (behind folder trust) or user-global at ~/.gemini/config/hooks.json, shared by the CLI, the IDE and the app.
The five events are PreToolUse, PostToolUse, PreInvocation, PostInvocation and Stop. Tool events take a regex matcher on the tool name (run_command|view_file, browser_.*, or * for everything). Handlers are shell commands (type: "command" is the only kind) with a 30-second default timeout. Input is camelCase JSON on stdin, and the decision is JSON on stdout.
A minimal registration, in the shape the file takes:
{
"hooks": {
"PreToolUse": [
{
"matcher": "run_command",
"hooks": [
{ "type": "command", "command": "node ~/hooks/check-shell.mjs", "timeout": 30 }
]
}
],
"Stop": [
{ "type": "command", "command": "node ~/hooks/receipt.mjs", "timeout": 10 }
]
}
}
Note the asymmetry. Tool events are a list of { matcher, hooks[] } groups. Stop is a flat list of hook commands with no matcher.
What arrives on stdin. A PreToolUse payload carries the call as toolCall: { name, args }, plus conversationId, workspacePaths[], modelName and stepIdx. The tool names are Antigravity’s own: run_command, view_file, write_to_file, replace_file_content, multi_replace_file_content, grep_search, find_by_name, list_dir, search_web, read_url_content and invoke_subagent. A shell call’s command string rides in args.CommandLine, not command (verified live). PostToolUse adds an error string, and it also fires on non-tool steps, with toolCall null.
What goes back on stdout. A PreToolUse hook answers:
{ "decision": "deny", "reason": "…" }
decision is one of allow, deny, ask, force_ask, deny_unless_prior_grant. An optional permissionOverrides array can grant action(target) resources for the turn. ask prompts the human but respects cached “Always Allow” grants. force_ask prompts every time and ignores them.
No other mainstream harness lets a hook hand a call to the human as a first-class outcome. Claude Code’s hooks can ask, but Grok Build’s gate is allow/deny only, and most others are deny-only. For an outside policy layer, force_ask is the primitive you want, because a locally cached grant can’t pre-empt it.
PreInvocation and PostInvocation can inject steps into the loop, and PostInvocation can force-continue or terminate. Stop hooks can re-enter the loop with decision: "continue", with a built-in cap on consecutive continuations so an always-blocking stop hook can’t hold the agent forever.
Four sharp edges, all verified:
- A failing hook blocks the call. On a crash, timeout or non-zero exit, the harness reports
pre-tool hook failedand the tool call does not run. This is fail-closed, the opposite of Claude Code’s and Grok Build’s fail-open cores. A broken policy hook can’t lapse silently, which is good. But a hook whose upstream service is down can brick every tool call in the session, unless the hook has its own plan. Denials must travel as JSON with exit 0, because there is no exit-code deny channel. - The payload doesn’t name its event. The stdin JSON has no
hookEventName, unlike the Claude-style contracts. A handler serving several events must be registered once per event, with the event passed as a command-line argument. That is why the ACP registration below runs the same file ashook.mjs pre_tool_use,hook.mjs post_tool_useandhook.mjs stop. - The hook environment is sanitized. Only whitelisted variables reach the subshell, so configuring a hook through env vars mostly doesn’t work. Configuration has to live in a file the hook reads itself.
PostToolUsecarries no tool output. The payload has thetoolCalland anerrorstring, not what the tool returned. You can’t scan output from the hook payload alone. The full exchange is in the transcript file the payload points at.
The sandbox
enableTerminalSandbox (default false) confines agent-launched commands with native OS mechanisms: nsjail on Linux, sandbox-exec on macOS and AppContainer on Windows. The approval prompt adapts to the sandbox state. With it on, you can approve a single run without restrictions. With it off, you can opt a risky command into containment.
The unsandboxed(pattern) permission action exempts matching commands from confinement while still running them through the permission lists. Inside the workspace, a Git repo’s .git directory is mounted read-only even for otherwise-writable agents.
The sandbox is off by default, like most of the field. Our sandbox positioning applies unchanged: containment limits the damage, and it neither records nor decides anything.
Audit
Locally, Antigravity keeps per-conversation transcripts (transcript.jsonl under the app data directory). That is a full record of the exchange, not a ledger of decisions.
The enterprise tier is where audit becomes a product. Central logging of prompts, agent responses and metadata sits behind a single admin toggle, with IAM inheritance, VPC Service Controls, workspace/browser/MCP access restrictions and pooled spend caps on a rolling seven-day meter, via eligible Gemini Enterprise plans. Google states that enterprise session data isn’t used to train foundation models.
It is the most complete admin plane any harness vendor ships today, and it stops at its ecosystem. The controls attach at the Gemini Enterprise tier and cover Antigravity. A fleet that also runs Claude Code, Codex or Cursor gets no shared record, policy or approval queue from it.
The escape hatch
--dangerously-skip-permissions auto-approves every tool permission request (stream output reports always-proceed), and it is total.
We verified this live on 1.1.21 with an A/B pair of otherwise identical headless turns. Without the flag, a registered PreToolUse hook fires before the permission layer. With the flag, the hook layer is not invoked at all. There is no hook execution, no decision and no record.
Claude Code is different: deny rules, hooks and the circuit breaker survive --dangerously-skip-permissions. In Grok Build, deny rules and PreToolUse hooks fire in every mode. On Antigravity the flag doesn’t just skip prompts. It removes the interception surface. If a policy hook is part of your control story, this flag is the line it can’t cross. Unattended fleets should treat its use as the event to alert on.
Antigravity with ACP: the hook, the config, and a blocked call
Everything above is the harness’s own surface. ACP uses one piece of it, the PreToolUse hook, and answers in the harness’s own vocabulary. This section covers what’s on your machine after install, what crosses the wire, and what each outcome looks like inside a session.
What the installer puts where
curl -sf https://agenticcontrolplane.com/install.sh | bash
The installer detects Antigravity by the agy binary or an existing ~/.gemini/antigravity-cli directory, then:
| Path | What lands there |
|---|---|
~/.acp/hooks/antigravity/hook.mjs |
The hook: one Node file, zero dependencies, MIT on GitHub |
~/.acp/hooks/antigravity/acp.json |
The registration fragment below |
~/.gemini/config/hooks.json |
The fragment merged in under its own acp key. Existing hooks in the shared file are kept, never overwritten |
~/.acp/credentials |
The workspace key (the browser opens once to provision it; same file every ACP harness reads) |
~/.acp/config.json |
Optional operational overrides, snake_case keys, see below |
~/.acp/lapse.log |
Appended whenever a call proceeded without a policy check, and why |
The registration fragment, verbatim. It is the same file invoked three times with the event as its argument, because the payload doesn’t name its own event:
{
"acp": {
"enabled": true,
"PreToolUse": [
{
"matcher": "*",
"hooks": [
{ "type": "command", "command": "node \"$HOME/.acp/hooks/antigravity/hook.mjs\" pre_tool_use", "timeout": 30 }
]
}
],
"PostToolUse": [
{
"matcher": "*",
"hooks": [
{ "type": "command", "command": "node \"$HOME/.acp/hooks/antigravity/hook.mjs\" post_tool_use", "timeout": 30 }
]
}
],
"Stop": [
{ "type": "command", "command": "node \"$HOME/.acp/hooks/antigravity/hook.mjs\" stop", "timeout": 10 }
]
}
}
matcher: "*" means every tool call: shell, file edits, browser actuation, MCP tools and subagents, across the CLI, the IDE and the app, since they read the same file. To check it registered, run /hooks inside Antigravity.
What crosses the wire
| Antigravity event | ACP call | What the hook answers |
|---|---|---|
PreToolUse |
POST /govern/tool-use |
{"decision":"allow"}, or deny with a reason (below) |
PostToolUse |
POST /govern/tool-output |
{}. This is an audit and completion record. Antigravity’s payload carries the call and error status, not the tool’s output, so it is not a content scan |
Stop |
none | {"decision":"stop"}, plus a session receipt on stderr. Never continue, so a receipt can’t keep the agent running |
Before the policy check, the hook maps Antigravity’s tool names onto the canonical names the policy floors key on:
run_commandbecomesBash,view_filebecomesRead,write_to_filebecomesWrite.replace_file_contentandmulti_replace_file_contentbecomeEdit.grep_searchbecomesGrep,find_by_nameandlist_dirbecomeGlob.search_webbecomesWebSearch,read_url_contentbecomesWebFetch,invoke_subagentbecomesTask.
It also lifts args.CommandLine into the canonical command field. The original name travels alongside as client_tool_name, so the audit row shows what Antigravity actually called. Unknown and MCP tool names pass through unchanged.
The three outcomes, as Antigravity sees them
| ACP decision | Hook stdout | In the session |
|---|---|---|
| allow | {"decision":"allow"} |
The call runs. Nothing printed. |
| deny | {"decision":"deny","reason":"[ACP] Denied by policy: <reason>"} |
The call does not run. The reason is what Antigravity shows for it. |
| ask | a deny with the reason |
The call does not run. You approve it on the console Approvals page or from the email, then ask the agent to retry. |
What a blocked call looks like
We verified this case live on agy 1.1.21 (2026-08-26). The agent issues a recursive root delete. Antigravity hands the hook this on stdin (abridged):
{
"toolCall": { "name": "run_command", "args": { "CommandLine": "rm -rf /" } },
"conversationId": "…",
"workspacePaths": ["/Users/you/project"]
}
The hook posts it as tool_name: "Bash", client_tool_name: "run_command", tool_input: { "CommandLine": "rm -rf /", "command": "rm -rf /" }, and answers on stdout:
{
"decision": "deny",
"reason": "[ACP] Denied by policy: hardline floor: recursive delete of the root filesystem — blocked unconditionally; this pattern cannot be allowed by policy or approval"
}
Exit code 0, the call never runs, and the audit row records the decision, the reason, both tool names and the session. The reason text comes from the gateway. The [ACP] prefix is the hook’s.
That reason comes from the hardline floor. It is a short list that denies in every workspace, above policy, so no tenant setting, tier default or standing approval can allow it. The bar for the list is “no legitimate agent task ever needs it”:
- Recursive delete of the root filesystem, a system directory or the home directory, including quoting and
${HOME}spellings. mkfs, andddor a redirect onto a raw block device.- A fork bomb, and
kill -1. shutdown,reboot,halt,poweroff,init 0or6, andsystemctl poweroff.
Commands wrapped in sh -c '…' or eval '…' are scanned as commands, not prose. Everything softer is ordinary policy, which your workspace sets.
At the end of the session, the Stop hook prints one line to the scrollback:
[ACP] Session receipt: 14 tool calls governed · 1 denied · 2 held for approval — review this session: https://cloud.agenticcontrolplane.com/sessions/<conversationId>
Configuration: a file, not the environment
Antigravity sanitizes the hook’s environment, so the hook reads ~/.acp/config.json. Env vars win when they do reach it.
| Key | Env equivalent | Meaning |
|---|---|---|
agent_tier |
ACP_AGENT_TIER |
interactive (default) or background. CI=1 in the environment also resolves to background |
check_timeout_ms |
ACP_CHECK_TIMEOUT_MS |
Decision budget, default 4000. It is far under the registered 30-second hook timeout, so the hook always answers before Antigravity’s error path |
govern_base / console_base |
ACP_GOVERN_BASE / ACP_CONSOLE_BASE |
Gateway and console origins |
shadow |
ACP_SHADOW |
Set to off to silence shadow-mode advisory notices |
Unattended fleets should pin "agent_tier": "background" here. The tier changes the failure behavior, covered next.
Failure posture, on a fail-closed harness
Antigravity itself would block every call if this hook crashed, timed out or exited non-zero. So the hook never does that. Every outcome, including its own crash handling, travels as JSON with exit 0. What happens when the gateway is in trouble is the hook’s own choice:
- Interactive tier: gateway unreachable, so the call proceeds, loudly. stderr gets
[ACP] ⚠ UNGOVERNED: gateway unreachable (<detail>) — <tool> proceeded WITHOUT policy check. Lapse logged to ~/.acp/lapse.log.and the lapse log gets a durable line. An ACP outage should never brick an attended session. - Background tier: gateway unreachable, so the call is denied. Nobody is watching, so the block is the safety net.
- One retry on transport failure. An HTTP error status means the server answered, and it is never retried.
- No credential on the machine: every call proceeds with one
[ACP] ⚠ UNGOVERNED: no credentialwarning per invocation and a lapse line. Nothing is blocked before you’ve connected.
The limits
--dangerously-skip-permissionsremoves this hook along with every other. Verified by A/B: no invocation, no decision, no record. Use scopedpermissions.allowrules to unblock headless runs instead, and alert on the flag.PostToolUsecan’t see output, so the post-call record is a completion record, not a content scan.--localisn’t wired for Antigravity. ACP’s on-device engine (~/.acp/policy.json,~/.acp/audit.jsonl, no account) is wired for some harnesses, such as Claude Code, Cursor and Codex, but not all. The installer skips Antigravity under--localand says so. This hook needs a workspace.- Hooks see tool calls, not tokens. The Gemini endpoint is fixed, with no base-URL override, so Antigravity’s model traffic can’t be routed through the ACP proxy. The cost X-ray page lists it as tool-call control only.
- A hold is not an Antigravity prompt. The call is blocked, and you approve it on the console or from the email, then ask the agent to retry (coverage).
Where the model ends
- No decision ledger below enterprise. Transcripts record what happened. Nothing records what was decided and why: which rule matched, what was asked, who approved. The enterprise audit toggle exists because that record has buyers.
- Workspace hooks load on trust. Global settings and hooks live in the user profile, but workspace
.agents/hooks.jsonloads behind folder trust. Trust the folder and its hooks are live. - No output control after the call.
PostToolUsecan’t see output, so there is no native content check afterwards. - The escape hatch is total.
--dangerously-skip-permissionstakes hooks off the call path entirely (verified). No other mainstream harness we’ve tested unhooks its own interception layer with one flag. - One vendor’s fleet. The controls, enterprise plane included, cover Antigravity. Once your fleet is mixed, your control surface is too.
Fleet running more than Antigravity? One hook puts ACP’s policy, approvals and audit record on every Antigravity tool call. It is the same policy set that runs your Claude Code, Codex, Cursor and Grok Build sessions.
Frequently asked questions
How do permissions work in Google Antigravity?
Three lists in ~/.gemini/antigravity-cli/settings.json: allow, ask and deny. Each holds action(target) rules like command(git), write_file(src/) or mcp(sql/execute_mutation). Deny beats ask, and ask beats allow. Workspace files are auto-allowed. Commands, MCP tools, URLs and files outside the workspace default to ask. In headless mode an ask nobody can answer is soft-denied, with a stderr notice naming the allow rule you would need.
Does Antigravity support hooks?
Yes. There are five lifecycle events (PreToolUse, PostToolUse, PreInvocation, PostInvocation, Stop), registered in hooks.json, with regex matchers on tool names. A PreToolUse hook answers with allow, deny, ask, force_ask or deny_unless_prior_grant. That makes Antigravity the first mainstream harness whose hook vocabulary includes a native ask.
How do I run Antigravity with ACP?
One installer command detects the agy CLI (or an existing ~/.gemini profile), places one zero-dependency Node file at ~/.acp/hooks/antigravity/hook.mjs, and merges its registration into ~/.gemini/config/hooks.json under an acp key. The CLI, the IDE and the app all read that file, and existing hooks are never overwritten. From the next session every tool call is checked against workspace policy before it runs. An ACP deny blocks the call with the reason. An ACP hold also blocks the call: you approve it on the console or from the email, then ask the agent to retry. A session receipt with a review link prints at Stop.
What does a blocked tool call look like in Antigravity with ACP?
The hook answers Antigravity’s PreToolUse with JSON on stdout, {“decision”:”deny”,”reason”:”[ACP] Denied by policy: …”}, and the call never runs. For the always-on floor the reason reads, for example, hardline floor: recursive delete of the root filesystem, blocked unconditionally; this pattern cannot be allowed by policy or approval. We verified that exact case, rm -rf / issued through run_command, live on agy 1.1.21.
What happens when an Antigravity hook crashes or times out?
The tool call is blocked. Antigravity treats a failing pre-tool hook (crash, timeout, non-zero exit) as an error and fails closed. Claude Code’s and Grok Build’s core hooks fail open instead. A hook you install must therefore always exit 0 and put its answer in JSON, and it needs its own plan for when its upstream service is down.
Does Antigravity have a sandbox?
Yes. enableTerminalSandbox is off by default. When on, it confines agent-launched commands with nsjail on Linux, sandbox-exec on macOS and AppContainer on Windows. With the sandbox on you can lift it for a single run at the prompt. With it off you can opt a risky command in. An unsandboxed(…) permission rule exempts matching commands from containment while they still pass the permission lists.
What is the escape hatch in Antigravity?
--dangerously-skip-permissions auto-approves every tool permission request. We verified live on 1.1.21 that it also bypasses the hook layer: PreToolUse hooks are not invoked at all under the flag. Claude Code and Grok Build still apply deny rules and hooks in their bypass modes. On Antigravity nothing survives the flag, so treat it as total.
What do Antigravity's enterprise controls add?
Through eligible Gemini Enterprise plans: central audit logging of prompts, responses and metadata behind a single toggle, restrictions on workspace, browser and MCP server access, IAM policy inheritance, VPC Service Controls, and pooled spending caps on a rolling seven-day meter. These are admin controls for Google’s ecosystem. They don’t reach agents running outside Antigravity.
What is the agy harness?
agy is the Antigravity CLI. It replaced Gemini CLI in May 2026 and shares one permission engine, hook system and sandbox with the Antigravity IDE and app. Hooks are registered in ~/.gemini/config/hooks.json, the file the CLI, IDE and app all read.
What is antigravity acp?
Here ACP means Agentic Control Plane: a PreToolUse hook that checks every Antigravity tool call against workspace policy, blocks a held call until you approve it on the console or from the email, and records each decision. If you were looking for the Agent Client Protocol for editors, that is an unrelated project that shares the acronym. /acp-vs-acp explains which is which.
Running Antigravity? One command adds a hook. Each tool call it sees is recorded, and a force-push, destructive SQL or curl | sh is blocked until you approve it on the console or from the email.
curl -fsSL https://agenticcontrolplane.com/install.sh | bash
irm https://agenticcontrolplane.com/install.ps1 | iex
What the installer writes · Antigravity guide · free up to 5 agents