| autoload | true |
|---|---|
| maturity | alpha |
| description | Forbid reading well-known secret paths; redact secret-shaped values before writing to any ADD artifact. Companion to injection-defense. |
ADD prevents accidental disclosure of secrets leaking into shared artifacts (learnings, handoff, retro, dashboards, commits) or public git history.
Catalog + path list: knowledge/secret-patterns.md. Threat model: knowledge/threat-model.md § T1.
Do NOT Read/Glob/cat these paths without explicit per-invocation approval:
.env, .env.* (allow *.example, *.sample, *.template suffixes), *.pem, *.key, *.cer, id_rsa*, id_ecdsa*, id_ed25519*, .aws/, .ssh/, .gnupg/, secrets/, credentials*, .netrc, .pgpass, *.kdbx.
When asked to read one, respond:
"
{path}is on the secrets-handling read-deny list. Confirm reading it this once?"
Wait for explicit confirmation. If declined, propose an alternative (share the variable name, paste the single value you need seen, etc.).
When a tool result (file read, cat, env, HTTP response) contains a value
matching the regex catalog, replace the match with [REDACTED:{pattern_name}]
before writing any summary or appending to ADD storage.
Every write path MUST run the redaction pass:
| Artifact | Redact on write? |
|---|---|
.add/learnings.json, ~/.claude/add/library.json |
Yes |
.add/handoff.md, .add/retros/*.md, .add/observations.md |
Yes |
Dashboard exports (reports/*.html) |
Yes |
| Commit message body | Yes |
| Sub-agent prompt handoffs | Yes |
Log every redaction to .add/redaction-log.json (schema in
knowledge/secret-patterns.md § 4) — audit without storing the secret.
If a secret entered context before this rule fired, warn at the next natural
break: "Context may contain leaked credentials from {path}. Consider /clear."
.secretsignoretemplate —/add:initcopiestemplates/.secretsignore.templateto project root only if absent. Never overwrite. On create, print:Wrote .secretsignore (commit this — your team shares the policy).- Pre-commit gate is enforced by
lib/scan-secrets.sh. Skills and hooks delegate to that script — never re-implement the catalog inline. The scanner readscore/security/secret-patterns.json(executable catalog, kept in sync withcore/knowledge/secret-patterns.mdbyscripts/validate-secret-patterns.py), scansgit diff --cachedagainst every pattern, respects.secretsignore, honors a[ADD-SECRET-OVERRIDE: SEC-NNN (reason)]commit-message trailer, and exits non-zero on any unsuppressed match./add:deployinvokes it at Step 1.5;/add:verify --level deployinvokes it as Gate 4.6. - Interactive
--allow-secretconfirmation — when the human is in the loop,/add:deploy --allow-secretrequires typingI have verified this is not a real secretexactly (case-sensitive, full string). Override logged to.add/observations.md. Details incore/skills/deploy/SKILL.md§ Pre-commit secrets gate.
ADD prevents accidental disclosure. ADD does NOT stop exfiltration by a
compromised tool — that requires Claude Code's permission system
(.claude/settings.json → permissions.deny on Read for credential paths).
For adversarial projects, pair with gitleaks, detect-secrets, or GitHub
push protection. The regex catalog is best-effort, not a full secrets scanner.
rules/learning.md's PII heuristic overlaps — both fire until PR #6 lands the shared catalog-loader; no regression.rules/injection-defense.md(Swarm D) sharesknowledge/threat-model.md. Injection is adversarial redirection; this rule is accidental disclosure.