Skip to content

Conversation

@steven10a
Copy link
Collaborator

  • Added KR_RRN to the PI guardrail
  • Added tests

Copilot AI review requested due to automatic review settings October 31, 2025 13:49
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for detecting Korean Resident Registration Numbers (RRN) in the PII guardrail system, and adds an internal_examples/ directory to .gitignore.

  • Added KR_RRN entity type to the PIIEntity enum
  • Implemented regex pattern for detecting Korean RRNs in format XXXXXX-XXXXXXX
  • Added comprehensive unit tests for both masking and blocking modes

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/checks/pii.ts Adds KR_RRN enum entry and regex pattern /\b\d{6}-\d{7}\b/g for Korean RRN detection
src/tests/unit/checks/pii.test.ts Adds two test cases verifying KR_RRN detection in both masking (block=false) and blocking (block=true) modes
.gitignore Adds internal_examples/ directory to gitignore
Comments suppressed due to low confidence (1)

src/checks/pii.ts:66

  • The documentation comment should be updated to include Korea in the list of supported regions, since KR_RRN is now being added. Consider updating to: 'Includes global and region-specific types (US, UK, Spain, Italy, Korea, etc.).'
 * Includes global and region-specific types (US, UK, Spain, Italy, etc.).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@steven10a steven10a requested a review from Copilot October 31, 2025 13:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


// Korea
// Format: YYMMDD-GNNNNNN where YY=year, MM=month(01-12), DD=day(01-31), G=gender/century(1-4)
[PIIEntity.KR_RRN]: /\b\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])-[1-4]\d{6}\b/g,
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regex pattern allows invalid dates like February 30th (0230) or February 31st (0231). The day validation (0[1-9]|[12]\d|3[01]) doesn't account for different month lengths. While month-specific day validation in regex is complex, consider if this level of validation is acceptable or if additional validation logic should be added.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now this is fine. All of the checks are basic regex, I would recommend a separate PR that makes all of the checks more robust.

@gabor-openai gabor-openai changed the title Adding Korean RRN Adding Korean RRN PII detection Oct 31, 2025
Copy link
Collaborator

@gabor-openai gabor-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM TY

@gabor-openai gabor-openai merged commit b26aad8 into main Oct 31, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants