Antigravity CLI Setup
AgentKeeper integrates with Antigravity CLI and Antigravity Desktop through the shared Antigravity hook system. There is no Antigravity browser-extension component in this integration.
AgentKeeper integrates with Antigravity CLI and Antigravity Desktop through the shared Antigravity hook system. There is no Antigravity browser-extension component in this integration.
The public installer wires the Antigravity events AgentKeeper can observe and govern: PreToolUse, PostToolUse, PreInvocation, PostInvocation, and Stop. Pre-tool events can be allowed, denied, or sent back to Antigravity as an approval request. Invocation and stop events are used for audit, setup health, and policy context.
Use Policy outcomes for the shared Monitor, Warn, and Block model; this page lists what the Antigravity surface can actually support.
What gets monitored
| Surface | Outcome support |
|---|---|
Shell commands (run_command) | Block, ask for approval, Warn, or Monitor before execution |
File reads and search (view_file, list_dir, grep_search) | Audit only, Warn, or Block when Antigravity emits the pre-tool event |
File writes (write_to_file, replace_file_content, multi_replace_file_content) | Block or Warn before execution |
Web and URL tools (search_web, read_url_content) | Domain and URL policy when emitted by the IDE |
| MCP calls | Server and tool policy when Antigravity includes MCP server/tool identity |
| Subagents, schedules, tasks, artifacts | Tool-name and Policy Profile coverage through Runtime Shield |
| Invocation lifecycle | Context injection, audit correlation, and stop-loop warnings |
Installation
Get your API key from Settings > Access > API keys, then run the public installer:
export AGENTKEEPER_API_URL="https://www.agentkeeper.dev"
export AGENTKEEPER_API_KEY="ak_live_..."
bash <(curl -fsSL "$AGENTKEEPER_API_URL/install-hooks.sh") --ide antigravity
The installer stores the API key in ~/.agentkeeper/config, installs ~/.agentkeeper/hooks/antigravity/agentkeeper-hook.sh, and updates ~/.gemini/config/hooks.json.
Generated config
{
"agentkeeper": {
"enabled": true,
"PreToolUse": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "bash "/Users/YOU/.agentkeeper/hooks/antigravity/agentkeeper-hook.sh"",
"timeout": 5
}
]
}
],
"PostToolUse": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "bash "/Users/YOU/.agentkeeper/hooks/antigravity/agentkeeper-hook.sh"",
"timeout": 5
}
]
}
],
"PreInvocation": [
{
"type": "command",
"command": "bash "/Users/YOU/.agentkeeper/hooks/antigravity/agentkeeper-hook.sh"",
"timeout": 5
}
],
"PostInvocation": [
{
"type": "command",
"command": "bash "/Users/YOU/.agentkeeper/hooks/antigravity/agentkeeper-hook.sh"",
"timeout": 5
}
],
"Stop": [
{
"type": "command",
"command": "bash "/Users/YOU/.agentkeeper/hooks/antigravity/agentkeeper-hook.sh"",
"timeout": 5
}
]
}
}
For MDM rollout, run the installer with AGENTKEEPER_API_KEY and --ide antigravity as the target developer. On macOS, deploy the hosted script at /mdm/intune/agentkeeper-antigravity-hooks.sh through Intune Platform Scripts, Jamf, or Iru/Kandji. On Windows, deploy /mdm/intune/agentkeeper-windows-antigravity-hooks.ps1.
Tool name mapping
| Antigravity tool name | AgentKeeper canonical name |
|---|---|
run_command | Bash |
view_file, read_file | Read |
write_to_file | Write |
replace_file_content | Edit |
multi_replace_file_content | MultiEdit |
list_dir, find_by_name | Glob |
grep_search | Grep |
search_web | WebSearch |
read_url_content | WebFetch |
invoke_subagent, define_subagent, manage_subagents | Agent |
manage_task, schedule | Agent |
| MCP server/tool payloads | MCP skill policy |
Verify coverage
- Restart Antigravity CLI or Antigravity Desktop after installing hooks.
- Ask Antigravity CLI to run a harmless command such as
pwd. - Check Activity for an
Antigravityevent. - Trigger a blocked command, write path, URL, MCP tool, or Policy Profile simulation and confirm the expected Monitor, Warn, or Block result.
- Check Team → Policies → Access Control to confirm Antigravity can be enabled, restricted to groups, or disabled.
- Check Workstations and Setup health for a healthy Antigravity source.
Notes
Antigravity hooks are fail-open by design. If AgentKeeper is unreachable, the adapter returns allow so developers are not blocked by a local network or dashboard outage. Runtime Shield only blocks surfaces Antigravity exposes through hooks; no browser capture is claimed by this integration.
Warn-mode matches are recorded in AgentKeeper Activity and return an AgentKeeper Warning reason while allowing the tool call to continue. Antigravity CLI 1.1.5 may not render the reason for an allow decision in the terminal.
For cross-IDE claims, see IDE runtime parity.