ThumbGate Pre-Action Checks self-improve from ranked lessons and repeated failures, hard-block detected secret leaks, and block matches in strict mode.
SKILL.md
---
name: thumbgate
description: >
ThumbGate provides pre-action gates for AI coding agents. It captures
thumbs-up/down feedback on agent actions, auto-promotes repeated failures
into prevention rules, and blocks known-bad tool calls via PreToolUse hooks.
Trigger when the user wants to add safety guardrails to an AI agent workflow,
capture structured feedback on agent output, generate prevention rules from
failure patterns, gate high-risk actions before execution, or export DPO
training pairs from production feedback. Works with any MCP-compatible agent
including Cursor, Codex, Gemini CLI, Amp, and OpenCode.
---
# ThumbGate
Pre-action gates that stop AI coding agents from repeating known mistakes.
## Quick Start
```bash
npx thumbgate init
```
This installs the MCP server and wires it into your agent's tool configuration. No API keys required for the free tier.
Or install globally:
```bash
npm install -g thumbgate
thumbgate init
```
### MCP Configuration
Add to your agent's MCP config (e.g., `claude_desktop_config.json` or `.cursor/mcp.json`):
```json
{
"mcpServers": {
"thumbgate": {
"command": "npx",
"args": ["-y", "thumbgate"]
}
}
}
```
## How It Works
### Feedback Capture
When an agent action succeeds or fails, capture structured feedback:
- **Thumbs up**: Records what worked, tags it, and stores it as a reusable pattern.
- **Thumbs down**: Records the failure context, what went wrong, and what to change. Repeated failures auto-promote into prevention rules.
### Prevention Rules
After a failure pattern repeats (default: 2 occurrences), ThumbGate auto-generates a prevention rule. These rules are injected into agent context before every tool call, blocking the known-bad pattern before it executes.
### Pre-Action Gates
Gates intercept tool calls via the MCP PreToolUse hook. Each gate checks the proposed action against:
1. Prevention rules generated from past failures
2. Thompson Sampling confidence scores (adaptive sensitivity)
3. LanceDB vector similarity to known-bad patterns
If a match is found, the gate blocks execution and surfaces the prior failure context.
### Context Packs
Bounded retrieval of relevant feedback history for the current task. The agent gets exactly the lessons that matter, not the entire history.
## MCP Tools Provided
| Tool | Description |
|------|-------------|
| `capture_feedback` | Record thumbs-up/down with structured context |
| `search_lessons` | Query the lesson DB by keyword or semantic similarity |
| `get_prevention_rules` | Retrieve active prevention rules for the current context |
| `session_primer` | Get session handoff context (last task, next step, blockers) |
| `export_dpo` | Export feedback pairs in DPO training format |
## Tiers
| | Free | Pro | Team |
|---|---|---|---|
| Feedback capture | 3/day | Unlimited | Unlimited |
| Lesson search | 5/day | Unlimited | Unlimited |
| Active gates | 5 | Unlimited | Unlimited |
| Dashboard | - | Yes | Yes |
| DPO export | - | Yes | Yes |
| Seats | 1 | 1 | Per-seat |
| Price | $0 | $19/mo or $149/yr | $49/seat/mo |
Start a 7-day free trial of Pro: <https://thumbgate-production.up.railway.app/pro?utm_source=skill&utm_medium=agent_context&utm_campaign=pro_page>
## Compatibility
ThumbGate works with any MCP-compatible agent:
- Cursor
- Codex
- Gemini CLI
- Amp
- OpenCode
- Any agent supporting the Model Context Protocol
## Links
- NPM: [thumbgate](https://www.npmjs.com/package/thumbgate)
- Repository: [IgorGanapolsky/ThumbGate](https://github.com/IgorGanapolsky/ThumbGate)
- Dashboard: <https://thumbgate-production.up.railway.app/dashboard>
README
AI coding agents repeat mistakes — and one wrong tool call can wipe a directory, leak a key, or push broken code.
ThumbGate is the local-first firewall for AI coding agents. It runs in the PreToolUse hook on your machine and blocks dangerous tool calls — rm -rf, secret exfiltration, off-scope edits, a bad git push — before they execute, across Claude Code, Cursor, Codex, Gemini, Amp, Cline, and OpenCode. No server, no gateway. (Regulated-industry policy templates — legal intake, financial compliance, healthcare — build on the same engine.)
The product is a self-improving enforcement layer: thumbs-down feedback, prompt evaluation, and proof from prior runs become prevention rules that permanently stop repeated failures before the next tool call.
Agent tries: rm -rf tests/
ThumbGate: ⛔ BLOCKED — "Never delete test directories"
Pattern matched: rm.*-rf.*tests
Source: your thumbs-down from last Tuesday
Tokens spent on this repeat: 0
npx thumbgate init # auto-detects your agent, wires hooks, 30 seconds
Works with Claude Code, Cursor, Codex, Gemini CLI, Amp, Cline, OpenCode and any MCP-compatible agent. Free tier: 5 feedback captures/day (25 total) and up to 3 active auto-promoted prevention rules. Pro: $19/mo or $149/yr — unlimited rules, history-aware lessons, feedback sessions, dashboard, DPO export. Enterprise (custom pricing, scoped after intake) adds a shared hosted lesson DB, org dashboard, and shared org-wide enforcement.