Skip to content

Country pack

Brazil PII detection: CPF, CNPJ, IBAN

Updated 5 detectorsPack code br

Short answer

Maskflare's Brazil pack has 5 detectors. 3 validate a check digit or letter, 1 tests layout or an embedded date, 1 matches on pattern alone.

What the Brazil pack covers

The Brazil pack holds 5 detectors: Company taxpayer number (CNPJ, numeric or alphanumeric), Individual taxpayer number (CPF), IBAN, Phone number and Postal code. 3 of them recompute a check digit or letter, 1 tests layout or an embedded date only, 1 is pattern-only, and 1 waits for a keyword before it matches.

Examples are synthetic and were run through Maskflare's validators. Click a detector name for its own page where one exists.
DetectorCategoryValidationValid example
Company taxpayer number (CNPJ, numeric or alphanumeric)tax IDChecksum12.ABC.345/01DE-35
Individual taxpayer number (CPF)national ID numberChecksum529.982.247-25
IBANbank account number (IBAN)ChecksumBR18 0036 0305 0000 1000 9795 493C 1
Phone numberphone numberLayout rules+55 11 91234 5678
Postal codepostal codePattern only01310-100

Every Brazil detector in detail

Company taxpayer number (CNPJ, numeric or alphanumeric)

A tax identifier. Validation: 12 characters followed by two modulus 11 check digits. A run of digits with no separator is judged by words nearby; the detector's own keywords include cnpj. Valid example: 12.ABC.345/01DE-35; the same shape that fails is 12.ABC.345/01DE-30.

Individual taxpayer number (CPF)

A national identity number. Validation: nine digits followed by two modulus 11 check digits, never one repeated digit. A run of digits with no separator is judged by words nearby; the detector's own keywords include cpf, id no, id number, identity number. Valid example: 529.982.247-25; the same shape that fails is 529.982.247-20. Full guide: Brazilian CPF.

IBAN

A bank account identifier. Validation: the registered length for the country and the ISO 13616 modulus 97 check. Valid example: BR18 0036 0305 0000 1000 9795 493C 1; the same shape that fails is BR18 0036 0305 0000 1000 9795 493C 0.

Phone number

A telephone number in the national format. Validation: between 7 and 15 digits, the range an international number can have. Valid example: +55 11 91234 5678.

Postal code

A postal code, which identifies a place rather than a person on its own. Validation: the pattern only, with no checksum or structural validator. It needs one of 9 keywords within 48 characters before the value, such as cep, codigo postal, código postal, post code. Valid example: 01310-100.

Local-language context words for Brazil

These are the words in the catalogue that confirm a value as belonging to this country's detector. Shared English words such as ID number or tax id are left out here because many packs use them; a word below points at this pack even when other packs are on.

  • Company taxpayer number (CNPJ, numeric or alphanumeric): cnpj
  • Individual taxpayer number (CPF): cpf
  • Postal code: cep, codigo postal, código postal

How Maskflare masks Brazil identifiers

Detections are replaced with a token such as mf_mask_d7e0 before the request goes to the AI provider, and with response restoration turned on the real value is put back in the answer. The other actions are redact, partial, hash, format-preserving encryption, generalize, alert and block.

  • Protect now, Finance - Protect now, Healthcare and Developer: mask (a reversible token) when Brazil is a primary country.
  • Monitor first: alert (counted, forwarded unchanged) when Brazil is a primary country.

None of the compliance profiles (HIPAA Safe Harbor, GDPR (EU/EEA), UK GDPR, PCI DSS v4.0, US PII (CCPA/CPRA) and Swiss nDSG health data) includes the Brazil pack. Its detectors run when Brazil is chosen as a primary country or the pack is enabled directly.

Limits worth knowing

  • A passing checksum shows that a value is well formed, not that it was issued to a real person. The examples on this page pass for that reason and are not real.
  • 1 of the 5 detectors here matches on pattern alone (Postal code), so it can match text that merely has the same shape.
  • Detectors read the text of the request. A value inside an image is found only after OCR, and a value split across lines is not one match.
  • Names, addresses and free-text details are handled by other packs. This page is limited to the Brazil identifiers.

Frequently asked questions

What does Maskflare detect for Brazil?

5 detectors: Company taxpayer number (CNPJ, numeric or alphanumeric), Individual taxpayer number (CPF), IBAN, Phone number and Postal code.

Are Brazil identifiers masked by default?

They are masked when Brazil is chosen as a primary country (the default Protect now template uses the action mask), or when the pack is turned on directly. A country pack is not on for organisations that did not choose the country.

Which Brazil identifiers have a checksum?

Company taxpayer number (CNPJ, numeric or alphanumeric), Individual taxpayer number (CPF) and IBAN.

Do the Brazil detectors need keywords?

1 of them do: Postal code.

Rules on this page describe what Maskflare's detectors and validators check. They are read from the detection catalogue and are not the specification of the body that issues the identifier. Examples are synthetic.

Related pages

See it on your own data

Try Maskflare free.
Bring your hardest prompts.

28-day free trial or 10,000 requests, whichever comes first. Point one app at the gateway or enroll a few laptops,
and watch what gets masked. Or talk to us first.