secret-audit
Skill3 starsChanged 58 days agoMITView on GitHub
Use when the user asks whether secrets were committed, before open-sourcing a repo, or after a leak scare. Scans the working tree and full git history for credentials, reports findings with commit and path, and gives a remediation plan (rotate first, then purge).
- Reads credentials
In this repository7 other files it gives its agents.
- changelogSkill
- claude-md-initSkill
- commit-messageSkill
- dependency-auditSkill
- pr-descriptionSkill
- readme-refreshSkill
- test-gap-finderSkill
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
- could be automatic: a setting could enforce it
- Very specific: line 15
Remove from HEAD: move to env/.env (gitignored), commit.
- Very specific: line 17
Add prevention: .gitignore entries, pre-commit hook (gitleaks git --pre-commit --staged ..
- Distinctive: line 19
Before sending the final message, re-read the whole reply (summary, table, notes, checklist) and mask every key-shaped string that is still …
- Distinctive: line 22
Never rewrite history or force-push in this skill.
- Distinctive: line 23
Never paste unmasked secrets into the transcript.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
secret-audit
Procedure
- Tooling: prefer
gitleaks git --report-format json --report-path /tmp/gitleaks.json .ifcommand -v gitleakssucceeds (detectis deprecated since gitleaks 8.19; on an older gitleaks usegitleaks detect --source .); elsetrufflehog git file://. --json; else fall back to grep overgit log -p --allwith the pattern set below. - Fallback pattern set (grep -E):
AKIA[0-9A-Z]{16},sk-(live|test|proj|ant)-[A-Za-z0-9_-]{16,},gh[pousr]_[A-Za-z0-9]{30,},xox[abpr]-,-----BEGIN [A-Z ]*PRIVATE KEY-----,eyJ[A-Za-z0-9_-]{20,}\.eyJ,(?i)(password|passwd|secret|token|api[_-]?key)\s*[:=]\s*["'][^"']{12,}["'], plus.env,*.pem,*.p12,id_rsafilenames in history:git log --all --diff-filter=A --name-only --format='' | grep -E '(^|/)(\.env|.*\.pem|.*\.p12|id_rsa)$'. - Deduplicate; for each finding record
path | first commit (sha, date, author) | still in HEAD? | type. - Classify: live in HEAD (critical), only in history (high), example/test/false positive (note, no action).
- Remediation plan, in this order, as a checklist for the user:
- Rotate every credential found (it is compromised once committed, even if purged).
- Remove from HEAD: move to env/
.env(gitignored), commit. - Purge history only if the repo is/will be public or shared:
git filter-repo --path <file> --invert-pathsor--replace-text, then force-push with--force-with-leaseand tell collaborators to re-clone. Do not run this without explicit approval. - Add prevention:
.gitignoreentries, pre-commit hook (gitleaks git --pre-commit --staged .;protect --stagedon gitleaks older than 8.19), and this plugin'ssecret-scanhook.
- Print the findings table and the checklist. Never print full secret values; mask to first 4 + last 2 chars. That includes notes: when a value matches a known placeholder (the AWS docs example key, a vendor's sample token), say so by name and keep the masked form, never the full string.
- Before sending the final message, re-read the whole reply (summary, table, notes, checklist) and mask every key-shaped string that is still in full: first 4 + last 2 chars, placeholders and documentation examples included. Send only after this pass finds nothing.
Rules
- Never rewrite history or force-push in this skill; propose only.
- Never paste unmasked secrets into the transcript.
Verify
Maintainers: bash evals/run.sh /tmp/skillkeel-evals secret-audit from the plugin root runs this case and grades it; records and transcripts sit in evals/secret-audit/.
evals/secret-audit/: fixture repo where a .env with a fake AWS key was committed then deleted two commits later; expected: finding reported as "only in history" with the introducing sha, value masked, rotate-first plan, no history rewrite executed.
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.

