fix(guard): exempt noreply co-author addresses from PII scans - #84
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
guardjob's commit-message scan (pii-regex-guard.sh --stdin) has no allowlist, and Claude Code stamps every commit withCo-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 addCo-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
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 intotest/run-all.shand picked up by the CI test job globgit 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 0test/cli/suites pass locally (macOS)codex review --base main: final round 0 findings🤖 Generated with Claude Code