Naming rules
Many organizations name documents by a set pattern, built around a matter number, a client code, a chart number, or a part number. A naming rule describes that pattern, piece by piece, so that Sanitized AI can:
- Flag a file whose name follows the pattern when someone attaches it to an AI tool, even when the extension can’t read what’s inside, such as a CAD drawing or an encrypted archive.
- Find the reference number, such as MAT-2026-0142 in
MAT-2026-0142_Tremblay_Requete_v2.docx, wherever it appears in a prompt or in a file’s text. - Find a file name that follows the pattern when someone types or pastes it into a prompt, such as Can you summarize MAT-2026-0142_Tremblay_Requete_v2.docx?
You don’t write patterns or code. You choose the pieces, and then try them on your own file names before you save.
Create a naming rule
-
On the Guardrails page, open Guardrail Catalog, and then click New naming rule.
-
In Start from, choose the template closest to how you name files, or Blank:
Template Example file name Law firm matter number MAT-2026-0142_Tremblay_Requete_v2.docxClinic chart number PT-0012345_lab_results.pdfAccounting client file CLT-00421_T2_2025.pdfEngineering part drawing 4410-223-01_RevC_bracket.dwgTo start from your own names instead, choose Paste example names, paste a few real file names that follow your convention, one per line, and click Fill in the pieces. The pieces are worked out in your browser, and only the pieces are saved, not the names.
-
Enter a Name and a Description, for example Client matter files.
-
Change the pieces to match your own names. See Describe the pieces.
-
Try the rule on a few real file names. See Test before you save.
-
Click Save.
The rule appears in Guardrail Catalog with a Naming rule badge. To change it later, click the pencil icon next to it.
Describe the pieces
Under Pieces, list the parts of a file name in the order they appear. Each piece has a Type:
| Type | What it matches | Example |
|---|---|---|
| Fixed text | The same text every time | MAT |
| Letters | Letters only, between a Min and a Max length | QC |
| Digits | Digits only, between a Min and a Max length | 0142 |
| Letters and digits | Letters or digits, between a Min and a Max length | T2 |
| Year | A four-digit year, from 1900 to 2099 | 2026 |
| Date | A date, in the Format you choose | 20260314 |
| Free text | Any text, such as a client’s name or a document title | Tremblay |
| Version | A version mark that starts with v, ver, or rev | v2, RevC |
| Separator | A dash, underscore, dot, or space, or any of these | _ |
Then:
- Select Optional for a piece that’s sometimes missing, such as a version at the end of the name.
- In File extensions, list the file types the rule covers, separated by
commas, such as
pdf, docx. Leave it empty to cover every type. - In Look for it in, choose File names only, Prompts and file text only, or File names, prompts and file text.
Upper and lower case don’t matter. Copies that browsers and file managers make, with names ending in (1) or - Copy, match too.
Describe the reference number
If the rule looks in prompts and file text, select
Part of the reference number for each piece of the number. In the law firm
template, those are MAT, the year, the four digits, and the dashes between
them. The pieces must sit next to each other, and Free text can’t be part
of the number.
Under Reference number:
- What it’s called: the name shown when the number is found, such as Matter number. Optional: add a French name in What it’s called in French. People who use Sanitized AI in French see it instead.
- Nearby words: words that usually appear near the number, such as matter or file, separated by commas. Add French words, such as dossier, in Nearby words in French.
- Nearby words are: choose Helpful, not needed to count the number either way, or Required to count it only when a nearby word is close by.
A number with no fixed text, such as a part number made only of digits, looks like many ordinary numbers. It needs nearby words, and it only counts when one of them is close by.
Test before you save
Under Try it:
- In File names to test, one per line, paste a few of your real file names. Each one shows Matches or No match.
- In Text to test, paste a sentence that mentions a reference number. The numbers found are listed after Found:. File names in the sentence are listed after File names found:.
A file name typed in a prompt is only looked for when the pattern is specific
enough to tell it apart from ordinary text. If Try it says File names
typed in text aren’t looked for, add a piece of fixed text, such as MAT, or
another Separator. Attached files are still checked either way.
Try it also shows an example name and an example reference number built from your pieces. What you type in Try it stays in your browser: it isn’t saved or sent to Sanitized AI.
If the dialog shows Can’t save yet:, it lists what to fix. A common one is These pieces could split a name too many ways. It means two pieces of varying length sit side by side, so add a Separator between them.
Choose what happens
A naming rule has an enforcement action like any other guardrail. Change it in the Enforcement column of Guardrail Catalog. For a file whose name matches:
| Action | What happens |
|---|---|
| Monitor | Nothing is shown. The match is recorded on the Events page. |
| Nudge | The file is held back with Sensitive Data Detected in File. The person can choose Remove File or Send Anyway. |
| Block | The file is held back with Blocked by Policy, without Send Anyway. |
A reference number found in a prompt is handled like any other flagged data. See Enforcement actions.
Rate the rule
To give the rule a severity, click the pencil icon next to it and choose a Severity, from Low to Critical. A new rule starts at Not set. The rating shows in Guardrail Catalog and weighs the rule’s matches in your risk scores. When the rule’s action is Default, the rating also picks it: High and Critical block, and the others nudge.
What people see
In the file warning, File name means the file’s name matched. In a prompt warning, File name means a matching file name was typed in the prompt. Sanitize Prompt replaces it like any other flagged value. When the reference number is in the file’s text, the warning shows the name you gave the number, such as Matter number.
A matching name counts even when the extension can’t read the file, for example a CAD drawing or an encrypted archive:
- With Nudge or Block, people see the warning for that action instead of File Could Not Be Scanned.
- With Monitor, people still see File Could Not Be Scanned. If they choose Send Anyway, the match is recorded.
If naming rules are turned off
If Sanitized AI turns naming rules off for your organization, your rules stop checking, but they’re kept. New naming rule disappears, and in an existing rule you can change only its name, description and severity. The rules work again as soon as naming rules are turned back on.
What’s stored
Sanitized AI stores the pieces you describe, not your file names. When a naming rule flags a file, the event records the file’s name and the rule that matched, as for any flagged file, unless your organization masks file names: the event then keeps only the file type. See File names in events. The file’s contents are never stored. See Privacy.