Version / branch / commit
main at 27b319c (current origin/main)
OS and environment
Windows 10. Static review of internal/redaction; no provider call required.
Steps to reproduce
- Take a key that the shape matcher already catches, e.g.
sk-ant-api03-abcdefghijklmnopqrstuvwxyz0123456789ABCD.
- Call
RedactString on the unsplit value → it redacts.
- Insert a NUL (or ESC) in the body, e.g.
sk-ant-api03-\x00abcdefghijklmnopqrstuvwxyz0123456789ABCD.
- Call
RedactString again → no match.
- Strip the control byte from the result → the two fragments rejoin into the original secret.
RedactString (internal/redaction/redaction.go) matches shapes on the raw string. It never strips C0/C1 bytes first. There is no split-case test in the package.
This is the AGENTS.md “normalize before matching” gap: redacting by shape and then (or never) stripping control bytes lets a split credential pass as two fragments and be rejoined on the way out. An unsplit pass is not evidence.
Expected behavior
The split form is redacted the same as the unsplit form. A regression test fails on current main for the NUL-split case.
Actual behavior
Unsplit: redacted. NUL-split: secret survives. After dropping the NUL, the original key is visible again.
Relevant logs, screenshots, or error messages
Strip/normalize control bytes first, then match. Add a split-case test (NUL and ESC). Do not treat an unsplit-only test as coverage.
Version / branch / commit
mainat 27b319c (current origin/main)OS and environment
Windows 10. Static review of
internal/redaction; no provider call required.Steps to reproduce
sk-ant-api03-abcdefghijklmnopqrstuvwxyz0123456789ABCD.RedactStringon the unsplit value → it redacts.sk-ant-api03-\x00abcdefghijklmnopqrstuvwxyz0123456789ABCD.RedactStringagain → no match.RedactString(internal/redaction/redaction.go) matches shapes on the raw string. It never strips C0/C1 bytes first. There is no split-case test in the package.This is the AGENTS.md “normalize before matching” gap: redacting by shape and then (or never) stripping control bytes lets a split credential pass as two fragments and be rejoined on the way out. An unsplit pass is not evidence.
Expected behavior
The split form is redacted the same as the unsplit form. A regression test fails on current
mainfor the NUL-split case.Actual behavior
Unsplit: redacted. NUL-split: secret survives. After dropping the NUL, the original key is visible again.
Relevant logs, screenshots, or error messages
Strip/normalize control bytes first, then match. Add a split-case test (NUL and ESC). Do not treat an unsplit-only test as coverage.