Tighten basic PII redaction boundaries#23
Conversation
a24de2c to
a3a84df
Compare
There was a problem hiding this comment.
Code Review
This pull request upgrades the PII redaction profile from basic-contact-v1 to basic-contact-v2, adding support for redacting Korean Resident Registration Numbers (RRN) and dotted Korean mobile phone formats. It also documents system limitations and alternative boundaries in the README files and updates the test suite to reflect these changes. Feedback on the PR suggests expanding the RRN regular expression to also cover Alien Registration Numbers (ARNs) by changing the gender/century digit range from [1-4] to [1-8] to ensure complete compliance with Korean PII regulations.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| PII_PATTERNS: tuple[tuple[str, re.Pattern[str], str], ...] = ( | ||
| ("email", re.compile(r"\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b"), "[REDACTED:email]"), | ||
| ("phone", re.compile(r"\b01[016789][-\s]?\d{3,4}[-\s]?\d{4}\b"), "[REDACTED:phone]"), | ||
| ("kr-rrn", re.compile(r"(?<!\d)\d{6}-[1-4]\d{6}(?!\d)"), "[REDACTED:kr-rrn]"), |
There was a problem hiding this comment.
The current regular expression for Korean Resident Registration Numbers (RRN) uses [1-4] for the gender/century digit. While this covers Korean citizens born in the 1900s and 2000s, it completely misses Alien Registration Numbers (ARNs) for foreign residents in Korea, whose gender digits are 5, 6, 7, or 8. Under Korean PII regulations (PIPA), ARNs are treated with the same level of sensitivity as RRNs. To ensure complete coverage of sensitive resident/alien registration numbers for all residents, please expand the range to [1-8].
| ("kr-rrn", re.compile(r"(?<!\d)\d{6}-[1-4]\d{6}(?!\d)"), "[REDACTED:kr-rrn]"), | |
| ("kr-rrn", re.compile(r"(?<!\d)\d{6}-[1-8]\d{6}(?!\d)"), "[REDACTED:kr-rrn]"), |
dd3ok
left a comment
There was a problem hiding this comment.
Self-review completed.
Findings:
- No remaining blocking findings in the PR diff.
- During review I found one missing operational note: changing
redaction_policy_idtobasic-contact-v2cold-starts PII-redacted document-summary and rendered-output cache entries. Fixed in the amended commit and PR body.
Checks performed locally on the final branch state:
.\.venv\Scripts\python.exe -m pytest -q -p no:cacheprovider-> 172 passed, 2 skippedruff check .-> All checks passed.\.venv\Scripts\python.exe scripts\validate_skill.py --run-evals-> OKgit diff --check-> no whitespace errors; CRLF conversion warnings only
Scope review:
- The implementation only adds narrow regex coverage for common dashed Korean RRN patterns and dotted Korean mobile separators.
- It does not add broad DLP, account-number detection, URL fetching, cross-process locking, provider telemetry, or new LLM providers.
- The docs state these boundaries explicitly.
a3a84df to
d49c716
Compare
|
Follow-up self-review update: addressed the Gemini Code Assist note by expanding the Korean registration-id regex from Fresh local validation after the amendment:
|
Summary
basic-contact-v2basic-contact-v2redaction-policy cache cold-start impactSelf-review
basic-contact-v2; existing document/output cache keys includeredaction_policy_id..agent/,.superpowers/, and historical plan files were not staged.Validation
.\.venv\Scripts\python.exe -m pytest -q -p no:cacheprovider-> 172 passed, 2 skipped.\.venv\Scripts\python.exe scripts\validate_skill.py --run-evals-> OKruff check .-> All checks passedgit diff --check-> no whitespace errors; CRLF conversion warnings only