secret-guard
Reviewed
at commit 7e60143
New version, not yet reviewed
Keeps API keys and tokens out of Claude's context, your files and your commits: hides them in tool output, and asks before a write, commit or push adds one.
0 upvotes
Log in to upvote or save- Made by
- Hamza Zafar
- Pinned commit
-
7e60143318d27153654aa8745d5f8b603528192b - What we checked
-
Replaces API keys, tokens and private keys in tool output with a label before Claude reads them, and asks before a file write, git commit or git push would add one. Toasts and questions name the kind of secret, never its value. It uses gitleaks if installed, runs it locally, and makes no network calls.
Review details
Static review of the source at the pinned commit; not run. All four files (plugin.json, hooks.json, register.ts, rules.ts) were read in full. Registers session.start (a /secret-guard command that reports counts), command.run, and tool.call handlers for Write, Edit and NotebookEdit (scan the new text, ask via $.ui.ask unless git ignores the file, refuse to write its own redaction label over a real secret), Bash (for git commit and git push: runs git diff, git log -p and git ls-files to scan what would be added; asks if git cannot answer or the diff is too big; reads untracked files up to 200 files of 1 MB, or the folder after git init) and a catch-all tool.call that rewrites tool results, replacing matches with a label (or withholding the result when it cannot be rewritten safely). Programs run: git with core.fsmonitor=false and --no-pager (read-only commands), and optionally gitleaks (stdin mode, --ignore-gitleaks-allow, run from the temp folder, nothing verified online). Built-in rules are linear regexes. Secrets are kept in memory only for the call; the session counters hold kinds and numbers, no values. No network, no stores, no file writes, no eval. A secret scan is best-effort, so missed or unusual formats still pass. Failure behaviour: scan errors let the call proceed; git failures ask.
- What it uses
-
- Reads your prompts: no
- Sees tool calls: yes
- Blocks or changes tool calls: yes
- Reads or writes files: yes
- Runs programs on your machine: yes
- Calls the model (uses tokens): no
- Sends data over the network: no
- Stores data: no
- Shows something on screen: yes
- Hooked events
Made this mod? Add a badge to your README
Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.
[](https://modsforclaude.com/mods/secret-guard/)