secrets-veil
Reviewed
at commit 83dab3d
New version, not yet reviewed
Masks secret values in tool results before the model reads them: named vendor variables, value-shape patterns, and high-entropy tokens. No reveal path.
0 upvotes
Log in to upvote or save- Made by
- OrchestKit
- Pinned commit
-
83dab3d5db15c1b3a4c84c8b04065e91cf6d9e62 - What we checked
-
Replaces secrets in every tool result with dots before Claude reads them: values of 21 well-known API key variables, vendor key prefixes and random-looking tokens. PNG, JPEG and GIF image reads pass through after strict checks; WebP and PDF reads stay masked and fail, and results it cannot mask are withheld. It shows a count of masked values, makes no network calls and stores nothing.
Review details
Static review of the source at the pinned commit; not run. Delta review of the changes since 5fc8a5e; the rest carries over from the review at that commit. Registers session.start and tool.call. On session.start it reads 21 named vendor environment variables (ANTHROPIC_API_KEY, OPENAI_API_KEY, GITHUB_TOKEN, AWS_SECRET_ACCESS_KEY and others, each a literal $.env.get) plus SECRETS_VEIL_OFFER_COPY, keeps values of 8+ characters in module memory only, and shows a $.ui.notice when none resolved. On tool.call it runs the tool via next(), then deep-masks every string in the result with three layers (exact named values, prefixes such as sk-ant-, ghp_, AKIA, Bearer and PEM blocks, and a Shannon-entropy layer at 4.3 bits per character for runs of 20+ characters, with SRI hashes and Anthropic tool/message ids exempt), replacing each span with at most 8 bullets. The ops_ (1Password service account) and sk_live_ (Stripe) prefixes only mask where a token-shaped body follows, so identifiers like hq_ops_tasks are not masked. Top-level image blocks pass byte-equal only for PNG, JPEG or GIF that pass strict base64 and whole-file structural validation; an image containing a named value or vendor prefix withholds the whole result; WebP and PDF payloads are masked, so those reads fail while it is on. It fails closed: a missing table arms lazily, oversized results or strings, masking over 4 s, non-plain objects, or any exception are answered with { deny } and a fixed withheld message. When something was masked it calls $.ui.toast and $.ui.status with counts only and $.ui.log with { to: debug } for byte counts; every UI call has a $.clock.after deadline. Opt-in only (SECRETS_VEIL_OFFER_COPY=1, off by default and disclosed with its caveat that other mods hooking ui.copy could see the value): $.ui.ask offers to put the first masked value on the clipboard via $.ui.copy; the question expires after 2 minutes. Changed in this version (0.0.11, mask.ts only): the entropy layer now skips a run that lies inside an https image URL on one exact, hard-coded media host (d8j0ntlcm91z4.cloudfront.net), so such image links stay readable. The URL must be a whole whitespace-delimited token, a path of letters, digits and - . _ / ending in png, jpg, jpeg, webp or gif, with no query, fragment, path parameter, userinfo, backslash or percent-encoding, so signed URLs stay masked; the named-value and vendor-prefix layers still apply inside it. The range scan is linear and pure string work. The only residual is that a secret placed in the path of an image URL on that host would not be caught by the entropy layer, which is accepted and documented in the code. No new network, process, file or store calls. vitest.config.ts is test-only and not loaded by the mod.
- 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
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/secrets-veil/)