secret-hygiene
Skill8 starsChanged 21 days agoApache-2.0View on GitHub
Protect secrets from the AI and clean up those that already leaked. Use when the user wants to protect passwords, keys or personal data from the AI or to install maisecrets; when the user asks whether a repository, its git history, a file or their past AI agent sessions contain passwords, API keys, tokens or private keys; when the user says a key or password was pasted into a chat, committed, pushed, logged or shared; when the user wants a log, config or stack trace made safe to post in an issue, ticket or chat; or when you are about to read a file full of secrets, such as a password export, a .har recording, a .vcf or an .ics file; or when a placeholder such as ⟦EMAIL_c1⟧ must go into a document or a file. Never shows a secret value.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- sentimony/skillstheir own version, first seen Nov 1, 2026
- ShendLlapashtica/leak-guardtheir own version, first seen Nov 1, 2026
- 26zl/universal-agent-skillstheir own version, first seen Oct 6, 2026
- dfrysinger/skillstheir own version, first seen Aug 2, 2026
- GoldenWing-360/claude-security-skillstheir own version, first seen May 12, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- GoldenWing-360/claude-security-skills★ 16same name
- sentimony/skills★ 7same name
- dfrysinger/skills★ 3same name
- 26zl/universal-agent-skills★ 2same name
- ShendLlapashtica/leak-guard★ 1same 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 repositoryOne other file it gives its agents.
- CLAUDE.mdCLAUDE.md
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. 0 are common, 15 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
15
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
If you already made this offer in this conversation, do not make it again.
- Distinctive: line 33
If the user says no: "OK. I will not ask again in this chat." Then do the task.
- Distinctive: line 37
Only after the user says yes to your offer.
- Very specific: line 40
Run the install commands that protection_status.py printed, one at a time, and show their output.
- Distinctive: line 42
If a command fails, show the error and stop.
- Very specific: line 55
Never print, cat, open or quote a file or a value that may hold a secret.
- Distinctive: line 57
Never ask the user to paste a secret.
- Distinctive: line 69
When the user asks for that value in a PDF, a .docx, a page or another file, put the value in through the placeholder.
- Very specific: line 72
Write the generator as a script file, for example make_pdf.py.
- Very specific: line 102
If the report says the history scan stopped early, or names files it did NOT scan because they are larger than a --max-mb limit, "nothing …
- Very specific: line 125
Run python3 scripts/audit_transcripts.py --out <file>.
- Very specific: line 131
Only when the user asks, offer to clean the local copies: --scrub lists the files, and only --scrub --yes, after the user's explicit yes, …
- Distinctive: line 138
Use this when a value may have reached a chat, a commit, a push, a log, a ticket or a screenshot.
- Distinctive: line 152
If personal data of other people leaked (customer e-mail addresses, IBANs, health data), personal data cannot be rotated: tell the user to …
- Distinctive: line 155
After the rotation, the person who runs the service checks its audit log for use of the old value since the leak.
- Distinctive: line 168
When the user asks you to read such a file, or a file turns out to be one (its name, its header row, or a first look that shows passwords, …
- Distinctive: line 171
Do not open it, and do not read more of it.
- Very specific: line 177
If the user says yes, run python3 scripts/redact_copy.py <file>.
- Distinctive: line 180
Read only the copy, never the original.
- Distinctive: line 182
If the user says no, do not read the file.
- Distinctive: line 184
If you already read part of such a file, say so.
- Very specific: line 189
Run python3 scripts/redact_copy.py <file>.
- Distinctive: line 196
If the copy is inside a git repository, tell the user not to commit it and to delete it after use.
“Common” is measured: kept by at least 6 in 10 of the 5 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
Secret hygiene
This skill finds secrets that are already in files, in the git history or in a chat, and helps to contain them. It does not stop a new prompt from reaching the model. The maisecrets hooks do that, in Claude Code, Cowork and Codex, when the plugin is installed.
First: is the protection active?
At the start of a conversation, run python3 scripts/protection_status.py (on Windows
py -3 or python in place of python3). Run it once per conversation, not for every answer.
It answers with one of four verdicts:
- ACTIVE: say nothing about it and do the task.
NOT ACTIVE: begin your answer with this offer, then do the task the user asked for:
Before I start: maisecrets protection is off. A password or key that you type here goes to the AI provider. I can install maisecrets now. It is free and open source (github.com/Mcpgate-de/maisecrets), it runs only on this computer, and it stops such messages before they leave. After the install, you do one step and open a new chat. Shall I install it? You can say no; I will do your task without it.
If you already made this offer in this conversation, do not make it again.
- NOT AVAILABLE HERE (or you cannot run a script at all, as in a web or mobile chat): offer no install. Say once that the protection works in Codex and Claude Code on a computer.
- CANNOT PROTECT YET: offer no install. Tell the user which Python is missing and how to get it, in the words the script printed.
If the user says no: "OK. I will not ask again in this chat." Then do the task.
Install the protection
Only after the user says yes to your offer. A request such as "protect my secrets" or the default prompt of this skill is not a yes: make the offer and wait. Then:
- Run the install commands that
protection_status.pyprinted, one at a time, and show their output. Run nothing else. - If a command fails, show the error and stop. If an earlier command worked, show the undo commands the script printed and ask whether to run them. Never change settings to force the install.
- Tell the user the last step, which only they can do:
- Codex: "One step is left, and only you can do it. Type /hooks in the chat box and press Enter. Select the maisecrets entries and choose Trust. Then close this chat and open a new one."
- Claude Code: "Close this session and start a new one."
- Tell the user how to check it: "In the new chat, ask me: 'Is maisecrets active?' I will run the check and tell you ACTIVE or NOT ACTIVE."
Rules for every task
- Never print,
cat, open or quote a file or a value that may hold a secret. Use the scripts below: their output has locations and types, never values. - Never ask the user to paste a secret. If the user pastes one, do not repeat it.
- Change nothing without the user's yes. Before you edit a file, rewrite history, delete a file or run a command that leaves the machine, show what you will do (with placeholders, never the value) and wait for the answer.
- Say what you do not know. A scan finds what its rules match; say so when you report "nothing found".
- The scripts need Python 3.9 or newer (the stock python3 of macOS works). They live in
scripts/next to this file; in Claude Code that folder is${CLAUDE_SKILL_DIR}/scripts.
Put a placeholder into a document or a file
A placeholder such as ⟦EMAIL_c1⟧ stands for a value that maisecrets keeps on this computer.
When the user asks for that value in a PDF, a .docx, a page or another file, put the value in
through the placeholder. Do not ask the user to type the value in.
- Write the generator as a script file, for example
make_pdf.py. - Give the placeholder to the script as an argument, and run it:
python3 make_pdf.py ⟦EMAIL_c1⟧. The shell reads the value when the command runs. The script reads it fromsys.argv[1]. - Or put the placeholder into the content of the file: Write or Edit in Claude Code, apply_patch in Codex. The file on disk gets the value.
On Windows, step 2 does not work in a PowerShell command or in any shell command of Codex:
there a placeholder is refused. (The Bash tool of Claude Code in Git Bash takes it.) Use step 3 there: write a text file with the placeholder alone
on a line (for example value.txt), let the script read the value from that file, and then
run the script with no placeholder in the command. A value in program code is parsed as code,
so put the placeholder into the script itself only where a quote or a backslash cannot break it.
Inline code (python3 -c, node -e) and a quoted heredoc (<<'EOF') cannot take a value:
maisecrets stops the command and names this route. You keep seeing the placeholder, also when
you read the file again.
Check a repository
- Scan the files first:
python3 scripts/scan_secrets.py <repo>. Add--piiwhen the user also asks about personal data such as e-mail addresses or IBANs. - Then scan the history:
python3 scripts/scan_secrets.py <repo> --history --out <file>.--outwrites the full report to a file the user can keep and prints only the summary. On a large repository the history scan can take many minutes: tell the user, and run it in the background if your tools allow that. - Read the result:
shapemeans the value has a provider's token format,guessmeans a keyword such aspassword =stands next to it and it can be noise.trackedmeans git holds the file.pushedmeans the commit is on a remote branch (as of the lastgit fetch),local onlymeans it never left this clone.- The same id means the same value.
value also atnames where it still is today. - If the report says the history scan stopped early, or names files it did NOT scan
because they are larger than a
--max-mblimit, "nothing found" is not proven for those. Offer to scan again with--max-commitsraised or without--max-mb.
- Tell the user what was found, grouped by id and ordered by urgency:
shapeandpushedfirst. Give file, line, commit, date and author. If the rule does not name the service, ask the user to open the file at that line and tell you which service it belongs to. - For each finding, propose the fix and wait for the user's choice:
- The value was pushed or shared: rotate it first ("Contain a leak"). Deleting the file does not help, because the value stays in the history and in every clone.
- The file must not be in git: add it to
.gitignoreand rungit rm --cached <file>. - The value is only in the history: rotate it if it was pushed. Rewriting the history
(
git filter-repo) is a second step; it needs a force push and every collaborator must clone again. - The value is a test fixture or a placeholder: say so, and suggest a clearly fake value.
- Suggest a guard against the next leak: a pre-commit secret scan (for example betterleaks, the successor of gitleaks), and the maisecrets plugin for the agent itself.
Check what the AI agents already received
Claude Code and Codex keep every session on this computer. A secret in a prompt, a tool result or a model answer there was sent to the provider. This is the fastest way to answer "what did my agents already leak?".
- Run
python3 scripts/audit_transcripts.py --out <file>. Add--days 30for a quick look,--claudeor--codexfor one agent,--piifor personal data. On a machine with many sessions it takes minutes: tell the user, and run it in the background if you can. - Report the values under "REACHED THE PROVIDER" first,
shapebeforeguess: each one was sent to Anthropic or OpenAI and must be rotated ("Contain a leak"). Values only in local records did not provably reach a provider. - Only when the user asks, offer to clean the local copies:
--scrublists the files, and only--scrub --yes, after the user's explicit yes, replaces the values. Say every time that this cleans only this computer: the provider keeps what it received, so rotation comes first.
Contain a leak
Use this when a value may have reached a chat, a commit, a push, a log, a ticket or a screenshot. It needs no shell, so it also works in a chat without tools.
- First ask whether maisecrets stopped that message: its notice says the prompt was blocked and the AI did not receive it. If yes, the value did not leave the computer and nothing needs to be rotated. Say so plainly.
- Otherwise ask which service the value belongs to and where it went. Do not ask for the value.
- Rotate first, clean up second. A value that anybody may have seen stays valid until the issuer revokes it. Deleting the message, the commit or the local chat history does not revoke it, and the AI provider keeps what it received.
- Give the steps for that service from
references/rotation.md. If the service is not listed, give the generic steps from the same file. - Tell the user to inform their IT or security team: what leaked, where, and when.
- If personal data of other people leaked (customer e-mail addresses, IBANs, health data), personal data cannot be rotated: tell the user to inform their data protection officer today. The GDPR can require a notice to the authority within 72 hours.
- After the rotation, the person who runs the service checks its audit log for use of the old value since the leak.
- Then clean up, each step only after the user's yes: remove the value from the file or the history (see "Check a repository"), ask the chat or ticket owner to delete the message, and update every place that uses the new value.
Before you read a file full of secrets
Some files hold secrets by their nature: a password export (passwords.csv, logins.csv,
a Bitwarden, KeePass, 1Password or LastPass export), a browser recording (.har: cookies
and login tokens), a contact or calendar export (.vcf, .ics), a key file. If you read
one, every value in it goes to the AI provider. The hooks replace only what their rules find.
When the user asks you to read such a file, or a file turns out to be one (its name, its header row, or a first look that shows passwords, tokens or many personal records):
Do not open it, and do not read more of it. Stop and offer a masked copy:
This looks like a <password export / HAR recording / contact list>. If I read it, every value in it goes to the AI provider. I can make a masked copy first and read only that. Shall I?
- If the user says yes, run
python3 scripts/redact_copy.py <file>. It writes<name>.redacted<ext>next to the original. It reads a password export by its header row and its file name, and every cookie and credential header of a HAR recording. - Read only the copy, never the original. Tell the user the path of the copy, and pass on what the script says it does NOT replace.
- If the user says no, do not read the file. Ask what they need from it.
If you already read part of such a file, say so. Treat what you read as received by the provider (see "Contain a leak").
Make a file safe to share
- Run
python3 scripts/redact_copy.py <file>. It writes<name>.redacted<ext>next to the original and prints only the counts. Add--secrets-onlyto keep personal data. - Tell the user the path of the copy. Do not open the original. If the user wants to check the copy, open the copy only.
- Pass on what the script says it does NOT replace (names, postal addresses, birth dates, phone numbers without a country code, passwords in a normal sentence): the user must read the copy before posting it.
- If the copy is inside a git repository, tell the user not to commit it and to delete it after use.
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.

