Skip to content

docs(security): qualify phone PII redaction as NANP-only - #1914

Open
sdshah09 wants to merge 1 commit into
entireio:mainfrom
sdshah09:docs/pii-phone-nanp-scope
Open

docs(security): qualify phone PII redaction as NANP-only#1914
sdshah09 wants to merge 1 commit into
entireio:mainfrom
sdshah09:docs/pii-phone-nanp-scope

Conversation

@sdshah09

@sdshah09 sdshah09 commented Aug 7, 2026

Copy link
Copy Markdown

Closes part of #1909.

phone PII redaction is on by default whenever PII redaction is enabled, but only matches North American (NANP) formats. The docs gave it no locale qualifier, while address right below it is already qualified as "US street addresses". A non-US user reading phone: true / [REDACTED_PHONE] reasonably concludes phone numbers are stripped, when for their own country's numbers nothing happens at all.

Changes

Two edits to docs/security-and-privacy.md:

  1. Qualify the table row — `phone` (North American / NANP formats). Kept the qualifier inside the Category cell to match how address already does it, rather than adding the extra "Notes" column the issue suggests. Happy to switch to the column if you'd prefer it.

  2. New bullet under Limitations:

    Built-in PII patterns are US-centric. phone matches North American (NANP) formats only — international formats, including E.164 numbers outside +1, are not detected. address matches the street line only; city, state, and ZIP/postcode are preserved. If you handle personal data from other regions, add custom_patterns for your locale rather than relying on the built-in categories alone.

Docs only. No change to the matchers.

Verified against source

  • redact/pii.go:84-92phoneRegex has three branches, all 3-3-4 NANP. Only the first carries an international prefix, and it is hardcoded \+1, so E.164 numbers outside +1 are not matched.
  • redact/pii.go:93addressRegex terminates at the street suffix (St, Ave, Rd, …), so anything after it survives.
  • redact/pii.go:79emailRegex is locale-independent, consistent with the issue reporting email as fine.

Not covered here

  • /guides/configuration/privacy-and-redaction (the issue's smaller point 1) has no in-repo equivalent — it looks like it lives on the docs site. If that content is maintained elsewhere, the same qualifier is worth repeating there, since it is the page you land on to turn the feature on.
  • International phone coverage is explicitly out of scope per the issue and the reporter's follow-up; that stays a backlog item.

Note on process

I picked this up after commenting on the issue; @jasonmx confirmed the scope ("the primary ask is to clarify the features' scope in the docs"), but no maintainer has replied or assigned it yet. First contribution here, so happy to close this if it is already in flight or if you'd rather the docs change land somewhere else.

phone PII redaction is on by default whenever PII redaction is enabled, but
only matches North American (NANP) formats. The docs gave it no locale
qualifier, so a non-US user reading `phone: true` / `[REDACTED_PHONE]`
reasonably concludes phone numbers are stripped when for their own country's
numbers nothing happens. The table already qualifies `address` the same way.

Also notes that `[REDACTED_ADDRESS]` replaces the street line only, so city,
state, and ZIP/postcode survive, and points users needing other locales at
`custom_patterns`.

Docs only; no change to the matchers.

Refs entireio#1909

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 01KZD6QJHTQK7W4TNZ5D3GRPCK
@sdshah09
sdshah09 requested a review from a team as a code owner August 7, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant