agentleFS
ibrahimkobeissyibrahimkobeissy/harneo/.claude/skills/security-guardrails/SKILL.md

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

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. ibrahimkobeissy/oc-lens★ 4same name
    2. CsHeng/agent-skills★ 3same name
    3. 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.

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
  1. Very specific:

    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 …

    line 49
  2. Very specific:

    Run after any change to guard.py or settings.json:

    line 60
  3. Very specific:

    Run it, then commit again.

    line 80

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Security Guardrails

Three layers stop an agent from reading secrets, leaking them, or destroying work. Each covers a gap the others leave.

LayerWhereWhat it does
Deny rulespermissions.deny in .claude/settings.jsonBlock 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.mdThe 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.example and 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.log

Self-test

Run after any change to guard.py or settings.json:

python3 .claude/skills/security-guardrails/scripts/selftest.py

It 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.sh

Run 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.