Before you paste a support message into a shared document or an AI tool, you may want to hide the email addresses, card numbers and bank account numbers in it. A pattern-based redaction tool can help. It can also give a false sense of safety. This guide explains what a pattern-based tool covers, what it leaves behind, and what the documentation of our local library says about both.
This guide describes behaviour documented for our local text-redaction library (version 0.1.5). It describes our own tool, not a statement about any customer machine, business or result. The documentation says the output must be reviewed by a person, and that it is not a legal or compliance determination.
What It Is Built to Find
The library redacts email addresses, card numbers that pass the Luhn checksum, IBANs that pass the mod-97 check, US social security number formats, IPv4 addresses, phone numbers and patterns you define. It can replace values with a mask or with keyed pseudonym tokens. Our example turns a sentence with an email address into “Contact [EMAIL]” and counts one redaction.
What Still Leaks, in the Documentation’s Words
- Names, postal addresses, usernames and free text are not detected, unless labelled or covered by a pattern you add.
- Obfuscated or split values, such as an email written with “at” and “dot”, digits spelled out, or a value broken across lines.
- A card number that fails the checksum, such as a typo or a test number, is not recognised as a card.
- Unseparated phone numbers and long identification numbers without separators are not redacted. They are flagged as digit runs for review.
- Non-ASCII or internationalised email addresses are flagged and not redacted.
It Can Also Over-Redact
A long reference number that happens to pass the card checksum is redacted too. Phone detection is broad and can match other digit runs. A few neighbouring digits can be redacted along with a card.
Review Flags
For things it does not redact but finds suspicious, the library returns review flags with offsets only. Examples are runs of nine or more digits and anything shaped like an email that was not redacted. Flags are on by default, and the documentation warns that switching them off removes the safety net. It also lists what the flags do not see, such as digits separated by a colon or by letters.
A Checksum Is Not Ownership
The IBAN, card and SSN checks look at format and checksum only. They do not prove that a number belongs to anyone.
A Safe Way to Use It
- Run the tool, then read the output and the review flags yourself.
- Treat redaction as risk reduction for the supported patterns, not removal of all personal data.
- Do not describe the result as anonymised or compliant.
- Keep the original in a place with proper access control, and decide how long to keep the redacted output.