summaryrefslogtreecommitdiff
path: root/plugins/code-modernization/agents
diff options
context:
space:
mode:
authorMorgan Lunt <morganl@anthropic.com>2026-06-08 14:43:53 -0700
committerMorgan Lunt <morganl@anthropic.com>2026-06-09 08:47:33 -0700
commitff5feaeb7f113d22ef58e91beae96a7813d23862 (patch)
tree571ffc0740787531fedfad3faffd0011542b3a54 /plugins/code-modernization/agents
parentbbbff6ab54f0d4b62dad2df25536ed05a418b3ff (diff)
code-modernization: never write discovered credential values into findings
Legacy systems often contain live credentials, and assessment/findings files get committed and shared. Previously the security-auditor agent reported hardcoded secrets verbatim into ASSESSMENT.md and SECURITY_FINDINGS.md. - security-auditor: mandatory secret-handling rules — mask all credential values (file:line + 2-4 char preview), redact secrets from echoed tool output, recommend rotation for anything that looks live - assess/harden: gitignore-verified SECRETS.local.md quarantine file for the per-credential inventory; findings files get masked entries and a pointer only - new --show-secrets flag opts into raw values in the quarantine file (and only there) - README: document the behavior and advise users of earlier versions to check for already-committed findings and rotate
Diffstat (limited to 'plugins/code-modernization/agents')
-rw-r--r--plugins/code-modernization/agents/security-auditor.md25
1 files changed, 24 insertions, 1 deletions
diff --git a/plugins/code-modernization/agents/security-auditor.md b/plugins/code-modernization/agents/security-auditor.md
index f1b291db..4f34a340 100644
--- a/plugins/code-modernization/agents/security-auditor.md
+++ b/plugins/code-modernization/agents/security-auditor.md
@@ -39,7 +39,30 @@ terminal/screen items don't apply to a SPA. Work through what's relevant:
Use available SAST where it helps (npm audit, pip-audit, grep for known-bad
patterns) but **read the code** — tools miss logic flaws. Show tool output
-verbatim, then add your manual findings.
+verbatim — except secret values, which you redact (see below) — then add
+your manual findings.
+
+## Secret handling (mandatory)
+
+Legacy codebases routinely contain live production credentials, and your
+findings get pasted into decks, tickets, and committed markdown. Copying a
+secret into a report multiplies the exposure you were hired to find.
+
+When you discover a hardcoded credential, API key, token, connection
+string, or private key:
+
+- **Never write the secret's value into any output** — no finding table,
+ no report, no quoted code excerpt, no echoed tool output. Mask it to the
+ first 2–4 identifying characters plus `****` (`AKIA****`,
+ `postgres://app_user:****@db-prod…`). If a scanner prints a secret,
+ redact it before including the excerpt.
+- Cite `file:line`. The source file is the canonical location — anyone who
+ legitimately needs the value can open it there.
+- State what the credential appears to grant access to (database, queue,
+ cloud account, third-party API) and whether it looks like a production
+ or test credential.
+- Recommend rotation for anything that looks live — exposure in source
+ means it is already compromised, independent of any modernization plan.
## Reporting standard