Skip to content

Feature Request: Add Canadian Business Number recognizer (CA_BN) #2206

Description

@Joey239716

Is your feature request related to a problem? Please describe.

Presidio currently supports two Canadian entities (CA_SIN and CA_POSTAL_CODE) but not the Canadian Business Number (BN), a 9-digit business identifier issued by the Canada Revenue Agency (CRA). BNs appear in invoices, tax filings, payroll records, and B2B documents, so text containing them cannot currently be fully de-identified for Canadian business contexts.

Describe the solution you'd like

A new pattern recognizer, CaBnRecognizer, detecting the entity CA_BN:

  • Format: 9 digits where the last digit is a Luhn check digit (same scheme as CA_SIN). Commonly written as a 15-character program account number: the 9-digit BN + a 2-letter CRA program identifier (RT, RP, RC, RM, RR, RZ) + a 4-digit reference number, e.g. 123456782 RT 0001.
  • Detection: a weak pattern for the bare 9-digit form (relies on context words) and a medium pattern for the program account form, with Luhn checksum validation to eliminate false positives.
  • Bilingual English/French context words (business number / numéro d'entreprise, CRA / ARC, GST / TPS, etc.).
  • Registered disabled by default with en/fr support, following the CA_SIN and CA_POSTAL_CODE (feat: Add CaPostalCodeRecognizer for Canadian postal codes (CA_POSTAL… #2204) precedents.

Reference: https://www.canada.ca/en/revenue-agency/services/tax/businesses/topics/business-registration/business-number-program-account/need-program-accounts.html

Describe alternatives you've considered

A deny-list or custom regex per deployment, but a predefined, checksum-validated recognizer benefits all users and matches how other national identifiers (AU_ABN, SG_UEN) are handled.

Additional context

I have a working implementation with unit tests ready and will open a PR referencing this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions