agentleFS
trac3r00trac3r00/agent-skills/skills/secret-gate/SKILL.md

secret-gate

Skill0 starsChanged 3 months agoMITView on GitHub

Blocks credentials from entering code, diffs, or agent output. Scans files or a unified diff for known key formats (AWS, GitHub, OpenAI/Anthropic-style, Slack, GCP, private keys, JWTs, assigned passwords) plus high-entropy assigned strings — offline, stdlib-only, no gitleaks binary. Use as a pre-commit gate on agent-written diffs, before pasting config into a session, or in CI.

  • Reads credentials

The file

Files
SKILL.md

Secret Gate

An agent with your .env in context will eventually write it somewhere it should not go. This gate catches the leak before it lands.

Commands

python3 scripts/secret_gate.py src/ config.py          # scan files/dirs
git diff | python3 scripts/secret_gate.py --diff       # only added lines
git diff --cached | python3 scripts/secret_gate.py --diff   # pre-commit
python3 scripts/secret_gate.py --diff --json < changes.patch
python3 scripts/secret_gate.py --history --repo .      # git-guardian mode: scan commit history
python3 scripts/secret_gate.py --history --repo . --max-commits 500

Exit 1 on any finding — wire it straight into pre-commit or CI.

Detects

  • Structured keys: AWS (AKIA...), GitHub (ghp_/github_pat_), OpenAI/ Anthropic-style (sk-, sk-ant-), Slack (xox?-), GCP (AIza...), Stripe (sk_live_/rk_live_), SendGrid (SG....), npm, PyPI, Discord, basic-auth URIs
  • Private key blocks, JWTs
  • Assigned passwords/secrets: password = "...", api_key: '...'
  • High-entropy strings assigned to secret-shaped names (Shannon entropy > 4.0)

Suppression

  • Inline: append gitleaks:allow, secret-gate:allow, or pragma: allowlist secret to a known-safe line.
  • Placeholder values (example, changeme, <your-key>, ${VAR}) are skipped automatically.
  • --allow REGEX (repeatable) for project-wide allowlists.

Pairs with

comment-checker (same diff-mode contract), skill-audit (scan skills you install, not just code you write).

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.