Skip to main content
Glama
Agy Guard
by tone-leh

Agy Guard

Deterministic Local Security Guardrail, Secret-Leak Shield & Zero-Git Pre-Edit Snapshot Time Machine for Google Antigravity 2.0

Antigravity 2.0 Native MCP App Zero Runtime Dependencies 100% Local License: MIT

English · 简体中文


Why Agy Guard?

AI coding agents move fast — which means one bad tool call can read .env.production, paste a hardcoded API key into src/, run git push --force, or wreck 6 files during an aggressive refactor before you even notice.

Relying on system prompts ("please don't read .env") is probabilistic. Agy Guard makes safety deterministic inside Google Antigravity 2.0:

  • Deterministic PreToolUse Firewall (<5ms): Blocks .env, ~/.ssh/*, ~/.aws/credentials, *.pem/*.key, rm -rf /, git push --force, git reset --hard, DROP TABLE, and gates curl | sh before execution ever happens.

  • Outgoing Secret-Leak Shield: Scans every write_file / edit_file payload for AWS keys, GitHub PATs, OpenAI/Anthropic/Stripe keys, Google API keys, Slack tokens, JWTs, and private key blocks — catching leaks before they touch disk or Git.

  • Zero-Git Pre-Edit Snapshot Time Machine: Automatically saves SHA-256 deduplicated file snapshots to ${PLUGIN_DATA}/blobs/ right before every mutating edit — zero git log or git stash pollution.

  • 1-Click Reversible Rollback UI: Inspect unified line-by-line diffs inside Antigravity's native sidebar (SEP-1865 MCP App) and restore any file in one click. Every restore automatically captures a pre-restore safety backup first, so even undo is undoable.

  • Zero Runtime Dependencies: Pre-bundled dist/server.cjs, dist/hook.cjs, dist/cli.cjs, and single-file React dist/ui/app.html. Zero cloud servers, zero Electron/CDP hacks, mode-0600 local storage.


Related MCP server: qedra

Install in 10 Seconds

agy plugin install https://github.com/tone-leh/agy-guard

Then open Agy Guard from the Antigravity sidebar (aux_pane / global entrypoint) or prompt:

"Open Agy Guard to inspect pre-edit file snapshots and recent security audit events"

Try Locally Without Touching Your Antigravity Setup (Zero-Touch Offline Workbench)

git clone https://github.com/tone-leh/agy-guard.git
cd agy-guard
npm install
npm run workbench
# Open http://127.0.0.1:4398 — test diff restore & dry-run threat simulation safely

Feature Matrix

Capability

Prompt-only Rules

Git Stash / Manual Commits

Agy Guard (Native MCP App)

Blocks .env / ~/.ssh / ~/.aws reads deterministically

❌ Probabilistic

❌ No

✅ <5ms PreToolUse hook

Catches API keys & JWTs in outgoing write_file / edit_file

❌ Easy to miss

❌ Too late (post-write)

✅ Blocked before disk write

Blocks rm -rf /, git push --force, git reset --hard

❌ Probabilistic

❌ No

✅ Hard deny or ask gate

Automatic pre-edit file snapshots without polluting Git

❌ No

❌ Clutters history

✅ SHA-256 blobs in ${PLUGIN_DATA}

Visual unified diff & 1-click reversible rollback inside sidebar

❌ No

❌ Terminal only

✅ Native Antigravity MCP App

Masked workspace secret scanner (never opens .env)

❌ No

❌ No

✅ Built-in UI + CLI


Architecture

MCP Tools Exposed

Tool

Visibility

Purpose

open_guard_panel

Model + UI (aux_pane, global)

Opens the native Agy Guard console

guard_status

Model

Summarizes active guardrails & snapshot counters

list_snapshots

Model

Lists recent pre-edit checkpoints (with optional path filter)

create_checkpoint

Model

Captures a manual multi-file safety checkpoint before risky refactors

scan_secrets

Model

Read-only masked secret scan of workspace source files

app_* (get_state, diff_snapshot, restore_snapshot, update_policy, scan_workspace, simulate_threat)

App-only (visibility: ["app"])

Keeps large diffs, policy edits, and dry-run simulations out of model context

CLI Utilities

node dist/cli.cjs doctor                                  # Verify bundle integrity
node dist/cli.cjs status                                  # Print active policy & counters
node dist/cli.cjs snapshots                               # List latest pre-edit checkpoints
node dist/cli.cjs scan .                                  # Masked workspace secret scan
node dist/cli.cjs test-policy run_command "git push -f"   # Dry-run policy evaluation

Part of the Antigravity 2.0 Native Plugin Suite

  1. agy-xray — Context Composition X-Ray, Token Vampire Detector & Cross-Session BM25 Time Machine

  2. agy-remote — Zero-Cloud Mobile PWA & 6-Channel IM Remote Approval Bridge

  3. agy-canvas — Visual Artifact Reviewer with Figma-Style Coordinate Pins

  4. agy-mem — Glass-Box Code-Anchored Long-Term Memory & Knowledge Graph with SHA-256 Drift Guard

  5. agy-guard — Local Security Guardrail, Secret-Leak Shield & Zero-Git Pre-Edit Snapshot Time Machine (this repo)


License

MIT © tone-leh

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      A local-first MCP safety layer that blocks dangerous files and redacts secrets before AI agents can access them, ensuring safe vibe coding.
      6 npm
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      A local policy gate for coding-agent tool calls, with heuristic shell/file checks, a z3 model of a structured Git sub-policy, and signed decision receipts. The executor is not a sandbox; the README documents its scope and limitations.
      6
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI coding agents to safely execute commands, run tests, and modify project files inside disposable, policy-enforced Docker sandboxes that are isolated from the host machine and its credentials.
      15
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI coding agents to avoid irreversible mistakes by intercepting risky deletions, overwrites, and commands before execution, applying path, pattern, and blast-radius safeguards with quarantine backups.
      3
      MIT