You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] PII scrubber redacts epoch-ms timestamps and long IDs as card numbers (no Luhn check) #205
services/pii_scrubber.py redacts any run of 13–16 digits as [REDACTED_CARD], with no Luhn check. The scrubber runs on every log line and tool result before the LLM, Slack and storage see them, so ordinary values are destroyed:
ts=1732600000123 level=error -> ts=[REDACTED_CARD] level=error (epoch milliseconds)
took 1234567890123 ns -> took [REDACTED_CARD] ns
order 12345678901234 ok -> order [REDACTED_CARD] ok
Epoch-millisecond timestamps are 13 digits, so the agent loses the timeline in JSON logs (Loki, CloudWatch, most structured loggers). Long numeric request, trace and order IDs disappear too, which makes it impossible to correlate events across services.
Proposed fix
Redact a card candidate only when it passes the Luhn checksum. Optionally also require a known IIN prefix (4, 51–55, 2221–2720, 34/37, 6011/65).
Keep obvious timestamps: 13-digit values starting 1 that fall within ±20 years of now.
Review the phone pattern for the same problem with 10-digit IDs.
Tests: Visa/Mastercard/Amex test numbers are still redacted; epoch ms, nanosecond durations and 14-digit order IDs are kept.
Files
services/pii_scrubber.py, tests/test_security.py (or a new tests/test_pii_scrubber.py)
Activity