Thumbgate pretool gate

From IgorGanapolsky/ThumbGate · View interactive version

Thumbgate pretool gate is an AI agent skill from the GitHub repository IgorGanapolsky/ThumbGate. Hard-blocks secret exfiltration and repeats of a ranked lesson before a tool call, instead of warning and continuing. Use when the user asks to gate an agent, block a secret, stop a repeat mistake, capture thumbs-down feedback, check gate stats, or install ThumbGate.

How to use this skill

Skill file

ThumbGate pre-tool gate

ThumbGate checks a tool call before it runs. Ranked lessons become prevention rules. A detected secret is a deny. A warning is not permission to continue a secret leak.

The public package is thumbgate at version 1.46.0. Hosted Pro (shared lesson history, dashboard, proof) is a separate product at https://thumbgate.ai and is not included in this file.

Install

Run this in the project the agent is editing:

npx thumbgate@1.46.0 init

That scaffolds local gate state and the MCP config. It talks only to the npm registry and, if the user asks for a trial note, to thumbgate.ai. Do not add another installer, a pipe into a shell, or a host that is not in external_urls.

Before the tool call

  1. Read the command, the URL, and the file path. If any of them would print, post, upload, or copy a secret, deny the call. Do not paste the secret into a replacement command.
  2. If this repository already has a ranked lesson for the same failure, deny the repeat.
  3. A warn on spend or on an internal policy is a warning. Show it. A warn is never an allow for a secret.
  4. A deny stops the action. Do not add a bypass flag, a force flag, or a second attempt that hides the same payload.

Pipe the tool call through the public checker when the host agent does not already run the hook:

npx thumbgate@1.46.0 gate-check

Send a PreToolUse JSON object on stdin:

{
  "tool_name": "<tool name>",
  "tool_input": { "...": "..." }
}

Parse the JSON response. If hookSpecificOutput.permissionDecision is "deny", stop the turn and do not run the tool call. Do not rely on the process exit status; denied calls exit with status 0. Treat checker errors or an invalid response as a failure and do not run the tool call.

After the action

When a gate should have fired and did not, record the miss:

npx thumbgate@1.46.0 feedback --feedback=down --context="what happened" --what-went-wrong="specific failure" --what-to-change="specific fix" --tags="secrets,pretool"

When a deny saved the turn:

npx thumbgate@1.46.0 feedback --feedback=up --context="what the gate stopped" --what-worked="specific block" --tags="secrets,pretool"

Read the counters with:

npx thumbgate@1.46.0 gate-stats

What this file does not do

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.