security-guardrails
Skill4 starsChanged 13 days agoMITView on GitHub
Explains and maintains this project's security guardrails: the deny rules and the guard.py hook that stop agents from reading credentials and secrets, leaking tokens through gh, or destroying git work. Use when a command was blocked or asked for approval by security-guardrails, when the user asks why something is blocked or wants an exception, wants to review guard.log, run the self-test, or install the gitleaks pre-commit hook.
- Reads credentials
3 other projects use a version of this.
Adopted by
Most recently taken up by
- CsHeng/agent-skillstheir own version, first seen Nov 9, 2026
- ibrahimkobeissy/oc-lenstheir own version, first seen Nov 8, 2026
- leo-kraus/security-guardrailstheir own version, first seen Oct 13, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- ibrahimkobeissy/oc-lens★ 4same name
- CsHeng/agent-skills★ 3same name
- leo-kraus/security-guardrails★ 0same name
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 repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- ticket-flowSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 49
Every deny and ask is one JSON line in .claude/hooks/guard.log (kept out of git by .claude/hooks/.gitignore, which the hook creates), with …
- Very specific: line 60
Run after any change to guard.py or settings.json:
- Very specific: line 80
Run it, then commit again.
“Common” is measured: kept by at least 6 in 10 of the 3 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
Security Guardrails
Three layers stop an agent from reading secrets, leaking them, or destroying work. Each covers a gap the others leave.
| Layer | Where | What it does |
| Deny rules | permissions.deny in .claude/settings.json | Block Claude's own Read/Edit/Write tools on secret paths |
| Guard hook | .claude/hooks/guard.py (PreToolUse) | Checks every tool call: secret paths, token leaks (gh auth token, printenv), gh misuse, destructive git, edits that weaken the guardrails, and the first commit without gitleaks. Answers deny or ask |
| Rules | .claude/rules/security-guardrails.md | The same policy in prose, for agents that ignore Claude settings |
Limits, said plainly. There is no OS-level sandbox. The guard reads command text, so a determined agent can disguise a shell command (an interpreter that builds a path at runtime, an encoded string) and nothing at the OS level stops it: shell commands can read anything your user can, write anywhere, and reach any host. The deny rules cover only Claude's own file tools. Plugin hooks and MCP servers are not checked at all (review them before installing). Shell commands still go through the normal permission prompts.
When something is blocked
- "Blocked by security-guardrails: ..." means guard.py denied it. Don't try another way to do the same thing. If the user really needs it, they do it themselves.
- "security-guardrails: ..." with an approval prompt means guard.py asked: the user decides.
Exceptions (always with the user's approval)
.env.exampleand similar templates are blocked like.env. The user can create or show them.
guard.py asks before any edit that weakens settings.json (removing a deny rule
or the hook, disableAllHooks, re-enabling bypass mode).
guard.log
Every deny and ask is one JSON line in .claude/hooks/guard.log (kept out of git
by .claude/hooks/.gitignore, which the hook creates),
with the time, decision, tool, reason and the first 200 characters of the
command. Read it to spot false positives:
tail -n 20 .claude/hooks/guard.logSelf-test
Run after any change to guard.py or settings.json:
python3 .claude/skills/security-guardrails/scripts/selftest.pyIt feeds real events through the hook (deny, ask and allowed cases), tests the settings-weakening check and the gitleaks flow in temp folders, and checks that a crash blocks.
gitleaks
gitleaks scans what is about to be committed and refuses the commit if it finds
a secret. The first git commit in a repo without the hook is denied by
guard.py with the command to run:
bash .claude/skills/security-guardrails/scripts/install-gitleaks-hook.shRun it, then commit again. It keeps any existing pre-commit hook (and puts the
scan in pre-commit-user when GitButler manages the hook). If gitleaks isn't
installed on the machine, commits are not blocked; the hook only warns.
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.

