guardrails
Skill0 starsChanged 50 days agoUnlicenseView on GitHub
Deterministic action gates for coding agents: block destructive commands before they run (rm -rf, force-push, reset --hard, DB drops, secret reads), auto-format after every edit, and set a permission floor (deny-list + OS sandbox). One hook script serves Claude Code and Hermes. Use when setting up a new project or machine, before enabling autonomous/auto-approve modes, or when an agent has run something irreversible.
- Pipes a download into a shell
- Reads credentials
- Deletes or force-pushes
- Commits and pushes
15 other projects use a version of this.
Adopted by
Most recently taken up by
- the-inconvenience-store/skillstheir own version, first seen Nov 6, 2026
- meyverick/agentictheir own version, first seen Oct 30, 2026
- meaningfy-ws/skillerytheir own version, first seen Oct 27, 2026
- antrafa/skillstheir own version, first seen Oct 20, 2026
- irahardianto/awesome-agvtheir own version, first seen Oct 14, 2026
- adewale/guardrails-skilltheir own version, first seen Oct 13, 2026
Used with
Projects with it also use evaluation, prototype and 2 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
NVIDIASkillevaluation
Evaluates accuracy of quantized or unquantized LLMs using NeMo Evaluator Launcher (NEL). Triggers on "evaluate model", "benchmark accuracy", "run MMLU", "evaluate quantized model", "run nel". Handles deployment, config generation, and evaluation execution. Always load when validating completed runs or reporting evaluation scores, including standalone launching-evals analysis. Not for quantizing models (use ptq), standalone serving (use deployment), or comparing completed baseline-vs-quantized results (use compare-results).
Also in 3 projects that use this
GoogleSkillprototype
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
Also in 3 projects that use this
GoogleSkillgrill-me
A relentless interview to sharpen a plan or design.
Also in 4 projects that use this
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 3 projects that use this
Other versions15 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 15
- ai-analyst-lab/ai-analyst★ 304same name
- irahardianto/awesome-agv★ 157same name
- googlicius/obsidian-steward★ 85same name
- bolasblack/claude-skills★ 4same name
- hajekim/agentic-design-patterns-skills★ 4same name
- dfrysinger/skills★ 3same name
- adewale/guardrails-skill★ 2same name
- Citadel-Cloud-Management/citadel-saas-factory★ 2same name
- meaningfy-ws/skillery★ 2same name
- antrafa/skills★ 1same name
5 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- skill-starter-kitSkill
- browser-verifySkill
- cloud-clisSkill
- consistencySkill
- docs-freshnessSkill
- github-mcpSkill
- lsp-pluginsSkill
- security-gateSkill
- taste-codeSkill
- verify-gateSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 104
Ask the agent to rm -rf node_modules ../other-repo — it is blocked and reports the reason.
- Distinctive: line 105
Write a badly formatted file through the agent → it is formatted on disk after the edit.
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Guardrails: Gate the Action, Not the Prose
The kit gates completion (verify-gate) and code content (security-gate). Nothing gated
actions — the command about to run. An agent that passes every test can still
git push --force, rm -rf the wrong directory, or curl your .env to a pastebin. The fix
is not a rule in a markdown file (dropped as context fills); it is a hook the harness runs
before the tool executes, and an OS sandbox under it.
Scope: what the agent is allowed to do. Not what its code contains (security-gate), not
whether the work is done (verify-gate). Zero always-on context: hooks and settings, no prose.
Three layers
| Layer | Claude Code | Hermes | Closes |
| 1. Destructive-command block | PreToolUse hook on Bash; exit 2 = block | hooks.pre_tool_call, matcher terminal, fail_closed: true; same JSON + exit-2 contract | irreversible actions |
| 2. Format on edit | PostToolUse on Edit|Write | hooks.post_tool_call, matcher write_file|patch | taste-code rules 8 & 10 (unused imports, formatting) — mechanized, no longer prose |
| 3. Permission floor | permissions.deny + sandbox.enabled | built-in dangerous-command approval; Docker/egress isolation for autonomous runs | exfiltration leg of the "lethal trifecta" |
Layer 3 is the enforcement; layers 1–2 are the belt. Deny rules have a documented history of
silent misses (grep -r/cp -r reading a denied path), so never rely on deny rules alone
— enable the sandbox and set failIfUnavailable: true so a missing sandbox is a hard stop,
not a warning.
Install (per project — the templates are in this skill)
# from the kit checkout; init-project.sh does all of this for you
mkdir -p .claude/hooks
cp <kit>/skills/guardrails/templates/guard.sh .claude/hooks/guard.sh
cp <kit>/skills/guardrails/templates/format.sh .claude/hooks/format.sh
chmod +x .claude/hooks/*.shClaude Code — merge templates/claude-settings.json into .claude/settings.json (commit it;
settings.local.json is for personal overrides). It wires guard.sh (PreToolUse), format.sh
(PostToolUse), the verify Stop hook from verify-gate, the deny-list, and the sandbox.
Hermes — templates/hermes-hooks.yaml shows the hooks: block. Apply with
hermes config set (never hand-edit config.yaml), or copy the scripts to
~/.hermes/agent-hooks/. Hermes prompts for consent on first use of each (event, command)
pair; that is expected.
The block list (guard.sh)
Blocks, with the reason returned to the agent so it can choose a safe alternative:
rm -rfon/,~,.,*, or a path outside the repo ·git push --force*/-fto a protected branch ·git reset --hard·git clean -fd*·git checkout -- ./git restore .(unstaged work loss) ·git branch -D·DROP TABLE|DATABASE,TRUNCATE·chmod -R 777·curl|wget … | sh·sudo· reads of.env*,~/.ssh,~/.aws,~/.config/gh(cat/less/head/grep/cp) ·npm publish,--no-verify(defeatssecurity-gate's gitleaks step)
It is a plain bash script with one case block. Add your stack's irreversibles (prod
deploy commands, migration down, terraform destroy). Keep it under 100 lines — a
guardrail nobody reads is a guardrail nobody trusts.
Escape hatch: the human runs the command in their own shell. The agent never gets a bypass flag; if it needs one, the block was correct.
Format on edit (format.sh)
Detects the formatter by lockfile/config present — biome → prettier → ruff → gofmt →
rustfmt — and runs it on the one file just written. This is taste-code rule 10 ("match the
surrounding file's conventions") made deterministic, and with ruff --fix / biome check
--write, rule 8 (unused imports) too. The agent's in-context copy of the file is not
re-read automatically; the next read picks up the formatted version.
Permission floor
Claude Code (templates/claude-settings.json):
"permissions": { "deny": [
"Read(./.env)", "Read(./.env.*)", "Read(~/.ssh/**)", "Read(~/.aws/**)", "Read(~/.config/gh/**)",
"Bash(curl *)", "Bash(wget *)", "Bash(git push --force*)", "Bash(rm -rf *)",
"Bash(npm publish*)", "Bash(sudo *)"
]},
"sandbox": { "enabled": true, "failIfUnavailable": true }--dangerously-skip-permissions / hooks_auto_accept only inside a container or VM that holds
no real credentials. Effective sandboxing needs both filesystem and network isolation.
Hermes: dangerous-command approval is on by default — keep it. For unattended runs use the Docker backend with network egress isolation (Hermes docs: Network Egress Isolation).
Works with →
verify-gate— the Stop hook lives in the samesettings.json;guard.shblocks--no-verifyso the gate cannot be skipped.security-gate— guardrails stop the action (reading a secret, skipping gitleaks); security-gate inspects the content (a secret in the diff). Both, not either.taste-code—format.shis rules 8 and 10 in mechanical form; the prose rules that remain are the judgement ones.github-mcp— same principle at the API layer: read-only + lockdown + explicit toolsets.
Verification
echo '{"tool_name":"Bash","tool_input":{"command":"git push --force origin main"}}' | .claude/hooks/guard.sh; echo $?→ prints a reason on stderr, exits 2.- Same with
"command":"git status"→ exits 0, empty stdout. - Ask the agent to
rm -rf node_modules ../other-repo— it is blocked and reports the reason. - Write a badly formatted file through the agent → it is formatted on disk after the edit.
/sandboxin Claude Code shows enabled; acurlto an unapproved host prompts or fails.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

