# Tool call permission gate

> Tool call permission gate is an open-source agent skill for security. Classifies proposed shell, file and MCP calls and refuses the clearly destructive ones. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/mrmps/classifier-dev/tree/main/skills/tool-call-permission-gate
- **Repository:** https://github.com/mrmps/classifier-dev
- **GitHub stars:** 440
- **License:** MIT
- **Skill name:** tool-call-permission-gate
- **Collection:** https://github.com/mrmps/classifier-dev
- **Categories:** [security](https://ai-powered.com/categories/security)
- **Listing updated:** 2026-12-04

## About

This skill adds a PreToolUse hook that sends a redacted, length-capped description of each proposed tool call to an external classifier. The classifier returns a consequence label and a confidence. Calls labelled destructive or irreversible with high confidence are refused, and every other call is passed to the person as a normal confirmation with the label and score attached as a reason.

The bundled hook script redacts bearer and basic auth headers, key, token, secret and password fields, long opaque strings, hex digests, email addresses and query strings before anything leaves the machine. If a call still contains more than two redaction placeholders it is not sent and falls back to a question for the person. A network failure or rate limit also falls back to asking.

An auto-allow flag exists but is off by default. The skill advises running the gate in log-only mode for a while before enabling it, and notes that it is not a security boundary, so hard deny rules should still cover acts you never want. Setup means registering the script under hooks.PreToolUse in the Claude Code settings file, with Node.js available for the script.

## When your agent uses it

> A second opinion on every shell, file and MCP call a coding agent proposes: classify what it would do, refuse the confidently destructive ones, and attach the reason to the confirmation the person already sees, with the command redacted first. Use when setting up a PreToolUse hook.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/mrmps/classifier-dev/tree/HEAD/skills/tool-call-permission-gate)
- [License: MIT](https://github.com/mrmps/classifier-dev/tree/HEAD/skills/tool-call-permission-gate)

## Features

- **Consequence-based classification:** Labels each proposed call by what running it would do rather than matching command strings.
- **Pre-send redaction:** Strips credentials, secrets, emails, long tokens and query strings before a call leaves the machine.
- **Confident refusal:** Blocks calls classified as destructive or irreversible above a high confidence threshold.
- **Annotated confirmations:** Attaches the classifier label and confidence to the question the person already sees.
- **Opt-in auto-allow:** Offers a flag to approve read-only or in-repository calls, disabled by default.
- **Fail-safe fallbacks:** Asks the person when the classifier is unreachable, rate limited or the call is too redacted to send.

## Good for

- Stop an agent from running destructive shell commands without a second look
- Add a confidence-scored warning to file edit and shell confirmations
- Gate MCP tool calls behind a consequence check before they run
- Log what a coding agent proposes for a week before trusting an auto-approve setting

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/tool-call-permission-gate` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/tool-call-permission-gate &&
cp -R "$tmp/skills/tool-call-permission-gate" ~/.claude/skills/tool-call-permission-gate &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/tool-call-permission-gate` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/tool-call-permission-gate` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/tool-call-permission-gate &&
cp -R "$tmp/skills/tool-call-permission-gate" ~/.agents/skills/tool-call-permission-gate &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/tool-call-permission-gate` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/tool-call-permission-gate` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/tool-call-permission-gate &&
cp -R "$tmp/skills/tool-call-permission-gate" ~/.cursor/skills/tool-call-permission-gate &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/tool-call-permission-gate` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/mrmps/classifier-dev.git --path skills/tool-call-permission-gate
```

Or copy the folder to `~/.gemini/skills/tool-call-permission-gate` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/tool-call-permission-gate`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/tool-call-permission-gate &&
cp -R "$tmp/skills/tool-call-permission-gate" ~/.copilot/skills/tool-call-permission-gate &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/tool-call-permission-gate` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/mrmps/classifier-dev.git
```

Then copy `classifier-dev/skills/tool-call-permission-gate` into your agent's skills folder as `tool-call-permission-gate`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill send to the external service?

One redacted string per call containing the tool name and its arguments, cut to 2,000 characters. The skill says no file contents, environment or repository name are sent, and points to the service's privacy page for how input is handled.

### When does Tool call permission gate refuse a call?

Only when the classifier labels the call as destructive or irreversible with confidence of 0.9 or higher. Everything else is shown to the person as a question with the label and score.

### Is auto-allow on by default?

No. The --auto-allow flag must be set explicitly, and the skill recommends a logging period before enabling it.

### How is Tool call permission gate installed?

The skill describes registering the hook script in .claude/settings.json under hooks.PreToolUse with the Bash, Edit and Write matcher. Other clients are described as passing text through stdin.

### How do I install Tool call permission gate in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/tool-call-permission-gate to use it in all your projects, or to .claude/skills/tool-call-permission-gate in one project.

### Does Tool call permission gate run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Tool call permission gate?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Tool call permission gate?

The closest alternatives to Tool call permission gate are Guardrail tester, Red team, Security, Prompt injection guard and Speclock guardrails.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Guardrail tester](https://ai-powered.com/skills/guardrail-tester): Guardrail tester is an open-source agent skill for security.
- [Red team](https://ai-powered.com/skills/red-team): Red team is an open-source agent skill for security.
- [Security](https://ai-powered.com/skills/security-xiaolai): Security is an open-source agent skill for security.
- [Prompt injection guard](https://ai-powered.com/skills/prompt-injection-guard): Prompt injection guard is an open-source agent skill for security.
- [Speclock guardrails](https://ai-powered.com/skills/speclock-guardrails-sgroy10): Speclock guardrails is an open-source agent skill for security.
- [Agent action safety](https://ai-powered.com/skills/agent-action-safety): Agent action safety is an open-source agent skill for security.
- [Agent security hardening](https://ai-powered.com/skills/agent-security-hardening): Agent security hardening is an open-source agent skill for security.
- [Content moderation gate](https://ai-powered.com/skills/content-moderation-gate): Content moderation gate is an open-source agent skill for security.

---
Source: https://ai-powered.com/skills/tool-call-permission-gate
