Skip to content

fix(guard): exempt noreply co-author addresses from PII scans - #84

Merged
tarr1124 merged 1 commit into
mainfrom
fix/pii-guard-noreply-exemption
Aug 10, 2026
Merged

tarr1124 merged 1 commit into
mainfrom
fix/pii-guard-noreply-exemption

Conversation

@tarr1124

Copy link
Copy Markdown
Contributor

Problem

The guard job's commit-message scan (pii-regex-guard.sh --stdin) has no allowlist, and Claude Code stamps every commit with Co-Authored-By: ... <noreply@anthropic.com>. Every Claude-authored PR therefore failed CI — first seen on #83 (both runs red on the guard job). GitHub squash merges add Co-authored-by: ... <user@users.noreply.github.com>, the same failure shape.

Fix

Built-in, full-match-anchored exemption for exactly two address shapes, in both modes:

  • noreply@anthropic.com (Claude Code co-author trailer)
  • *@users.noreply.github.com (GitHub anonymized commit addresses)

These are undeliverable by design and identify no mailbox. Anchoring keeps lookalikes failing (foo.noreply@anthropic.com, noreply@other.example), and a phone/secret smuggled inside a safe-shaped address is re-caught by an inner re-scan (leftmost-longest email matches would otherwise shadow it — found by Codex review, fixed + regression-tested). Phone/secret hits are never exempt.

Verification

  • New test/cli/test-pii-regex-guard.sh: 18 cases (exemption, anchoring, shadowing evasion, personal email / phone / secret still fail, tree-mode allowlist interplay) — all pass; wired into test/run-all.sh and picked up by the CI test job glob
  • Reproduction: git log --format=%B 609815e..1109e90 | pii-regex-guard.sh --stdin (the exact input that failed on retrospective-interactive-finalize: interactive Self Observation approval #83) now exits 0
  • Tree mode over the full repo: clean, no unused-allowlist warnings
  • All 11 pure-shell test/cli/ suites pass locally (macOS)
  • codex review --base main: final round 0 findings
  • This PR's own commits carry the Claude trailer, so the guard job run here is a live end-to-end check of the fix

🤖 Generated with Claude Code

Claude Code stamps every commit with "Co-Authored-By: ...
<noreply@anthropic.com>", and GitHub squash merges add
"Co-authored-by: ... <user@users.noreply.github.com>". The
commit-message scan (--stdin) has no allowlist, so every
Claude-authored PR failed CI (first seen on PR #83).

Add a full-match-anchored built-in exemption for exactly these two
address shapes in both modes; lookalikes that extend the local part
or swap the domain still fail, and phone/secret hits are never
exempt. The tree-mode remainder rescan honors the same exemption so
a safe address sharing a line with an allowlisted placeholder stays
clean.

Adds test/cli/test-pii-regex-guard.sh (16 cases) covering the
exemption, its anchoring, and unchanged behavior for personal
emails, phones, and secrets; wires it into test/run-all.sh.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tarr1124
tarr1124 merged commit 504e3c8 into main Aug 10, 2026
4 checks passed
@tarr1124
tarr1124 deleted the fix/pii-guard-noreply-exemption branch August 10, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant