# ThumbGate ๐Ÿ‘ ๐Ÿ‘Ž

ThumbGate Infrastructure Firewall with Thumbs Up and Thumbs Down

ThumbGate checks AI coding actions before they run: allow, warn or deny
It checks every tool call your agent is about to make and stops the dangerous ones before they run.

CI npm version npm weekly downloads License: MIT

## What it does **ThumbGate checks an AI coding agent's actions before they run.** Catastrophic commands and secret leaks are denied; your thumbs-downs become checks on the next matching command. One wrong tool call can wipe a directory, leak a key, or push broken code. ThumbGate is the local-first **Pre-Action Checks** engine for AI coding agents. It runs in the PreToolUse hook to evaluate the proposed tool call before execution โ€” so costly mistakes can be caught before they happen. - **Blocks the worst commands out of the box:** secret leaks, force-push, `git reset --hard`, `rm -rf` on home or root, `DROP TABLE`. - **Holds after your ๐Ÿ‘Ž:** the command your agent just ran is held until you say go ahead. - **Checks some claims:** in Claude Code, a reply that says "deployed" with no proof, or states that something is open or running with no check, is sent back to the agent. - **Runs on your machine:** no account and no cloud needed for the checks. Works with **Claude Code, Cursor, Codex, Gemini CLI, Amp, Cline, OpenCode**, and other MCP agents. [**โ–ถ 90-second demo**](https://thumbgate.ai/#demo?utm_source=github&utm_medium=readme&utm_campaign=demo_video) ยท [GIF walkthrough](docs/media/thumbgate-demo.gif) --- ## Quick Start You need Node.js 18 or newer. Run these two commands in the project where your agent works: ```bash npx thumbgate init # finds your agent (Claude Code, Cursor, Codex, ...) and installs the hooks npx thumbgate doctor # checks that the hooks are really wired ``` **What success looks like:** `doctor` prints `Overall: READY` and exits with code 0. If it says something is missing, it lists what to fix; run `init` again or pick your agent from the [table below](#install-for-your-agent). That's it. The built-in checks are now active. Your agent can keep working as usual; ThumbGate only speaks up when a tool call matches a check. **See a block without risking anything.** This hands ThumbGate the same input your agent's hook would, without running the command: ```bash echo '{"tool_name":"Bash","tool_input":{"command":"git push --force"}}' | npx thumbgate gate-check ``` You get `"permissionDecision":"deny"` and `[GATE:force-push] Force push blocked.` In a real session, the agent gets that answer and the push never runs. ### Your first gate, start to finish (Claude Code) Run in an empty git project with an empty `HOME` from the published package on 27 Nov 2026. `โ€ฆ` marks lines cut for length. The two `echo` lines send the hooks what Claude Code sends them, so nothing is deployed. **1. Install** ```console $ npx thumbgate init --agent claude-code โ€ฆ Claude Code: wired PreToolUse hook โ€ฆ ``` **2. The agent is about to run a command.** `{}` means ThumbGate has no objection. ```console $ echo '{"tool_name":"Bash","tool_input":{"command":"npm run deploy:staging"},"session_id":"demo"}' | npx thumbgate gate-check {} ``` **3. Create the gate.** In Claude Code you just type `thumbs down: that deployed to the wrong environment`. From a terminal: ```console $ echo '{"prompt":"thumbs down: that deployed to the wrong environment","session_id":"demo"}' | npx thumbgate hook-auto-capture ThumbGate hold: thumbs-down received. `npm run deploy:staging โ€ฆ` is refused until the person says "go ahead". Ask what to change. โ€ฆ โœ… Feedback captured โ€ฆ ``` **4. Trigger it: the block** ```console $ echo '{"tool_name":"Bash","tool_input":{"command":"npm run deploy:staging"},"session_id":"demo"}' | npx thumbgate gate-check {"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"[GATE:thumbs-down-hold] The person gave a thumbs-down right after `npm run deploy:staging โ€ฆ`. That action is held until the person says to go on (a thumbs-up or \"go ahead\"). โ€ฆ"}} ``` **5. Check the wiring** ```console $ npx thumbgate doctor โ€ฆ Overall: READY โ€ฆ ThumbGate MCP wiring doctor: OK โ€ฆ held: `npm run deploy:staging โ€ฆ` clear it: npx thumbgate holds release โ€ฆ ``` This gate is a [hold](#holds-and-how-to-release-or-remove-a-gate): `npx thumbgate holds release` clears it. ### Teach it your first rule (optional) When your agent does something you never want repeated, give it a thumbs-down: In Claude Code you can also install it as a plugin: ``` /plugin marketplace add IgorGanapolsky/ThumbGate /plugin install thumbgate@thumbgate-marketplace ``` ```bash npx thumbgate capture --feedback=down --context="Never run DROP on production tables" --what-went-wrong="agent proposed DROP" --what-to-change="require review for DROP" ``` From then on the agent sees that lesson before a matching action. After three matching thumbs-downs it becomes a check that warns, or blocks with `THUMBGATE_STRICT_ENFORCEMENT=1`. (`DROP TABLE` itself is already denied by default.) To see your rules and what was caught, run `npx thumbgate dashboard --open`. An empty dashboard on day one is normal; it means nothing has fired yet. Want a phased walkthrough with a verify step at every stage? Follow the [Progressive Setup Guide](GUIDE.md) ([Progressive wiring](https://thumbgate.ai/guides/progressive-wiring) online; numbered configs in [`config/progressive/`](config/progressive/)). --- ## Install for your agent | Agent | Command | Enforcement | |-------|---------|-------------| | **Claude Code** | `npx thumbgate init --agent claude-code` | ๐Ÿ›ก๏ธ Hard โ€” PreToolUse | | **Codex** | `npx thumbgate init --agent codex` | ๐Ÿ”Œ Wired โ€” `pre_tool_use` hook, not yet tested end to end with Codex's own payload | | **Gemini CLI** | `npx thumbgate init --agent gemini` | ๐Ÿ”Œ Wired โ€” PreToolUse hook, not yet tested end to end with Gemini CLI's own payload | | **ForgeCode** | `npx thumbgate init --agent forge` | ๐Ÿ›ก๏ธ Hard โ€” `pre_tool_use` | | **Cursor** | `npx thumbgate init --agent cursor` | ๐Ÿ›ก๏ธ Hard for shell commands โ€” `beforeShellExecution` hook denies them. ๐Ÿ’ฌ Advisory for every other Cursor tool (file edits, MCP calls) โ€” MCP `gate_check`. If the hook errors, the command is denied (fails closed; see [Cursor adapter](adapters/cursor/CURSOR.md#what-happens-when-the-hook-fails)). | | **Cline** | `npx thumbgate init --agent cline` | ๐Ÿ’ฌ Advisory โ€” MCP + `.clinerules` | | **OpenCode** | `npx thumbgate init --agent opencode` | ๐Ÿ’ฌ Advisory โ€” MCP `gate_check` | | **Any MCP agent** | `npx thumbgate serve` | ๐Ÿ’ฌ Advisory โ€” MCP `gate_check` | | **Amp** | `npx thumbgate init --agent amp` | ๐Ÿ“ Feedback capture | | **GitHub Actions** | `uses: IgorGanapolsky/ThumbGate@v1` | ๐Ÿฉบ Marketplace Action โ€” doctor / AI inventory in CI | Per-agent guides: [Claude/Codex bridge](plugins/claude-codex-bridge/README.md) ยท [Codex profile](plugins/codex-profile/README.md) ยท [Cursor](docs/CURSOR_PLUGIN_OPERATIONS.md) ยท [MCP setup](docs/MCP_AUTONOMOUS_SETUP.md) ### Install scope: machine-wide vs per-project | Scope | Command | Claude Code hooks | MCP entry | Lessons and dashboard data | |-------|---------|-------------------|-----------|----------------------------| | **Machine-wide** (default) | `npx thumbgate init` | `~/.claude/settings.json`, so they run in every repo on this machine | `/.mcp.json` | `/.thumbgate/` | | **Per-project** | `npx thumbgate init --project` | `/.claude/settings.json`, so they run only in this repo | `/.mcp.json` | `/.thumbgate/` | Lessons stay per repo in both scopes: a ๐Ÿ‘Ž in `repo-A` does not flag anything in `repo-B`. Cross-repo blocking is not automatic. Versions before 1.31 kept lessons in `/.claude/memory/feedback/` or `~/.thumbgate/projects//`. ThumbGate reads `/.thumbgate/` first once it exists, and `init` creates it, so copy the old files into `/.thumbgate/` to keep those lessons. Keep `.thumbgate/` out of git. Inits before 1.44.0 wrote hooks to `~/.claude/settings.local.json`, which Claude Code does not read. From 1.44.0 the ThumbGate MCP server moves them to `~/.claude/settings.json` the next time it starts (set `THUMBGATE_DISABLE_CLAUDE_SELF_HEAL=1` to stop that), `npx thumbgate init` moves them right away, and `npx thumbgate doctor` tells you if they are still in the old file. `/.claude/settings.json` is the file teams usually commit, so check the hook paths in it before you commit it. Skills and slash commands can run shell commands while they load (``!`cmd` ``), and Claude Code never sends those to PreToolUse. On Claude Code 2.1.332 or later, `init` also wires the `PreSkillShellCommand` hook (`thumbgate skill-shell-gate`), which runs the same gate-check on them, and the MCP server adds it to older installs on its next start. It warns by default and logs to `.thumbgate/skill-shell-gate-log.jsonl`. Set `THUMBGATE_SKILL_SHELL_GATE=enforce` to block those commands, or `off` to skip the check. For an MCP-only install, `npx thumbgate install-mcp` adds `mcpServers.thumbgate` to `~/.claude/settings.json`, and `npx thumbgate install-mcp --project` adds it to `/.claude/settings.json` instead. Neither writes hooks. **MCP tools (surface):** `gate_check` (read/evaluate proposed tool call), feedback capture + session tools (write), dashboard/stats (read). Destructive agent actions stay blocked/warned by PreToolUse โ€” ThumbGate does not execute user shell commands for you. **Does the gate cover MCP tool calls?** Yes, for Claude Code: the installed PreToolUse hook uses the matcher `.*` (`scripts/auto-wire-hooks.js`), so `mcp__server__tool` calls go through the same gate as Bash, Edit and Write. ### Any MCP client, Glama, or registry install (stdio) Directories and clients that install ThumbGate as an MCP server must start **stdio MCP**, not the HTTP API: ```bash npx -y thumbgate serve ``` - Equivalent: `npx -y thumbgate mcp` - Do **not** use `npm start` for MCP โ€” that launches the hosted HTTP API (`src/api/server.js`), not the agent-facing stdio server. --- ## What a ๐Ÿ‘ and a ๐Ÿ‘Ž do | You give | What ThumbGate does | |----------|---------------------| | ๐Ÿ‘Ž typed in the agent session right after a command | Makes a learned rule that denies that command the next time the agent tries it, with your reason (since 1.64.0). A rule that would have blocked your past safe calls stays a warning. Lift a deny for an hour with `npx thumbgate unblock `. | | ๐Ÿ‘Ž from the CLI with only a sentence of context (no command attached) | Saves a lesson the agent sees before a matching action. On the third matching ๐Ÿ‘Ž, a check fires: a warning by default, a block with `THUMBGATE_STRICT_ENFORCEMENT=1`. | | ๐Ÿ‘ with one sentence of context | Saves a success lesson and counts it in your stats. It does not create, loosen or lift a check. | | ๐Ÿ‘ or ๐Ÿ‘Ž with no context and no command | Logged only. Nothing is stored or promoted. | | ๐Ÿ‘ right after a command, with auto-approve on (opt-in) | The next call with the same pattern (for example `npm test`, `git status`) skips Claude Code's permission prompt. Hard blocks still win, a later ๐Ÿ‘Ž on the pattern revokes it, and chained commands, `sudo`, `rm`, force-push, `curl -k` and `Write` are never auto-approved. In Claude Code auto mode the approval also skips the auto-mode classifier (tested on 2.1.332), so git commands that can discard work (`checkout`, `restore`, `reset`, `stash`, `rebase`, `commit --amend`) only match the exact command you gave ๐Ÿ‘. Turn on with `npx thumbgate auto-approve on`; see what it learned with `npx thumbgate auto-approve status`. | Example: the agent runs `npm run deploy:staging` and you type *"thumbs down: that pushed to the wrong environment"*. The next `npm run deploy:staging` gets a warning, with your reason, before it runs. You thumbs-down it a second time, and it becomes a learned rule that warns on every later run. A later ๐Ÿ‘ on the same command is saved as a success lesson, and the rule stays in place. ### Holds, and how to release or remove a gate A **hold** is a pause. When you type a ๐Ÿ‘Ž right after the agent ran something, ThumbGate warns the agent, with your reason, before that same action (the same tool; for a shell command, the same first three words) until you say to go on. With `THUMBGATE_HARD_BLOCK_GATES=thumbs-down-hold` or strict mode the hold refuses it instead. A hold on inline code (`python3 -c`, a heredoc, a pipe into Python) covers that script in any form, not every later `python3` run. It exists so the agent cannot repeat what you just marked wrong. A hold lasts up to 24 hours, and several ๐Ÿ‘Ž on the same action count as one hold. Three ways out: 1. **Say it.** Start your message with "go ahead", "continue", "proceed", "resume" or "unblock", or give a ๐Ÿ‘. 2. **Clear it now.** Run `npx thumbgate holds release` in the project folder. `npx thumbgate holds` lists what is held. 3. **Turn the hold off.** Run `npx thumbgate holds off`. It takes effect in the session that is already running, and `npx thumbgate holds on` brings it back. Setting `THUMBGATE_THUMBS_DOWN_HOLD=0` before you start a session does the same for that session. Turning the hold off keeps every other gate: the denied-by-default commands (force-push, secrets sent out, `rm -rf` on home and the like) and the chat send rules stay on. `THUMBGATE_SEND_GATE=0` is the switch for the whole chat send gate, holds included. `npx thumbgate break-glass` does not lift a hold. Limits: a hold matches the same tool or the same first three words, so a reworded command is not held, and ThumbGate is not a sandbox. ### Unblock a gate `npx thumbgate unblock` (1.60.0+) shows which gate or hold refused a call and the exact command that clears it. - `npx thumbgate unblock holds` releases thumbs-down holds. - `npx thumbgate unblock --reason "why" --ttl 1h` grants a time-boxed, audited override for that one gate (24 hours at most; `--revoke` ends it early). The override turns the gate into a warning even in strict mode or under `THUMBGATE_HARD_BLOCK_GATES`. - Catastrophic commands, secrets and attempts to switch off ThumbGate are never unblocked. Change the command instead. From 1.61.0 the money and outbound-send gates (`financial-control`, `outbound-email-send` and the other never-demoted floors) can't be unblocked either, if you've turned them into blocks with `THUMBGATE_HARD_BLOCK_GATES`. - From 1.61.0 the local dashboard (`npx thumbgate dashboard --open`) has an Unblock panel that does the same with buttons. Agents can use the `thumbgate-unblock` skill (`skills/thumbgate-unblock/SKILL.md`) instead of asking a person. --- ## How it works (short) 1. **Capture** ๐Ÿ‘/๐Ÿ‘Ž feedback (CLI, MCP, linked feedback session flow / `open_feedback_session`, or [ThumbGate GPT](https://thumbgate.ai/go/gpt?utm_source=github&utm_medium=readme)) 2. **Promote** concrete lessons via history-aware lesson distillation into prevention rules 3. **Evaluate** the next proposed tool call against active rules (literal/AST + local vectors) 4. **Allow / warn / deny** before the tool runs ```bash npx thumbgate brain --write # โ†’ .thumbgate/BRAIN.md (lessons + gates in one artifact) ``` Pro operators can invoke `search_lessons` through MCP and use `npx thumbgate lessons` from the CLI. History-aware feedback sessions and lesson search are Pro capabilities; Free does not include recall or search. ### How enforcement works It **hard-blocks detected secret leaks and two direct self-disable command classes by default** โ€” commands that terminate the ThumbGate gate process or enable its bypass environment override. It also denies catastrophic commands by default: force-push, `git reset --hard`, `git clean -fdx`, `rm -rf` on home or root, `DROP TABLE`, `find / -delete`, and cloud or cluster wipes (`terraform destroy`, `kubectl delete`, `aws s3 rm`). Since 1.59.0 every other gate, including ๐Ÿ‘Ž holds and rules learned from ๐Ÿ‘Ž, **warns and counts its fires** (`npx thumbgate gate-stats`). `THUMBGATE_HARD_BLOCK_GATES=` turns chosen gates back into blocks. Set `THUMBGATE_STRICT_ENFORCEMENT=1` for strict mode: most Warnings become Denied, but a rule learned from one ๐Ÿ‘Ž stays a Warning. The [product facts](#product-facts) table lists each case. | Verdict | Default behavior | |---------|------------------| | โ›” **Hard-block** | Detected secret leaks; process-kill/environment-override self-disable; changes to the `hooks` section of Claude settings; catastrophic commands (force-push, `git reset --hard`, `git clean -fdx`, `rm -rf` on home or root, `DROP TABLE`, `find / -delete`, cloud and cluster wipes) | | ๐Ÿ‘Ž **Warn + log** | ๐Ÿ‘Ž holds, rules learned from ๐Ÿ‘Ž, fetch-and-run, spend and email sends, vulnerability and license findings, other matching rules (most become Denied in strict mode; see [product facts](#product-facts)) | | ๐Ÿ‘ **Allow** | Everything else | **Accepted feedback is stored as local lessons.** Repeated concrete failures become prevention rules that warn by default. The model is not retrained. Prompt evaluation (`npx thumbgate eval`) turns accepted feedback into reusable eval cases and local proof reports. **Honest disclaimer:** ThumbGate does not update model weights. It intercepts tool calls at runtime. Local-first โ€” no cloud required for the enforcement path. **Host-level limits (Claude Code):** enforcement holds only on paths where the hook runs. - `claude --safe-mode` starts without user/project hooks and `claude --bare` skips hook discovery entirely, so ThumbGate does not run on either path ([CLI reference](https://code.claude.com/docs/en/cli-reference); safe-mode also observed by an external harness on 2.1.332, while that harness's `--bare` run was inconclusive). - A hook that exits 1 is treated as an error and the call goes through; only exit code 2 or a JSON deny blocks. ThumbGate answers with JSON decisions, so its blocks do not depend on exit codes. - If you install another PreToolUse hook that returns `updatedInput`, the hook that finishes last wins, so a hook finishing after ThumbGate can rewrite a command ThumbGate allowed. A later deny still blocks. `npx thumbgate doctor` lists any other PreToolUse hooks it finds in user and project settings (managed, plugin and `--settings` hooks are not inspected) โ€” but this is a warning only; it cannot prevent a rewrite, and the residual gap stays until the executor itself verifies the decision. (Exit-code, last-finisher and safe-mode behavior measured by an external harness on Claude Code 2.1.332, 3 runs per case, judged by what reached disk: the `claude-code-cli-hooks` examples in the `oxdeai/oxdeai` repository, 2026-11-28.) [![AI Agent without ThumbGate vs Agent guarded by ThumbGate](public/assets/diagrams/thumbgate-agent-meme.jpg)](https://thumbgate.ai/#demo?utm_source=github&utm_medium=readme_meme) ``` Agent tries: rm -rf tests/ ThumbGate: ๐Ÿ‘Ž WARN + LOG โ€” "Never delete test directories" Pattern matched: rm.*-rf.*tests Source: your thumbs-down from last Tuesday Strict mode: โ›” DENY before tool execution ```
Architecture diagram & stack [![ThumbGate Architecture](docs/diagrams/thumbgate_architecture.png)](https://thumbgate.ai/#how-it-works) ```mermaid flowchart LR A["Agent tool call"] --> B{"Rule match?"} B -- exact --> D["On-device gate"] B -- semantic --> C["Local LanceDB"] C --> D D -- secret/kill --> E["โ›” Hard-block"] D -- known-bad --> G["๐Ÿ‘Ž Warn + log"] D -- safe --> F["๐Ÿ‘ Allow"] ```
Built-in checks ``` โ›” secret-exfiltration โ†’ hard-block (default) โ›” self-protect-kill โ†’ hard-block (default) โ›” self-protect-env-override โ†’ hard-block (default) โ›” self-protect-hooks-disable โ†’ hard-block (default) โ›” force-push โ†’ hard-block (default) โ›” git-reset-hard โ†’ hard-block (default) โ›” git-clean-force โ†’ hard-block (default) โ›” rm-rf-home-or-root โ†’ hard-block (default) โ›” db-drop-table-production โ†’ hard-block (default) โš ๏ธ thumbs-down-hold โ†’ warn; hard-block under strict โ›” auto-* (learned) โ†’ deny (stays warn if it would have blocked past safe calls) โš ๏ธ protected-branch โ†’ warn; hard-block under strict โš ๏ธ unresolved-threads โ†’ warn; hard-block under strict โš ๏ธ package-lock-reset โ†’ warn; hard-block under strict ```
CLI cheatsheet ```bash npx thumbgate init npx thumbgate doctor npx thumbgate capture up|down "" npx thumbgate lessons npx thumbgate brain --write npx thumbgate dashboard --open npx thumbgate break-glass --reason="ThumbGate over-fired" # 5-min recovery ```
Pro: lesson + DPO export ```bash # Portable lessons curl -X POST http://localhost:3456/v1/lessons/export \ -H "Authorization: Bearer $THUMBGATE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"outputPath": "./lessons-export.json"}' # DPO pairs for fine-tuning curl -X POST http://localhost:3456/v1/dpo/export \ -H "Authorization: Bearer $THUMBGATE_API_KEY" \ -o dpo-pairs.jsonl ```
### Agentic development cycle fit Agentic development is becoming a loop: **Guide โ†’ Generate โ†’ Verify โ†’ Solve**. ThumbGate is the pre-action gate / pre-action boundary between generated intent and executed action. --- ## Discoverable slash-commands โ€” the guardrail layer for spec-driven agents Spec-driven agent frameworks like **GSD** (get-shit-done) and **GitHub Spec Kit** plan and generate work. ThumbGate is the **guardrail layer for spec-driven agents**: it sits *after* the plan, on the boundary between a generated tool call and its execution โ€” **alongside GSD / Spec-Kit, not instead of them**. `npx thumbgate init` installs these into your agent palette: | Command | What it does | |---------|--------------| | `/thumbgate-dashboard` | Open local project dashboard | | `/thumbgate-guard` | Turn last mistake into a hard prevention rule | | `/thumbgate-rules` | List active rules & lessons | | `/thumbgate-blocked` | Gate stats + enforcement matrix | | `/thumbgate-protect` | Branch governance + scoped approval | | `/thumbgate-doctor` | Health-check hooks, MCP, readiness | --- ## Claude's memory tool, backed by ThumbGate (opt-in) Claude's [memory tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool) (`memory_20250818`) runs on your side: Claude asks to view or edit files under `/memories`, and your code does it. ThumbGate ships that handler, with checks on every write: paths stay under `/memories`, secrets are redacted before anything is saved, sizes are capped, and your thumbs-down rules show up read-only at `/memories/thumbgate-rules.md`. **Claude Code, Cursor or any MCP client:** run `npx thumbgate init --memory-tool` (or answer yes when `init` asks), or set `"env": {"THUMBGATE_MEMORY_TOOL": "1"}` on the ThumbGate MCP server. Claude gets a `claude_memory` tool, stored in `.thumbgate/memories`. **Messages API / Agent SDK, copy and paste:** ```js // npm install thumbgate @anthropic-ai/sdk (ANTHROPIC_API_KEY in your environment) const Anthropic = require('@anthropic-ai/sdk'); const { createMemoryTool } = require('thumbgate/adapters/claude-agent-sdk/memory-tool.js'); const memory = createMemoryTool({ root: './agent-memory' }); const client = new Anthropic(); const messages = [{ role: 'user', content: 'Pick up where we left off on the release checklist.' }]; async function main() { for (;;) { const res = await client.messages.create({ model: 'claude-opus-5-5', max_tokens: 4096, tools: [memory.definition], messages }); messages.push({ role: 'assistant', content: res.content }); const uses = res.content.filter((b) => b.type === 'tool_use' && b.name === 'memory'); if (!uses.length) return res; messages.push({ role: 'user', content: uses.map((b) => { const r = memory.execute(b.input); return { type: 'tool_result', tool_use_id: b.id, content: r.content, is_error: r.isError }; }) }); } } main().then((res) => console.log(res.content.filter((b) => b.type === 'text').map((b) => b.text).join('\n'))); ``` **Controls:** `THUMBGATE_MEMORY_TOOL=read` gives Claude read-only memory (view works, every write is refused; `createMemoryTool({ readOnly: true })` in code). `npx thumbgate memory-export` writes everything ThumbGate remembers for the project to a folder of Markdown files you can read, diff or zip: one file per lesson, `rules.md` and the memory-tool notes, secrets redacted, nothing changed. Details and limits: [adapters/claude-agent-sdk/README.md](adapters/claude-agent-sdk/README.md#memory-tool-handler-opt-in) ยท walkthrough: [thumbgate.ai/learn/claude-memory-tool-backend](https://thumbgate.ai/learn/claude-memory-tool-backend). Each memory command sends one anonymous ping per process (command name and `sdk` or `mcp`, never a path or text); `THUMBGATE_NO_TELEMETRY=1` turns it off. --- ## Integrations (compact) | Surface | Start here | |---------|------------| | **Open ThumbGate GPT** | [thumbgate.ai/go/gpt](https://thumbgate.ai/go/gpt?utm_source=github&utm_medium=readme&utm_campaign=readme_gpt) โ€” **ThumbGate GPT: start here.** Paste agent actions, get advice + checkpointing. **No, users do not have to keep chatting inside the ThumbGate GPT to use ThumbGate** โ€” the **hard enforcement layer still runs where the work happens**. | | **Install Codex Plugin** | Open the Codex plugin install page: [thumbgate.ai/codex-plugin](https://thumbgate.ai/codex-plugin) ยท zip: [thumbgate-codex-plugin.zip](https://github.com/IgorGanapolsky/ThumbGate/releases/latest/download/thumbgate-codex-plugin.zip) ยท [plugins/codex-profile/INSTALL.md](plugins/codex-profile/INSTALL.md) | | Claude Desktop `.mcpb` | [latest release](https://github.com/IgorGanapolsky/ThumbGate/releases/latest/download/thumbgate-claude-desktop.mcpb) | | **VS Code / Open VSX** | [plugins/vscode-extension/README.md](plugins/vscode-extension/README.md) | | **Antigravity-compatible** | [plugins/antigravity-extension/INSTALL.md](plugins/antigravity-extension/INSTALL.md) | | **JetBrains** | [plugins/jetbrains-plugin/README.md](plugins/jetbrains-plugin/README.md) ยท JetBrains Marketplace path for the same runtime | | ChatGPT App / GPT Action | [thumbgate.ai/chatgpt-app](https://thumbgate.ai/chatgpt-app) | | **Slack alerts** | Set `THUMBGATE_SLACK_WEBHOOK_URL` to a Slack incoming webhook (`https://hooks.slack.com/...`, free on every Slack plan). Each block or approval hold posts the gate, tool and project to your channel, at most once per gate per 10 minutes, never the tool input. `THUMBGATE_SLACK_ALERT_WARN=1` adds warnings. | | ThumbGate-Core (staging) | https://github.com/IgorGanapolsky/ThumbGate-Core (private) โ€” pre-release staging + a few internal cache scripts; **not** the product moat | ## Gate coverage by host Which gates were actually denied on which host. Generated by `npm run compat:matrix` from real runs through each host's hook path; nothing here is typed by hand. "enforced" means a test ran that gate's denial through that host in this checkout. "not enforced" means the command ran and was allowed. "untested" means no run exists. Details and the exact check per host: [docs/host-compatibility.md](docs/host-compatibility.md). | Gate | Claude Code | Cursor | Codex | Gemini CLI | |---|---|---|---|---| | `force-push` | enforced | enforced | untested | untested | | `git-reset-hard` | enforced | enforced | untested | untested | | `git-clean-force` | enforced | enforced | untested | untested | | `rm-rf-home-or-root` | enforced | enforced | untested | untested | | `cloud-bulk-delete` | enforced | enforced | untested | untested | | `terraform-destroy` | enforced | enforced | untested | untested | | `kubectl-bulk-delete` | enforced | enforced | untested | untested | | `docker-system-prune-all` | enforced | enforced | untested | untested | | `iam-policy-change` | not enforced | not enforced | untested | untested | | Held after one thumbs-down, gate after two | not enforced | not enforced | untested | untested | | Text typed in a chat window or web page | out of scope | out of scope | out of scope | out of scope | ### Which hosts hard-stop, and how they fail | Host | Hard-stops a bad call | Fails open or closed | Evidence | |---|---|---|---| | Claude Code | yes (8 of 9 gates denied) | Fails open | [docs/host-compatibility.md](https://github.com/IgorGanapolsky/ThumbGate/blob/main/docs/host-compatibility.md) | | Cursor | yes (8 of 9 gates denied) | Fails closed | [tests/cursor-fail-closed.test.js](https://github.com/IgorGanapolsky/ThumbGate/blob/main/tests/cursor-fail-closed.test.js) | | Codex | untested | untested | [docs/host-compatibility.md](https://github.com/IgorGanapolsky/ThumbGate/blob/main/docs/host-compatibility.md) | | Gemini CLI | untested | untested | [docs/host-compatibility.md](https://github.com/IgorGanapolsky/ThumbGate/blob/main/docs/host-compatibility.md) | | Cline | no, warns only | no hook, so not applicable | [tests/advisory-hosts-honesty.test.js](https://github.com/IgorGanapolsky/ThumbGate/blob/main/tests/advisory-hosts-honesty.test.js) | | OpenCode | no, warns only | no hook, so not applicable | [tests/advisory-hosts-honesty.test.js](https://github.com/IgorGanapolsky/ThumbGate/blob/main/tests/advisory-hosts-honesty.test.js) | | Amp | no, warns only | no hook, so not applicable | [tests/advisory-hosts-honesty.test.js](https://github.com/IgorGanapolsky/ThumbGate/blob/main/tests/advisory-hosts-honesty.test.js) | --- ## Product facts (verified 2026-12-01, npm 1.64.0) Generated from `config/product-facts.json` by `scripts/product-facts.js`. ThumbGate turns your thumbs-downs on an AI coding agent's commands into checks that run before the next matching command. - **Warning**: The agent sees the check and your reason. The command can still run. - **Denied**: The hook stops the command before it runs. - **Strict mode**: THUMBGATE_STRICT_ENFORCEMENT=1. Checks that only warn by default deny instead, except a rule learned from a single thumbs-down. - **Advisory**: The agent is asked to run the check itself, so nothing stops a command it skips. | Situation | Default install | Strict mode | Plan | Status | | --- | --- | --- | --- | --- | | `git push --force`, `git reset --hard`, `git clean -fdx`, `rm -rf` on home or root, `find / -delete`, `DROP TABLE` | Denied | Denied | Free | Shipped (1.59.0) | | `terraform destroy`, `kubectl delete`, `aws s3 rm` and other cloud or cluster wipes | Denied | Denied | Free | Shipped (1.59.0) | | Sending a secret out, for example `curl -d @.env` | Denied | Denied | Free | Shipped (1.59.0) | | Switching ThumbGate off, for example `pkill -f thumbgate` or uninstalling it from inside the agent | Denied | Denied | Free | Shipped (1.63.0) | | `git push origin main` (a push to the default branch) | Denied (lift it for an hour with `npx thumbgate unblock protected-branch-push --reason "why you need it"`) | Denied | Free | Shipped (1.64.0) | | A command you gave a thumbs-down, right after and each time it runs again (a rule that would have blocked your past safe calls stays a Warning) | Denied | Denied | Free (3 active learned rules), Pro (unlimited) | Shipped (1.64.0) | | A learned check that passed its 30-day replay (under 2% of 50+ matching calls were ones you let through) | Denied | Denied | Free (3 active learned rules), Pro (unlimited) | Shipped (1.62.0) | | Other flagged actions, for example `npm publish` or `git commit --no-verify` | Warning | Denied | Free | Shipped (1.59.0) | | Claude Code runs a deploy (a push, a merge, `kubectl apply`, `aws ecs update-service`) and says it is deployed or live with no health or status read after it (Stop hook) | Reply sent back once to add proof. It checks that proof is present, not that it is true. | Same as default | Free | Shipped (1.45.0) | | The same action, reworded (for example `python3 -c "shutil.rmtree(...)"` after a thumbs-down on `rm -rf`) | Not caught. A learned rule matches the command, not its purpose. | Not caught | Free | Known limit | | Damage from a command ThumbGate allows | Not contained. ThumbGate is not a sandbox. | Not contained | Free | Known limit | | Agent | How | Enforcement | | --- | --- | --- | | Claude Code | PreToolUse hook on every tool call | Denied and Warning, tested end to end | | Cursor | beforeShellExecution and preToolUse hooks | Shell commands: Denied and Warning, tested end to end. Other tools: Advisory | | Codex, Gemini CLI | The same gate-check command in each agent's hook | Wired, not yet tested end to end with each agent's own payload | | Pydantic AI Pax | before_tool hook | Denied and Warning | | Cline, OpenCode, Amp and other MCP-only clients | MCP tools the agent may call | Advisory | **Free:** Free keeps 3 active learned rules and records 2 thumbs a day after a 7-day full Pro trial. Includes: Every default Denied check in the table; Learned rules from your thumbs-downs; The local dashboard (npx thumbgate dashboard --open); All supported agents. **Pro:** Pro is $19/month or $149/year for one developer. Adds: Unlimited active learned rules (free keeps 3); Unlimited thumbs-up and thumbs-down captures; Recall and lesson search across everything you have taught it; DPO and training-data exports. **Not shipped in any plan:** Team-shared rules; Rules shared between teammates' machines; Audit history for managers. **Teams:** Teams can ask for a 30-day pilot at https://thumbgate.ai/pilot. It is request only, with no self-serve team checkout. **What leaves your machine:** The CLI sends anonymous usage events: a random install id, the ThumbGate, Node and OS versions, the event name, and which built-in check fired (any rule learned from your thumbs-downs is sent only as "learned", never its words). Releases before 1.62.0 could send words from a learned rule's command; update to stop that. THUMBGATE_NO_TELEMETRY=1 or DO_NOT_TRACK=1 turns it off. Lessons and rules stay in .thumbgate/ in your repo. ## Pricing & buyer paths Free tier: **2 feedback captures/day** and **up to 3 active auto-promoted prevention rules**. Pro ($19/mo or $149/yr) is the individual tier for unlimited rules, history-aware lessons, linked feedback session flow, personal dashboard, and DPO export. **Enterprise is custom and scoped after intake**; hosted team lesson sync and a hosted org dashboard are not general availability. | | Free | Pro ($19/mo or $149/yr) | Enterprise | |---|---|---|---| | Local CLI + PreToolUse | โœ… | โœ… | Scoped after intake | | Feedback captures | 2 feedback captures/day | Unlimited | Scoped after intake | | Active auto-promoted rules | up to 3 active auto-promoted prevention rules | Unlimited | Scoped after intake | | Personal dashboard + DPO export | โ€” | โœ… | Reviewed during intake | | Hosted team lesson sync | โ€” | โ€” | Not general availability | | Hosted org dashboard | โ€” | โ€” | Not general availability | **Team path:** request a **30-day team pilot**. Tell us your team size and coding agent, and a person replies by email with how the pilot would run. There is no self-serve team checkout. **[Request a team pilot โ†’](https://thumbgate.ai/pilot?utm_source=github&utm_medium=readme&utm_campaign=team_rollout)** **Local technical path:** install the CLI and use `init` plus the documented setup so Pre-Action Checks evaluate tool calls where the agent actually runs. **First-dollar activation path:** open the [ThumbGate GPT](https://thumbgate.ai/go/gpt?utm_source=github&utm_medium=readme), paste the risky action, capture typed feedback (`thumbs down:` / `thumbs up:`). **Native ChatGPT rating buttons are not the ThumbGate capture path.** Ask: **what repeated AI mistake would be worth catching before the tool executes?** **Paid path for individual operators:** [ThumbGate Pro](https://thumbgate.ai/go/pro-direct?utm_source=github&utm_medium=readme&utm_campaign=pro_page) is the self-serve side lane for a personal dashboard and export-ready evidence. [**Start free**](https://thumbgate.ai/?utm_source=github&utm_medium=readme) ยท [**Pro $19/mo**](https://thumbgate.ai/go/pro-direct?utm_source=github&utm_medium=readme) ยท [**Live Dashboard**](https://thumbgate.ai/dashboard?utm_source=github&utm_medium=readme) ยท [**30-day team pilot**](https://thumbgate.ai/pilot?utm_source=github&utm_medium=readme&utm_campaign=top_cta) ยท [**First Dollar Playbook**](docs/business/FIRST_DOLLAR_PLAYBOOK.md)
More guides: popular buyer questions **Popular buyer questions:** **[AI search topical presence](https://thumbgate.ai/guides/ai-search-topical-presence?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** ยท **[Relational knowledge and AI recommendations](https://thumbgate.ai/guides/relational-knowledge-ai-recommendations?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** ยท **[AI Mode ads for agent governance](https://thumbgate.ai/guides/ai-mode-ads-agent-governance?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** ยท **[MCP tool governance](https://thumbgate.ai/guides/mcp-tool-governance?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** ยท **[AI agent pre-action approval gates](https://thumbgate.ai/guides/ai-agent-pre-action-approval-gates?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** ยท **[Background agent governance](https://thumbgate.ai/guides/background-agent-governance?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** ยท **[GPT-5.5 model evaluation](https://thumbgate.ai/guides/gpt-5-5-model-evaluation?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** ยท **[Stop repeated AI agent mistakes](https://thumbgate.ai/guides/stop-repeated-ai-agent-mistakes?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** ยท **[Browser automation safety](https://thumbgate.ai/guides/browser-automation-safety?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** ยท **[Native messaging host security](https://thumbgate.ai/guides/native-messaging-host-security?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** ยท **[Autoresearch agent safety](https://thumbgate.ai/guides/autoresearch-agent-safety?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** ยท **[Cursor guardrails](https://thumbgate.ai/guides/cursor-agent-guardrails?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** ยท **[Codex CLI guardrails](https://thumbgate.ai/guides/codex-cli-guardrails?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** ยท **[Gemini CLI memory + enforcement](https://thumbgate.ai/guides/gemini-cli-feedback-memory?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** ยท **[Google Cloud MCP guardrails](https://thumbgate.ai/guides/gcp-mcp-guardrails?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** ยท **[Roo Code alternative: migrate to Cline](https://thumbgate.ai/guides/roo-code-alternative-cline?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)**
--- ## Tech Stack | Layer | Tech | |-------|------| | **Runtime** | Node.js โ‰ฅ18 | | **Interfaces** | MCP stdio, HTTP API, CLI | | **Storage** | SQLite + FTS5, LanceDB vectors, JSONL logs | | **Intelligence** | MemAlign dual recall, Thompson Sampling, local embeddings | | **Billing / host** | Stripe, Railway | | **Execution** | Railway, Cloudflare Workers, Docker Sandboxes | | **Governance** | Workflow Sentinel, control plane, Docker Sandboxes | Every Changeset is tied to the exact `main` merge commit and generates Verification Evidence for Release Confidence. ## Cloud & model infrastructure - **Local Pre-Action Checks & MCP Runtime**: Sub-`0.5ms` local `PreToolUse` enforcement (`npx thumbgate init`) across Claude Code, Cursor, Codex, and Gemini CLI; `TencentDB Agent Memory` record normalization into blocking SQL safety candidates is covered in `tests/memory-provider-enforcement-bridge.test.js`, and outer-harness context-budget checks inspired by Tencent Hunyuan `Hy-Memory-30B-A3B` research are validated in `scripts/rrsi-doctor.js`. - **Companion Benchmark & Technical Case Study**: External evaluation of [Tencent Cloud](https://www.tencentcloud.com/) Lighthouse / CVM (`SA5` / `SA9` AMD Turin-Dense `3.4 GHz` all-core turbo in `ap-hongkong` & `ap-singapore`) and the `Hy-Memory-30B-A3B` surgical state-patching pattern is published in our companion `hermes-eval` benchmark repository (`docs/TENCENT-CLOUD-SA9-HUNYUAN-CASE-STUDY.md` and `scripts/tencent_sa9_hunyuan_benchmark.py`). ## Docs Full index: **[docs/INDEX.md](docs/INDEX.md)** | Need | Link | |------|------| | Free video course (41 min) | [Claude Code + ThumbGate on Udemy](https://www.udemy.com/course/claude-code-thumbgate-understand-the-gate-and-its-limits/?referralCode=FB94D82DF875072CBA42&utm_source=github&utm_medium=readme) | | Agent workflow contract | [WORKFLOW.md](WORKFLOW.md) | | Ready-for-agent intake | [.github/ISSUE_TEMPLATE/ready-for-agent.yml](.github/ISSUE_TEMPLATE/ready-for-agent.yml) | | Cloud-to-Mac dispatch loop | [docs/guides/mac-dispatch-loop.md](docs/guides/mac-dispatch-loop.md) | | Verification Evidence | [docs/VERIFICATION_EVIDENCE.md](docs/VERIFICATION_EVIDENCE.md) | | Release Confidence | [docs/RELEASE_CONFIDENCE.md](docs/RELEASE_CONFIDENCE.md) | | Changeset strategy | [docs/CHANGESET_STRATEGY.md](docs/CHANGESET_STRATEGY.md) | | First Dollar Playbook | [docs/business/FIRST_DOLLAR_PLAYBOOK.md](docs/business/FIRST_DOLLAR_PLAYBOOK.md) | | Security policy | [SECURITY.md](SECURITY.md) | | Threat model | [THREAT_MODEL.md](THREAT_MODEL.md) | | Federal / regulated | [docs/FEDERAL.md](docs/FEDERAL.md) | | Commercial Truth | [docs/COMMERCIAL_TRUTH.md](docs/COMMERCIAL_TRUTH.md) | | Issues / PRs | [GitHub Issues](https://github.com/IgorGanapolsky/ThumbGate/issues) ยท [PR template](.github/pull_request_template.md) | **FAQ (one-liners):** Not a fine-tuner (runtime intercept only). Different from `CLAUDE.md` / `.cursorrules` (those are context; ThumbGate is an external allow/warn/deny before tools run). --- ## About this project ### Why usage, not stars ThumbGate GitHub star growth is measured with GitHub's privacy-safe [`GET /repos/{owner}/{repo}/stargazers/history`](https://docs.github.com/en/rest/activity/starring#get-repository-star-history) endpoint (weekly counts, no stargazer identities). Run `npm run stars:history -- --fixture tests/fixtures/github-star-history.json --json` for the local proof. Stars are not npm installs and not revenue. The live GitHub Marketplace Action is [ThumbGate Agent Governance](https://github.com/marketplace/actions/thumbgate-agent-governance) (`uses: IgorGanapolsky/ThumbGate@v1`). **Usage over star count.** Evaluate ThumbGate from the install path and live usage badges above (`npx thumbgate init`, Marketplace `uses:`, npm weekly downloads, GitHub clones), not from whether the repo has twenty stars or twenty thousand. No pitch deck is required. We do not farm GitHub profile badges (no YOLO-merge of protected `main`, no 5-minute Issue close theater, no fake `Co-authored-by`). Galaxy Brain needs real accepted answers in [Discussions Q&A](https://github.com/IgorGanapolsky/ThumbGate/discussions/categories/q-a). `npm run github:achievements -- --fixture tests/fixtures/github-achievements.json --json` inventories what is already earned vs what we refuse to farm. #### Who it's for ThumbGate is for operators whose AI coding agents can leak a secret or destroy a checkout before a human sees the tool call (Claude Code, Cursor, Codex, Gemini CLI, MCP). Discovery should reach those operators โ€” not a star campaign. ThumbGate is **not** a GitHub star package, not fake engagement, and not a substitute for npm installs or merged PRs. Real engagement is `npx thumbgate init` and a PreToolUse hook that actually fires. #### Tech memes (shareable) Lightweight visuals for how agents fail without a pre-action gate: | Meme | Meaning | |------|---------| | ![Agent destroys prod without a gate](docs/media/meme-agent-destroys-prod.svg) | Unchecked tool calls ship destructive commands. | | ![Prompt vs PreToolUse hook](docs/media/meme-prompt-vs-hook.svg) | A prompt is advice; a PreToolUse hook is enforcement. | #### Listings Listed on mcpservers.org MCP Toplist GitHub stars GitHub Marketplace: ThumbGate Agent Governance Also available: [ThumbGate GPT](https://thumbgate.ai/go/gpt?utm_source=github&utm_medium=readme) ยท [ThumbGate Pro ($19/mo)](https://thumbgate.ai/go/pro-direct?utm_source=github&utm_medium=readme) --- ## Who builds this **Igor Ganapolsky** โ€” payments (Stripe/Connect), AI agent guardrails/MCP, Android + backends. Small number of contract slots: **$120โ€“150/hr, 1099, remote US**. [LinkedIn](https://www.linkedin.com/in/igor-ganapolsky-664324431/) ยท [thumbgate.ai](https://thumbgate.ai) ## Support ThumbGate If ThumbGate saves you from a repeated agent mistake, you can [buy me a coffee](https://buymeacoffee.com/IgorGanapolsky). ## License MIT โ€” see [LICENSE](LICENSE). Project policy: [SECURITY.md](SECURITY.md) ยท [THREAT_MODEL.md](THREAT_MODEL.md).