ThumbGate — PreToolUse Agent Firewall

io.github.IgorGanapolsky由 GitHub 账号 IgorGanapolsky 发布v1.39.1更新于 Nov 18, 2026

Sub-ms PreToolUse firewall, feedback memory, and single-use permits for AI coding agents.

概览

AI 生成的概览

面向 AI 编码代理的本地前置防火墙,在工具调用执行前检查、拦截密钥泄露,并把点赞/点踩反馈转化为防护规则。

可以做什么
  • 在工具调用执行前评估,返回允许、警告或拒绝
  • 采集点赞/点踩反馈,把具体失误转化为防护规则
  • 查看生效规则、经验教训、拦截统计与执行状态
  • 生成本地汇总经验与规则的 brain 文件
  • 对钩子接线与就绪状态做健康检查
  • 导出经验与偏好数据对(付费版)
适用场景
当 AI 编码代理可能在人工查看前执行破坏性命令或泄露密钥时适用,可在工具执行前加一道本地关卡。适合使用 Claude Code、Cursor、Codex、Gemini CLI 等代理、希望把重复失误变成强制规则的开发者。
运行要求
以 npx 运行的本地进程,需要 Node.js 18 或更高版本。通过初始化命令写入代理设置与钩子;MCP 服务器本身以 stdio 启动。基础路径未声明 API 密钥或环境变量;付费功能涉及单独的 API 密钥用于本地导出接口。
安装前请注意
默认只硬拦截检测到的密钥泄露和两类自我禁用命令;rm -rf、强制推送、拉取即执行和修改护栏默认仅警告,需开启严格模式才拒绝。初始化命令会写入代理设置与钩子,默认作用于整台机器,经验教训保存在本地。无限规则、经验搜索与导出属于付费层级并涉及托管 API 密钥,使用前请确认价格。

安装

在 SourceWeft 中

  1. 打开 控制台中的 ThumbGate — PreToolUse Agent Firewall,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

ThumbGate 👍 👎

[ThumbGate Infrastructure Firewall with Thumbs Up and Thumbs Down]

ThumbGate is the self-improving pre-action firewall for AI coding agents
AI coding agents repeat mistakes — and one wrong tool call can wipe a directory, leak a key, or push broken code.

[MCP Toplist] [CI] [npm version] [npm weekly downloads] [GitHub stars] [GitHub Marketplace: ThumbGate Agent Governance] [License: MIT]

[Quick Start] [Watch Demo] [Try GPT] [Pro Tier]


What it does

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.

ThumbGate GitHub star growth is measured with GitHub's privacy-safe GET /repos/{owner}/{repo}/stargazers/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 (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. 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:

MemeMeaning
[Agent destroys prod without a gate]Unchecked tool calls ship destructive commands.
[Prompt vs PreToolUse hook]A prompt is advice; a PreToolUse hook is enforcement.

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. Other high-risk classes (rm -rf, force-push, fetch-and-run, direct guardrail edits) warn and log by default. Set THUMBGATE_STRICT_ENFORCEMENT=1 for strict enforcement (warnings become hard denies).

VerdictDefault behavior
⛔ Hard-blockDetected secret leaks; process-kill/environment-override self-disable
👎 Warn + logrm -rf, git push --force, fetch-and-run, direct guardrail edits — warn by default
👍 AllowEverything else

Accepted feedback is stored as local lessons. Repeated concrete failures can become prevention rules that promote from warnings to blocking gates. The firewall improves from operations without retraining the model. 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.

Works with Claude Code, Cursor, Codex, Gemini CLI, Amp, Cline, OpenCode, and other MCP agents.

[AI Agent without ThumbGate vs Agent guarded by ThumbGate]

  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

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.


Quick Start

Want a phased walkthrough with a verify step at every stage? Follow the Progressive Setup Guide.

Progressive wiring — prove the pipe before you turn matching on. Empty dashboard is success.

bash
npx thumbgate init          # Phase 1: hooks onlynpx thumbgate doctor        # verify: exits 0 only when PreToolUse hook is wired (hidden metric = hook install, not gate count)npx thumbgate dashboard --open  # Phase 2: open local HTML; empty stats are OKnpx thumbgate capture --feedback=down --context="Never run DROP on production tables" --what-went-wrong="agent proposed DROP" --what-to-change="require review for DROP"

Later DROP attempts in the same scope surface the check:

⚠️ Check fired: "Never run DROP on production tables"   Pattern: DROP.*production   Verdict: 👎 WARN + LOG   (⛔ BLOCK when THUMBGATE_STRICT_ENFORCEMENT=1)

Numbered configs: config/progressive/. Guide: progressive wiring.

MCP / Glama / 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.

▶ 90-second demo · GIF walkthrough


Install for your agent

AgentCommandEnforcement
Claude Codenpx thumbgate init --agent claude-code🛡️ Hard — PreToolUse
Codexnpx thumbgate init --agent codex🛡️ Hard — pre_tool_use
Gemini CLInpx thumbgate init --agent gemini🛡️ Hard — PreToolUse
ForgeCodenpx thumbgate init --agent forge🛡️ Hard — pre_tool_use
Cursornpx thumbgate init --agent cursor💬 Advisory — MCP gate_check
Clinenpx thumbgate init --agent cline💬 Advisory — MCP + .clinerules
OpenCodenpx thumbgate init --agent opencode💬 Advisory — MCP gate_check
Any MCP agentnpx thumbgate serve💬 Advisory — MCP gate_check
Ampnpx thumbgate init --agent amp📝 Feedback capture
GitHub Actionsuses: IgorGanapolsky/ThumbGate@v1🩺 Marketplace Action — doctor / AI inventory in CI

