Detected secrets stay off the model. Your tools still get the real value.
Your AI reads everything you give it: the password you type, the .env it opens, the customer list a tool returns. maisecrets stops the values it detects on your computer, before they reach the model, wherever Claude Code or Codex runs its hooks. A free plugin for both.
- Catches what identifies you: passwords, keys and personal data in prompts, files and command output
- Leaves the rest readable: it is built to keep commit hashes, IDs and file names as they are, so your agent can still work
- The model sees a placeholder, your commands, files and MCP calls get the real value
- Check any value first with
ms:(…), without sending it - Guards PDFs, images and SSH: you decide what the model or a server gets
- Runs locally: no telemetry, no account, no server
- Free and open source, Apache-2.0
It works in Claude Code and Codex, where the client runs plugin hooks. Check your client · For your company · What it does not protect
What it catches
Bearer headers, from the rules of betterleaks (the successor of gitleaks) and Yelp detect-secrets, plus maisecrets’ own rules.
password: or DB_PASSWORD=. A password without a label you store once with /maisecrets:put.
Names have no shape: put the ones you care about on your term list, or import what your own NER found. How it detects, and how well each kind is found
Two jobs: hide what identifies you, keep the rest readable
Like a parcel locker: the courier gets “locker 47”, not your name and address, but still reads the delivery note. Your AI gets a placeholder for a password, and still reads the commit hash.
The cost: maisecrets misses some values, mostly names in free text. We measure both jobs and show where other tools do better.
What the model sees
You ask the agent to write a deploy script, and it reads your .env.
DB_USER=deploy
DB_PASSWORD=Tq8vR2pLm4Wz
DB_USER=deploy
DB_PASSWORD=⟦SECRET_c1⟧
The agent writes the command with the placeholder. You approve it. At execution the value is read once from your keychain, and the output is redacted again on the way back. The password does not appear in the prompt, the transcript or the model's context.
See your values, the AI does not
From maisecrets 0.9.0, Claude Code shows you the real values with a lock. A click copies one.
Values with a lock are on your screen only. Claude gets placeholders, and maisecrets puts the values back where a command or a file needs them.
What maisecrets does, all on your machine
- You work as usual. You type a prompt, or the agent reads a file or runs a command.
- maisecrets finds the secret on your machine and keeps the value in your local vault.
- Everything else stays readable. maisecrets is built to let commit hashes, IDs, version numbers and file names reach the model as they are.
- The model sees a placeholder such as
⟦SECRET_c1⟧. - The real call gets the real value. maisecrets puts it back in, on your machine, when the command runs.
Detection uses fixed rules: the betterleaks ruleset (the successor of gitleaks), Microsoft Presidio's PII patterns with their checksums, Yelp detect-secrets, and maisecrets' own rules for more token formats and personal data. You can add rules of your own. No model decides what is a secret. A value is put back only in the session where it came in, for one call at a time, under a cap per hour.
For your company
For a team, three things are separate: how the plugin reaches each machine, which settings it must use, and whether its hooks run there.
- Deploy it centrally: make it available or required in your claude.ai organisation, or through Claude Code managed settings
- Enforce a machine policy that a user cannot loosen from their own settings, with your token formats and your customers' names
- Check each machine:
/maisecrets:statusshows the version, the policy keys and, in Codex, whether its hooks run
Install
claude plugin marketplace add Mcpgate-de/maisecrets
claude plugin install maisecrets@maisecrets
For your own code: the detection core is on PyPI as a library, pip install maisecrets. The Python library
Our marketplace has the current release, 0.9.9. The Claude plugin directory installs 0.5.9, an earlier release that blocks a prompt with a password instead of sending it on with a placeholder. Codex and the directory: all install steps.
Sensitive References for MCP
Since mcpgate 2.0.3651 and maisecrets 0.8.14, the two use Sensitive References in Claude Code. mcpgate gives the model a reference instead of a sensitive value. maisecrets puts the real value into a local file, or into a command if you allow it, outside the model context.
We are also exploring this pattern as an independent pre-SEP MCP design: Sensitive References for MCP. It is not an MCP standard or an accepted SEP. maisecrets is one implementation informing the design. How the two relate