Skip to content

Conversation

@steven10a
Copy link
Collaborator

Updated BIC_SWIFT detection to be more specific reducing false positives

Copilot AI review requested due to automatic review settings November 10, 2025 21:56
Copilot finished reviewing on behalf of steven10a November 10, 2025 21:57
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 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.

@steven10a steven10a requested a review from Copilot November 10, 2025 22:12
Copilot finished reviewing on behalf of steven10a November 10, 2025 22:14
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 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',
Copy link

Copilot AI Nov 10, 2025

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.

Suggested change
'HSBC',

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.

[nit]

'IBKO',
'KODB',
'HNBN',
'CITI',
Copy link

Copilot AI Nov 10, 2025

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.

Suggested change
'CITI',

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.

[nit]

@gabor-openai gabor-openai self-requested a review November 12, 2025 10:53
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.

TY

@gabor-openai gabor-openai merged commit 0af5714 into main Nov 12, 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