Per-agent guides: Claude/Codex bridge · Codex profile · Cursor · MCP setup

Install scope: machine-wide vs per-project

ScopeCommandSettingsLessonsBest for
Machine-wide (default)npx thumbgate init~/.claude/settings.json~/.claude/memory/feedback/Solo operators — same machine-local feedback store across repos
Per-projectnpx thumbgate init --project<repo>/.claude/settings.json<repo>/.claude/memory/feedback/Client / compliance — separate dashboard / isolated lessons per repo

Both scopes write mcpServers.thumbgate plus PreToolUse / UserPromptSubmit / PostToolUse / SessionStart hooks. Machine-wide is the right default for most developers. Cross-repo blocking is not automatic: a lesson learned in one project only applies elsewhere when you share the store (machine-wide) or export/import lessons.

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.


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:

CommandWhat it does
/thumbgate-dashboardOpen local project dashboard
/thumbgate-guardTurn last mistake into a hard prevention rule
/thumbgate-rulesList active rules & lessons
/thumbgate-blockedGate stats + enforcement matrix
/thumbgate-protectBranch governance + scoped approval
/thumbgate-doctorHealth-check hooks, MCP, readiness

Pricing & buyer paths

Free tier: 2 feedback captures/day (10 total) 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.

FreePro ($19/mo or $149/yr)Enterprise
Local CLI + PreToolUse✅✅Scoped after intake
Feedback captures2 feedback captures/day (10 total)UnlimitedScoped after intake
Active auto-promoted rulesup to 3 active auto-promoted prevention rulesUnlimitedScoped after intake
Personal dashboard + DPO export—✅Reviewed during intake
Hosted team lesson sync——Not general availability
Hosted org dashboard——Not general availability

Enterprise intake path: the Setup Sprint scopes one repeated failure before any broader rollout commitment. Start intake →

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, 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 is the self-serve side lane for a personal dashboard and export-ready evidence.

Start free · Pro $19/mo · Live Dashboard · Team Sprint intake · Setup Sprint · First Dollar Playbook

Popular buyer questions: AI search topical presence · Relational knowledge and AI recommendations · AI Mode ads for agent governance · MCP tool governance · AI agent pre-action approval gates · Background agent governance · GPT-5.5 model evaluation · Stop repeated AI agent mistakes · Browser automation safety · Native messaging host security · Autoresearch agent safety · Cursor guardrails · Codex CLI guardrails · Gemini CLI memory + enforcement · Google Cloud MCP guardrails · Roo Code alternative: migrate to Cline


How it works (short)

  1. Capture 👍/👎 feedback (CLI, MCP, linked feedback session flow / open_feedback_session, or ThumbGate GPT)
  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.

Architecture diagram & stack

[ThumbGate Architecture]

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    → hard-block (default)⚠️ force-push          → warn; hard-block under strict⚠️ 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 initnpx thumbgate doctornpx thumbgate capture up|down "<text>"npx thumbgate lessonsnpx thumbgate brain --writenpx thumbgate dashboard --opennpx thumbgate break-glass --reason="ThumbGate over-fired"   # 5-min recovery
Pro: lesson + DPO export
bash
# Portable lessonscurl -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-tuningcurl -X POST http://localhost:3456/v1/dpo/export \  -H "Authorization: Bearer $THUMBGATE_API_KEY" \  -o dpo-pairs.jsonl

Tech Stack

LayerTech
RuntimeNode.js ≥18
InterfacesMCP stdio, HTTP API, CLI
StorageSQLite + FTS5, LanceDB vectors, JSONL logs
IntelligenceMemAlign dual recall, Thompson Sampling, local embeddings
Billing / hostStripe, Railway
ExecutionRailway, Cloudflare Workers, Docker Sandboxes
GovernanceWorkflow 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 Firewall & 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 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).

Integrations (compact)

SurfaceStart here
Open ThumbGate GPTthumbgate.ai/go/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 PluginOpen the Codex plugin install page: thumbgate.ai/codex-plugin · zip: thumbgate-codex-plugin.zip · plugins/codex-profile/INSTALL.md
Claude Desktop .mcpblatest release
VS Code / Open VSXplugins/vscode-extension/README.md
Antigravity-compatibleplugins/antigravity-extension/INSTALL.md
JetBrainsplugins/jetbrains-plugin/README.md · JetBrains Marketplace path for the same runtime
ChatGPT App / GPT Actionthumbgate.ai/chatgpt-app
ThumbGate-Core (staging)https://github.com/IgorGanapolsky/ThumbGate-Core — pre-release staging + a few internal cache scripts; not the product moat

Docs

Full index: docs/INDEX.md

NeedLink
Agent workflow contractWORKFLOW.md
Ready-for-agent intake.github/ISSUE_TEMPLATE/ready-for-agent.yml
Cloud-to-Mac dispatch loopdocs/guides/mac-dispatch-loop.md
Verification Evidencedocs/VERIFICATION_EVIDENCE.md
Release Confidencedocs/RELEASE_CONFIDENCE.md
Changeset strategydocs/CHANGESET_STRATEGY.md
First Dollar Playbookdocs/FIRST_DOLLAR_PLAYBOOK.md
Security policySECURITY.md
Threat modelTHREAT_MODEL.md
Federal / regulateddocs/FEDERAL.md
Commercial Truthdocs/COMMERCIAL_TRUTH.md
Issues / PRsGitHub Issues · PR template

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).


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 · thumbgate.ai

License

MIT — see LICENSE. Project policy: SECURITY.md · THREAT_MODEL.md.

来源:README.md,提交 7d23574

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v1.39.1最新Nov 11, 2026
  2. v1.27.17Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分