secrets-hygiene
Skill1 starsChanged 39 days agoMITView on GitHub
Keeping credentials out of files, stores and repositories — redacting at write time, scanning before committing, and handling a leak that already happened. Use before committing or publishing anything, before storing prompt or conversation text, when initialising a repo, and whenever a tool persists user input to disk.
6 other projects use a version of this.
Adopted by
Most recently taken up by
- aymardkouakou/claude-gh-skillstheir own version, first seen Nov 8, 2026
- magia187/premium-agent-skillstheir own version, first seen Oct 20, 2026
- chadixearth/graphylooptheir own version, first seen Oct 13, 2026
- novahiz/novahiztheir own version, first seen Oct 11, 2026
- SkillMedev/security-compliance-hardeningtheir own version, first seen Oct 5, 2026
- BUTTERGANG/CLAUDE-SKILLStheir own version, first seen Jul 30, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- chadixearth/graphyloop★ 3same name
- aymardkouakou/claude-gh-skills★ 1same name
- novahiz/novahiz★ 1same name
- BUTTERGANG/CLAUDE-SKILLS★ 0same name
- magia187/premium-agent-skills★ 0same name
- SkillMedev/security-compliance-hardening★ 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 repository6 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- debug-systematicallySkill
- ralph-loopSkill
- safe-operationsSkill
- token-harnessSkill
- verify-before-claimingSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 41
After redacting the text field, secrets were still on disk — in _terms, a tokenized search index built from the text *before* redaction and …
- Distinctive: line 56
Check what is actually staged.
- Distinctive: line 66
If it ever reached a public remote, treat it as fully public regardless of how briefly it was up.
“Common” is measured: kept by at least 6 in 10 of the 6 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
Secrets Hygiene
Redact at write time, not before commit
Anything built from prompts or conversation text will eventually contain a live credential, because people paste keys into chat. Scrubbing at commit time is too late — by then it has been synced, backed up or shared.
A memory store here was seeded from real transcripts and picked up seven records
containing Razorpay keys, an Anthropic key, a Gemini key, Meta tokens and a
Postgres URL. The fix was redaction inside add(), so a secret never reaches
disk at all.
const SECRET_PATTERNS = [
/\bsk-ant-[A-Za-z0-9_-]{16,}/g,
/\brzp_(?:test|live)_[A-Za-z0-9]{10,}/g,
/\bAIza[A-Za-z0-9_-]{20,}/g,
/\bgh[pousr]_[A-Za-z0-9]{20,}/g,
/\bEAA[A-Za-z0-9_-]{20,}/g,
/\b(?:postgres(?:ql)?|mysql|mongodb(?:\+srv)?):\/\/[^\s:@]+:[^\s@]+@\S+/gi,
/\b(?:api[_-]?key|secret|token|password)\s*[:=]\s*["']?[A-Za-z0-9_\-./+]{12,}["']?/gi,
/\bBearer\s+[A-Za-z0-9._-]{20,}/g,
];Redact rather than reject — the record keeps its value, the secret does not survive.
Get the character classes right. The first version used [A-Za-z0-9] and
missed every Meta token, because those contain _ and -. A pattern that
half-matches gives false confidence.
Derived data leaks too
After redacting the text field, secrets were still on disk — in _terms, a
tokenized search index built from the text before redaction and then
serialized alongside it.
Any cache, index, embedding or log derived from sensitive input inherits the sensitivity. The fix was to stop persisting derived state at all: it is rebuildable, it bloated the file, and it leaked. The store shrank 54KB to 35KB as a side effect.
Before a repo goes public
git initin the project, not a parent. Checkgit rev-parse --show-toplevel— a project inside a home-directory repo will publish far more than intended.- Grep the staged set for credential shapes before the first commit.
- Gitignore user data by default: memory stores, logs, local settings,
*.bak. - Check what is actually staged. 329 files here turned out to include 246 files of another tool's generated content.
If a secret was already committed
Deleting the file is not enough — git history keeps it. Assume it is compromised:
- Rotate the key first. Cleaning history without rotating protects nothing.
- Then purge with
git filter-repoor BFG, and force-push with the team warned. - If it ever reached a public remote, treat it as fully public regardless of how briefly it was up.
Never put secrets in these
URLs and query strings, log lines, error messages, commit messages, or anything sent to a third-party service — including diagram renderers and pastebins.
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.

