feat: secret scanner — auto-detects and redacts API keys, tokens, credentials

Adds a secret scanning layer that runs after identity/explicit
substitutions. Catches secrets the user didn't configure:

- API keys: OpenAI (sk-), Anthropic (sk-ant-), Google (AIza),
  AWS (AKIA), GitHub (ghp_), GitLab (glpat-), Slack (xox),
  Stripe (sk_live/test), SendGrid (SG.)
- Auth: Bearer tokens, key=value assignments (password=, secret=,
  api_key=, token=), private key blocks (-----BEGIN PRIVATE KEY-----)
- Connection strings: mongodb://, postgres://, mysql:// with creds
- PII: SSN (xxx-xx-xxxx), credit card numbers (Visa/MC/Amex/Discover)

Redacted values shown in red in the Test tab. Secrets are truncated
in the activity log (first 8 chars + "...") to avoid logging the
full secret. Enabled by default, toggle in Options.

https://claude.ai/code/session_01Dvgwe7XMoSxnWXkih8p1Cw
This commit is contained in:
Claude
2026-03-26 01:24:16 +00:00
parent cd6789040c
commit 3a266d7aa7
6 changed files with 375 additions and 7 deletions
+10
View File
@@ -24,6 +24,16 @@
<span class="toggle-slider"></span>
</label>
</div>
<div class="setting-row">
<div>
<label>Secret scanning</label>
<p class="setting-desc">Auto-detect and redact API keys, tokens, passwords, SSNs, credit card numbers</p>
</div>
<label class="toggle">
<input type="checkbox" id="secretScanning" checked>
<span class="toggle-slider"></span>
</label>
</div>
<div class="setting-row">
<div>
<label>Max log entries</label>