All shelves / Mods / Safety
secret-shield
By Singh-AP
secret-shield is a Claude Code safety mod by Singh-AP.
Replaces API keys, tokens, private keys, and passwords in tool output with a redaction marker before the model or the transcript sees them.
DrawsHolds a command
Install
The marketplace name is awesome-claude-mods.
/plugin marketplace add Singh-AP/awesome-claude-mods /plugin install secret-shield@awesome-claude-mods
It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.
- Version
- 1.0.0
- License
- MIT
- Repo stars
- 3
- Last change
- 2026-10-04
What it can reach
- Draws in the session
- Holds a command
- Sees tool calls
Claude Code 2.1.287 or later. The mod is live once you run /reload-plugins or start a new session. Every tool result is rewritten before it is stored, so the model reads [REDACTED:kind] in place of a secret and the transcript keeps no copy; a second hook catches file attachments, hook context, and other rows that enter the conversation. It finds more than 20 formats, AWS keys and session tokens, GitHub, Anthropic, OpenAI, Slack, Stripe, Google, npm, PyPI, Hugging Face, and SendGrid keys, JWTs, Bearer headers, PEM private keys even half-printed, and passwords in URLs, and it keeps the name and drops the value in .env, export, YAML, TOML, JSON, and code assignments, while lookalikes such as MAX_TOKENS=1024 stay. A row it cannot scan is withheld rather than stored raw. One toast per kind of secret per session. /secret-shield shows what was hidden, and /secret-shield test dry-runs a string. blockSecretFiles, off by default, refuses Read, Edit, and Write on .env files, keys, ~/.ssh, ~/.aws/credentials, .npmrc, .netrc, kube config, and service-account JSON, with .env.example readable. redactPrompts, off by default, redacts secrets you paste into your own prompts.
The marketplace, Singh-AP's awesome-claude-mods, holds the 21 mods built there, bash-guard, net-guard, injection-guard among them, and 26 community and Anthropic mods pinned to a commit. This one installs on its own. Keeping keys out of the model's context and the transcript is why this page files it under safety. secret-guard, by arasovic, hides API keys and private keys before the model or the transcript sees them, and blocks credential files and commands that print secrets. secret-box, by ray-amjad, opens a masked box when Claude needs a key, writes the key to .env, and gives Claude a placeholder. This one scrubs what flows in, and holds file reads only with blockSecretFiles on. Detection is by pattern, so a secret with no known format and no telling name gets through; high-entropy guessing is left out because it would redact commit hashes. A secret Claude already knows, because you pasted it with redactPrompts off, can still be written to files, and the terminal may show raw output for a moment before the redacted row replaces it. Its plugin.json names awesome-claude-mods as its author, and Singh-AP owns the marketplace.
Demo
What it hooks into
session.startWhen a session startssession.appendWhen an entry is written to the transcripttool.callAround a tool call, where it can hold onecommand.runWhen you run its slash command/secret-shield
Read from the on() calls in its hook modules. Open its source under Files to check what each one does.
Slash commands 1
/secret-shieldWhat secret-shield has hidden from Claude, or dry-run it: /secret-shield test <text>
Files
The author's README and source, 4 files. They load when you open them.
Facts
- Author
- Singh-AP
- Category
- Safety
- Marketplace
- awesome-claude-mods
- Folder
- mods/safety/secret-shield
- Version
- 1.0.0
- License
- MIT
- Repo stars
- 3
- Last change
- 2026-10-04
- Language
- TypeScript
- Files
- 8