secret-redactor (escapeboy)

Reviewed at commit feb212c

Hides tokens, keys and passwords in tool output as ‹secret:N›, restores them in later tool calls, blocks reading key files.

Made by
escapeboy
What we checked

Scans the output of every tool call for tokens, API keys, private keys and passwords and replaces them with numbered placeholders before Claude or the transcript sees them. Placeholders Claude writes into later local tool calls are swapped back for the real value. It also blocks Claude from reading .pem files, SSH keys and a few named credential files. The secret table lives in memory only.

Review details

Static review of the source at the pinned commit; not run. One module, hooks/register.ts, registers a single tool.call handler (plus a catch handler). Before a call it denies Read of paths matching /.config/op/sa-token, *.pem, ~/.ssh/id_*, and ~/.claude/alert.env; other tools (Bash cat, Grep) are not blocked, so this is a guard rather than a barrier. For Bash, Read, Edit, Write, NotebookEdit, Grep and Glob it replaces placeholders of the form secret:N in the arguments with the real value held in an in-memory Map; web and MCP tools get the placeholder unchanged, and Agent, Task and Workflow calls are skipped. After the call it runs regex redaction (private key blocks, ops_, sk-ant-, sk-, ghp_ style, github_pat_, glpat-, xox, AKIA, Sentry, JWT, Bearer tokens, KEY=value env lines, JSON key/secret fields, and prose like password x) over every string in the result, and for Bash commands containing op read it also hides the single-line output. Uses $.ui.status and $.ui.toast to report counts. If scanning throws after the tool ran, the output is withheld with a deny message. No network calls, no file access of its own, no processes, no storage; nothing is persisted and the table is lost on reload. Regex coverage is best effort, so unmatched secret formats pass through.

What it uses
  • Reads your prompts: no
  • Sees tool calls: yes
  • Blocks or changes tool calls: yes
  • Reads or writes files: no
  • Runs programs on your machine: no
  • 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

modsforClaude badge for secret-redactor (escapeboy)

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/secret-redactor-escapeboy.svg)](https://modsforclaude.com/mods/secret-redactor-escapeboy/)

← All mods