What is ThumbGate?
ThumbGate is a local-first firewall for AI coding agents that runs in the PreToolUse hook. It hard-blocks catastrophic tool calls by default (secret exfiltration, destructive deletes, supply-chain attacks) and warns‑and‑logs all other risk classes, with optional strict enforcement. It works across Claude Code, Cursor, Codex, Gemini CLI, Amp, Cline, and OpenCode, and requires no server on the enforcement path.
How to use ThumbGate?
Run npx thumbgate init to auto-detect your agent and wire the hooks (about 30 seconds). To create a prevention rule, use npx thumbgate capture down "Never run DROP on production tables". Discoverable slash-commands (/thumbgate-guard, /thumbgate-rules, etc.) are installed into the agent’s palette for browsing and invoking enforcement actions.
Key features of ThumbGate
- PreToolUse hook catches dangerous calls before the model spends tokens.
- Hard-blocks catastrophic classes (secret exfiltration,
rm -rf, supply‑chain) by default.
- Warns and logs other risk classes; hard‑blocks everything under
THUMBGATE_STRICT_ENFORCEMENT=1.
- Thumbs‑down feedback becomes reusable, auto‑promoted prevention rules.
- Context Brain (
BRAIN.md) gives each agent session persistent institutional memory.
- Slash commands (
/thumbgate-guard, /thumbgate-rules, etc.) for discoverable guardrails.
Use cases of ThumbGate
- Preventing an AI agent from force‑pushing to main after one thumbs‑down.
- Hard‑blocking destructive deletes (
rm -rf) and secret leaks without waiting for a review.
- Stopping repeated tool‑call mistakes across sessions to avoid unnecessary token spend.
- Enforcing branch/release governance with scoped, expiring approvals.
- Auditing every interception with a dashboard that tracks tokens saved and enforcement events.
Comments