no-exposed-secrets
Skill0 starsChanged 4 months agoMITView on GitHub
Safety gate that scans code, config, and diffs for exposed secrets — API keys, tokens, passwords, private keys, cloud credentials, and .env leaks — before a commit, pull request, or publish. Use whenever the user is about to commit or push, asks to review or check code for secrets/credentials, is wiring up a new integration or API key, or wants a pre-publish safety check. Deterministic scanner + guided remediation.
- Reads credentials
In this repositoryOne other file it gives its agents.
- naming-conventionsSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Before any commit or push (act as the gate).
- Very specific: line 19
When the user pastes or writes code that touches API keys, tokens, DB URLs, or .env.
- Distinctive: line 20
When asked to "review this for secrets", "is this safe to commit", or similar.
- Distinctive: line 24
Run the bundled scanner over the target (a path, or staged git changes):
- Very specific: line 39
Add the offending file to .gitignore if it's a local config (.env, *.pem).
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
No-Exposed-Secrets
A pre-commit / pre-publish safety gate. Its one job: make sure no secret ever lands in the repo.
When to use
- Before any commit or push (act as the gate).
- When the user pastes or writes code that touches API keys, tokens, DB URLs, or
.env. - When asked to "review this for secrets", "is this safe to commit", or similar.
- As a CI check.
How to run it
- Run the bundled scanner over the target (a path, or staged git changes):
python scan_secrets.py <path> # scan a file or directory python scan_secrets.py --staged # scan only git-staged changes - Exit code
0= clean. Exit code1= secrets found (block the action). - The scanner prints each finding as
severity | file:line | type | redacted snippet.
How to respond to findings
For each finding:
- Confirm it's a real secret (not a placeholder like
YOUR_API_KEYor a test fixture). - Do NOT print the secret value back — reference it by file:line and type only.
- Remediate, in this order:
- Move the value to an environment variable or a secrets manager (AWS Secrets Manager, SSM, Vault, 1Password, etc.).
- Replace the hardcoded value in code with a reference (
os.environ[...], config lookup). - Add the offending file to
.gitignoreif it's a local config (.env,*.pem). - Rotate any secret that was already committed — assume it's compromised.
- Re-run the scanner to confirm the gate passes.
Suppressing false positives
Append # pragma: allowlist secret to a line to intentionally ignore it (use sparingly,
e.g. documented test fixtures). The scanner honors this marker.
What it detects
AWS access/secret keys, GCP/Google API keys, GitHub/GitLab/Slack/Stripe tokens,
JWTs, private keys (RSA/EC/OpenSSH/PGP), generic KEY=secret assignments,
connection strings with inline credentials, and high-entropy strings. See
scan_secrets.py for the full pattern set.
Install
Drop this folder into your Claude skills directory (e.g. ~/.claude/skills/no-exposed-secrets/)
or a Claude Code plugin's skills/. Claude loads it automatically when the description matches.
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.

