Skip to content

PII scrubber fails to redact parenthesized US phone numbers #53

Description

@Aburke225

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomerssafetySafety & PIItier-1Starter difficulty

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions