/maisecrets:secret-hygienefrom maisecrets
Detects leaked secrets in repositories, git history, and past AI sessions. Helps contain exposed passwords, API keys, and personal data. Masks sensitive files for safe sharing.
Ships in maisecrets. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
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.
When the user asks what you can do, or asks in general to check for leaked secrets, offer these four options, one line each, in this order (the urgent one first), in the user's words:
Offer the install ("Protect my secrets: install maisecrets, so a typed password or key no longer reaches the AI,
2 minutes") as a fifth line only when protection_status.py says NOT ACTIVE.
Run only the task the user chose. After that task reports its result, you can offer one other check, in one line. The protection check below is not a side check: it says whether this chat is protected. Before the chosen task, say only its verdict or its offer, and no other result.
When a scan runs in the background, your message says only what runs, the estimate, and that you report when it ends. Write nothing that reads like a result or an end, such as "found nothing" or "done".
When the scan ends, the first line of your answer is the result of the task the user chose.
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.
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:
protection_status.py printed, one at a time, and show their
output. Run nothing else.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.scripts/ next to this file; in
Claude Code that folder is ${CLAUDE_SKILL_DIR}/scripts.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.
make_pdf.py.python3 make_pdf.py ⟦EMAIL_c1⟧.
The shell reads the value when the command runs. The script reads it from sys.argv[1].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.
python3 scripts/scan_secrets.py <repo> > <files-file> 2>&1.
Add --pii when the user also asks about personal data such as e-mail addresses or IBANs.
Do not read that file yet.python3 scripts/scan_secrets.py <repo> --history --out <file>.
--out writes 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. While it runs, say only that the scan runs and
its estimate. When the history scan ends, read both files and report the files and the
history in one answer.shape means the value has a provider's token format, guess means a keyword such as
password = stands next to it and it can be noise.tracked means git holds the file. pushed means the commit is on a remote branch
(as of the last git fetch), local only means it never left this clone.value also at names where it still is today.--max-mb limit, "nothing found" is not proven for those.
Offer to scan again with --max-commits raised or without --max-mb.shape and pushed
first. 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..gitignore and run git rm --cached <file>.git filter-repo) is a second step; it needs a force push and every collaborator must
clone again.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?".
python3 scripts/audit_transcripts.py --estimate (the last 30 days; add --all for all). It prints the size
and the estimated time on stderr; it scans a sample of files for 15 seconds at the speed of this computer
(if it says that other work slows the scan, say so too). The estimate is no result: it shows no finding. Tell
the user the estimate before the scan, for example "about 12 minutes for 4.2 GB", and run the scan in the
background if it is longer than a few minutes. While it runs, say only: "The scan of your AI history runs (about
). I report when it ends." Start no other check; the approvals of step 5 are part of this task.python3 scripts/audit_transcripts.py --out <file> (add --all for all sessions). Add
--claude or --codex for one agent, --pii for personal data. It uses the cores minus one (--workers N to
change it), and it prints its progress at least every 30 seconds and its time at the end.
ghp_) or a
label that a value can follow (such as password: or --token). It can miss a value whose label stands more
than three lines away from it, and a weak shape that needs a word farther away. --full reads each record as
one text, as before, with every rule: it is slower, and the user can ask for it after a fast scan. Neither scan finds a random value
with no label and no prefix.references/rotation.md, and wait until the
person says it is done or skips it.--scrub (with the same --all, --claude or --codex as the scan). It lists
the files. Then ask for an explicit yes, and only then run --scrub --yes. Say every time that this cleans
only this computer: the provider keeps what it received, so rotation comes first.python3 scripts/audit_approvals.py --out <file> > <summary-file> 2>&1. Do not read either file until the
scan ends. Then report the approvals in the same answer as the scan, after the scan's summary and before the
choices, in one or two lines. When the user
asks only for the approvals, run python3 scripts/audit_approvals.py --out <file> and report it at once. It
reads the settings and
the client config of Claude Code and the rules and config of Codex, and it names each file
it read. Each finding names a file and a place, for example permissions.allow[3] or
rules/default.rules line 12, never the value. For each finding, the credential must be
rotated first (references/rotation.md), and then the user removes that entry. Change
no file of the agents yourself without the user's yes.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.
references/rotation.md. If the service is not
listed, give the generic steps from the same file.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").
python3 scripts/redact_copy.py <file>. It writes <name>.redacted<ext> next to the
original and prints only the counts. Add --secrets-only to keep personal data.agents/openai.yaml (opens in a new tab)assets/icon-large.png (opens in a new tab)assets/icon-small.svg (opens in a new tab)references/rotation.md (opens in a new tab)scripts/_detector.py (opens in a new tab)scripts/_fast.py (opens in a new tab)scripts/_links.py (opens in a new tab)scripts/audit_approvals.py (opens in a new tab)scripts/audit_transcripts.py (opens in a new tab)scripts/known_keys.txt (opens in a new tab)scripts/protection_status.py (opens in a new tab)scripts/redact_copy.py (opens in a new tab)scripts/rotation.json (opens in a new tab)scripts/scan_secrets.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub mcpgate-de/maisecrets --plugin maisecretsOther plugins' skills for the same job