The phone-number pattern in pii_scrubber.py matches dashed formats like 555-123-4567 but not the parenthesized format (555) 123-4567, so one of the most common US phone formats passes through scrub() unredacted, and detect() reports no PII for it.
Steps to reproduce:
from safety.pii_scrubber import PIIScrubber
s = PIIScrubber()
print(s.scrub('Call me at (555) 123-4567 or 555-123-4567'))
# observed: 'Call me at (555) 123-4567 or [REDACTED]'
print(s.detect('Call me at (555) 123-4567'))
# observed: []
Related failing tests: test_us_phone_number_redaction, test_us_phone_formats, test_detect_phone_pii, test_phone_at_start_of_text in tests/unit/test_pii_scrubber.py.
The phone-number pattern in
pii_scrubber.pymatches dashed formats like555-123-4567but not the parenthesized format(555) 123-4567, so one of the most common US phone formats passes throughscrub()unredacted, anddetect()reports no PII for it.Steps to reproduce:
Related failing tests:
test_us_phone_number_redaction,test_us_phone_formats,test_detect_phone_pii,test_phone_at_start_of_textintests/unit/test_pii_scrubber.py.