Skip to content
Skill

Guardrail tester

Checks if your agent's deny rules and hooks really block dangerous commands

Guardrail tester is an open-source agent skill for security. It is available on Claude Code, Codex, Cursor and Gemini CLI.

Scripts
Python
Platforms
Claude Code, Codex, Cursor
GitHub stars
1.7K
Last commit
License
MIT
Listing updated

Similar skills

About Guardrail tester

This skill tests the permission rules and PreToolUse hooks already configured in an agent harness against a battery of about 90 dangerous commands, including wrapped, reordered, and full-path forms that can slip past simple prefix rules. Rules are simulated from each harness's documented matching behavior, and results are reported as blocked, asking first, or running without asking, with the layer that made each decision.

The workflow starts with a rules-only pass that reads settings files and runs no hooks. It then lists the hook commands it found and reads their scripts. Only after the user agrees does it feed each matching hook test JSON, one call at a time with a time limit. The battery commands are never executed. They are written to do nothing if run, using made-up folders, remotes, and reserved hostnames. Optional replay mode checks the user's recent recorded tool calls against the same rules to count prompts and blocks.

The skill runs locally with Python and the standard library, and makes no network calls. It reads Codex config and Gemini CLI policy files, which need Python 3.11 or newer. The output lists each miss with a suggested deny rule or hook check, along with configuration problems such as hooks that exit with the wrong code.

When your agent uses it

Guardrail tester that checks whether the permission rules and PreToolUse hooks already set up in Claude Code, Codex, Gemini CLI, OpenCode, or Cursor stop a battery of dangerous commands, including wrapped, reordered, and full-path forms that slip past prefix rules, and measures prompt friction on the latest tool calls. Use when the user asks whether deny rules or hooks block force pushes, rm -rf, secret reads, or downloads piped into a shell; wants to test or audit guardrails, or find a bypass in permission settings or exec policy; asks how many prompts or blocks the rules cause; or just installed a guard hook and wants proof it holds. Local only, no network; executes the user's own hook commands only with their yes.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 13 files (388 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the harness-skills plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add RyanAlberts/best-of-Agent-Harnesses
/plugin install harness-skills@agent-harnesses

Or copy only this skill to ~/.claude/skills/guardrail-tester:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/RyanAlberts/best-of-Agent-Harnesses.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/guardrail-tester &&
cp -R "$tmp/skills/guardrail-tester" ~/.claude/skills/guardrail-tester &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/guardrail-tester inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/guardrail-tester to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/RyanAlberts/best-of-Agent-Harnesses.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/guardrail-tester &&
cp -R "$tmp/skills/guardrail-tester" ~/.agents/skills/guardrail-tester &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/guardrail-tester inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/guardrail-tester to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/RyanAlberts/best-of-Agent-Harnesses.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/guardrail-tester &&
cp -R "$tmp/skills/guardrail-tester" ~/.cursor/skills/guardrail-tester &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/guardrail-tester inside it instead.

Cursor docs on skills

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

gemini skills install https://github.com/RyanAlberts/best-of-Agent-Harnesses.git --path skills/guardrail-tester

Or copy the folder to ~/.gemini/skills/guardrail-tester yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/guardrail-tester:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/RyanAlberts/best-of-Agent-Harnesses.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/guardrail-tester &&
cp -R "$tmp/skills/guardrail-tester" ~/.copilot/skills/guardrail-tester &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/guardrail-tester inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/RyanAlberts/best-of-Agent-Harnesses.git

Then copy best-of-Agent-Harnesses/skills/guardrail-tester into your agent's skills folder as guardrail-tester. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Dangerous command battery
About 90 test cases covering force pushes, recursive deletes, secret reads, and downloads piped into a shell.
Rule simulation per harness
Simulates the matching rules of Claude Code, Codex, Gemini CLI, OpenCode, and Cursor against each case.
Hook testing with consent
Runs the user's own PreToolUse hook commands on test input only after explicit approval.
Miss list with fixes
Lists every case that gets through, worst first, with a tested deny rule or hook check where one exists.
Replay of recent calls
Counts how often real recorded tool calls would trigger a prompt or a block under the current rules.
Configuration problem checks
Flags issues such as hooks without timeouts, unused matchers, or bypass modes left available.

Good for

  • Check whether my deny rules block force pushes and rm -rf
  • Audit my Claude Code permission settings for bypasses
  • Test the guard hook I just installed before trusting it
  • Count how many prompts my current permission rules cause
  • Find secret-reading commands my settings miss

Guardrail tester FAQ

Does Guardrail tester run the dangerous commands it tests?

No. The battery commands are only text sent as JSON to hooks. They are written to do nothing if run, and hooks run only after the user says yes.

Does Guardrail tester need a network connection?

No. It makes no network calls and works offline, reading settings, hook scripts, and optionally local session transcripts.

Which harnesses does Guardrail tester cover?

Claude Code, Codex, Gemini CLI, OpenCode, and Cursor. Support for each varies, and OpenCode is noted as not verified on a real install.

What does Guardrail tester change in my setup?

It does not edit anything by itself. Any settings or hook change is drafted as a diff and applied only after the user gives a clear yes.

What Python version is required?

Python 3.9 or newer for the core tests. Reading Codex config.toml and Gemini CLI policy files needs Python 3.11 or newer.

How do I install Guardrail tester in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/guardrail-tester to use it in all your projects, or to .claude/skills/guardrail-tester in one project. Or install the harness-skills plugin, which includes it: /plugin marketplace add RyanAlberts/best-of-Agent-Harnesses, then /plugin install harness-skills@agent-harnesses.

Does Guardrail tester run scripts?

Yes. It runs Python scripts. Its scripts contain network calls. 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 Guardrail tester?

Claude Code, Codex, Cursor and Gemini CLI. 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 Guardrail tester?

The closest alternatives to Guardrail tester are Rules to guards, Speclock guardrails, Sandbox check, Safe execution edho ferdian and Security.

Where this comes from

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

More from RyanAlberts/best-of-Agent-Harnesses

  1. Shows which instruction files each coding agent loads and whether documented commands

    • Open source
    • 1.7K GitHub stars
    • Developer tools
  2. Audits an agent's claims that tests or builds passed against its session transcripts

    • Open source
    • 1.7K GitHub stars
    • Developer tools
  3. Benchmarks Claude Code, Codex and Gemini CLI on tasks from your own git history

    • Open source
    • 1.7K GitHub stars
    • Developer tools
  4. Finds the Claude Code or Codex update where your agent's behavior started to change

    • Open source
    • 1.7K GitHub stars
    • Developer tools
  5. Finds the rules your coding agent keeps breaking and turns them into blocking hooks

    • Open source
    • 1.7K GitHub stars
    • Developer tools
  6. Halts a Claude Code or Codex session on loops, failure streaks or a spend cap

    • Open source
    • 1.7K GitHub stars
    • Developer tools