-
Notifications
You must be signed in to change notification settings - Fork 7
Update SWIFT PII detection #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 refines BIC/SWIFT code detection to reduce false positives by replacing a generic pattern with two targeted approaches: context-aware detection requiring explicit keywords (like "BIC", "SWIFT", "bank code") preceding the code, and pattern matching against a curated list of known bank prefixes from major financial institutions worldwide.
- Replaced overly permissive regex that matched any 8-11 character alphanumeric sequence with specific detection strategies
- Added context-aware pattern requiring banking-related keywords before BIC codes
- Added whitelist of 63 known bank BIC prefixes for standalone code detection
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/checks/pii.ts | Implements new BIC/SWIFT detection with context patterns and known prefix list |
| src/tests/unit/checks/pii.test.ts | Updates existing test and adds new tests for context-aware detection, known prefixes, and false positive prevention |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this 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 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 'ICBK', | ||
| 'ABOC', | ||
| 'PCBC', | ||
| 'HSBC', |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prefix 'HSBC' appears twice in the KNOWN_BIC_PREFIXES array (lines 225 and 269). Remove the duplicate entry to avoid redundancy.
| 'HSBC', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit]
| 'IBKO', | ||
| 'KODB', | ||
| 'HNBN', | ||
| 'CITI', |
Copilot
AI
Nov 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prefix 'CITI' appears twice in the KNOWN_BIC_PREFIXES array (lines 227 and 282). Remove the duplicate entry to avoid redundancy.
| 'CITI', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit]
gabor-openai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TY
Updated
BIC_SWIFTdetection to be more specific reducing false positives