PII Detection
The contains_pii rule looks for personal data in prompts, responses
and tool calls. Every identifier it detects is listed here, with the name to use in a rule and how a
match is confirmed. The dashboard offers the same list.
Choosing what to detect
- In the dashboard, open Rules → PII detection and choose identifiers one by one, or a whole region.
- A rule's
patternslist takes identifier names, region names (global,eu,nordics,ch,gb,us), the country codes listed under a region, andphonefor both phone patterns. An unknown name is refused when the rule is saved. - A region includes identifiers added later. Each addition is listed in the changelog. Name identifiers one by one if a rule must not change on its own.
- A new app's PII rule starts with
email,phone,ssn,credit_card,iban; you add the others to the rule. - A rule that names nothing detects
email,phone,ssn.
How a match is confirmed
Where an identifier has a check digit or ranges that are never issued, a value of the right shape
counts only if it passes that check, so an order number or a timestamp of the same length is not
flagged. Where it has none, the format alone decides. An identifier whose format is shared with
ordinary numbers, and that has no check or one too weak to tell them apart, counts only after a word
that names it, on the same line, such as CPR before a Danish number or
BSN before a Dutch one; only the number is matched. Under
redact a
match is replaced with [REDACTED:pii]; under
block the request is refused.
Global
In a rule: global.
E.164: + and 7 to 15 digits, without spaces.
Visa, Mastercard, American Express and Discover numbers, with or without spaces or dashes, confirmed by the Luhn check digit.
Account numbers from the SEPA countries, written in capitals, as one run or in groups of four.
Four numbers from 0 to 255.
A date written after "DOB", "date of birth", "born on" or "birthday".
European Union
In a rule: eu, or one country:
at Austria, be Belgium, de Germany, ee Estonia, es Spain, fr France, ie Ireland, it Italy, nl Netherlands, pl Poland, pt Portugal.
eu also detects IBAN (bank account number), Danish CPR number, Finnish personal identity code (henkilötunnus), and Swedish personal identity number (personnummer), listed under their own regions.
Four digits and the date of birth after SVNR, VSNR, SV-Nr., SV-Nummer or (Sozial)versicherungsnummer on the same line, with its check digit.
YY.MM.DD-NNN.CC or eleven digits, with a month from 00 (unknown) to 12 and the mod-97 check digits (with a 2 in front for people born from 2000).
Eleven digits, optionally grouped 2-3-3-3. One digit appears two or three times in the first ten, and the last is a check digit.
Eleven digits: century and sex (3 to 6), a date of birth no later than today, a serial and a mod-11 check digit.
Eight digits and a check letter, in capitals. Also the Spanish tax number (NIF) of a person.
X, Y or Z, seven digits and a check letter, in capitals.
Fifteen digits with the key, spaced or not; 2A and 2B for Corsica. Provisional numbers (3, 4, 7, 8) included.
Seven digits and a check letter, optionally followed by A, B, H, W, T or X, in capitals.
Sixteen characters in capitals. Codes where letters stand in for digits (omocodia) included.
Nine digits after BSN, BSN-nummer or burgerservicenummer on the same line, passing the 11-proef.
Eleven digits: a date of birth from 1900 to today (the century in the month), a serial and a check digit.
Nine digits after NIF, NIPC or contribuinte (optionally followed by n.º) on the same line, with the mod-11 check digit.
The 27 member states' VAT numbers with their country prefix (EL for Greece), in capitals, optionally with a space after the prefix. Each is confirmed by that country's check.
Nordics
In a rule: nordics, or one country:
dk Denmark, fi Finland, is Iceland, no Norway, se Sweden.
DDMMYY-NNNN after CPR, CPR-nr. or CPR-nummer on the same line. Danish numbers have had no check digit since 2007, so a number on its own is not matched.
DDMMYY, a century sign, three digits and a check character, in capitals. Includes the century signs added in 2023.
DDMMYY-NNNN or ten digits. A person's number only: company numbers are not matched.
Eleven digits, optionally with a space after the date. D-nummer and H-nummer included.
YYMMDD-NNNN (+ from age 100) or with the century, YYYYMMDD-NNNN or twelve digits. Samordningsnummer included. Ten digits are matched only with the - or +.
Switzerland
In a rule: ch.
756 and ten digits, dotted or as one run, with the EAN-13 check digit.
United Kingdom
In a rule: gb.
Two letters, six digits and A to D after National Insurance, NI number, NI no. or NINO on the same line. Prefixes that are never issued are ignored.
Ten digits, optionally 3-3-4, after NHS, NHS number or NHS no. on the same line, with the mod-11 check digit.
United States
In a rule: us.
Ten digits, optionally separated by -, . or a space. The area code and exchange cannot start with 0 or 1.
Written with dashes. Numbers that are never issued (area 000 or 666, group 00, serial 0000) are ignored; ITINs are included.
Missing an identifier?
Tell us which one and where it is used at
support@signalvault.io.
Each identifier ships with tests of valid values, values that fail its check and look-alikes, and is
named in the changelog. Until then, a regex_match rule can match your
own format.