secret-box

Reviewed at commit 36069ce New version, not yet reviewed

Claude can use a secret without seeing it: a masked box saves keys to .env and gives Claude a placeholder, every key a tool prints comes back as a…

Made by
Ray Amjad
What we checked

Gives Claude a tool that opens a masked box where you paste a key; it is saved to an env file in the project (.env by default) and added to .gitignore if needed, and Claude only gets a placeholder that becomes the real value inside local commands and file writes. Keys in prompts, tool output and attached files become placeholders, and staging or committing .env is refused. No network calls.

Review details

Static review of the source at the pinned commit; not run. Delta review of the changes since 4ee4b4c; the rest carries over from the review at that commit. register.jsx registers a request_secret tool via $.tool.register and wraps the bundled transcript-redactor (redact.ts, detect.ts). Hooks: session.start, session.attach, tool.call (restores placeholders to real values only for the configured local tools Bash, Write, Edit, MultiEdit, NotebookEdit and not for git commit/tag or gh publishing commands, refuses Bash commands whose restored value holds shell metacharacters, scrubs results, errors and context; denies git add/stage of a .env file and, before a git commit, runs git diff --cached --name-only and, when the command also stages, git ls-files, blocking if a .env file would be included; reads named .env files first to learn secret-named values), prompt.submit, prompt.context, prompt.attachment, prompt.mention, agent.spawn, ui.render (Pane and AbovePrompt), ui.close. Changes in this version: the git add/commit guard now parses the Bash command like a shell (quotes, variables, $( ), backticks, heredocs, nested bash -c strings, cd/pushd/popd, set -P, git -C and CDPATH) to find every directory git will run in, using only the HOME, CDPATH and OS environment variables and $.session.cwd, and blocks with an explanatory message when a directory cannot be worked out; the staged-files checks now use NUL-separated output, diff.relative off and a whole-tree ls-files so subfolders cannot hide a .env, and git is run with a fixed argv through $.process.run (read-only git diff --cached and ls-files only); .env detection in git add arguments is stricter. In detect.ts, a private key body whose BEGIN line was cut away is now redacted from its END line upwards, and OpenSSH key bodies are recognised in opaque blobs. Runtime calls otherwise as before: $.fs.read/exists/write (only the env file and .gitignore in the project root are written; .env files named in tool calls are read), $.process.run for git and short waits, $.env.get, $.session.cwd/root/surfaces, $.ui.open/close/toast/notice/log/invalidate. The vault of placeholders lives in memory only. Hooks fail closed, so large outputs can be withheld. detect.ts is about 84 KB; only its diff hunks were read, the unchanged remainder carries over from the previous review. No npm dependencies.

What it uses
  • Reads your prompts: yes
  • 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
Screenshot of secret-box

Claude can use a secret without seeing it: a masked box saves keys to .env and gives Claude a placeholder, every key a tool prints comes back as a placeholder, and committing .env is refused

Made this mod? Add a badge to your README

modsforClaude badge for secret-box

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-box.svg)](https://modsforclaude.com/mods/secret-box/)

← All mods