Skip to content

Redaction Presets

Nabeel Wasif edited this page Sep 29, 2026 · 2 revisions

Redaction Presets

A preset is a named set of detectors and categories, chosen at upload. It changes what is looked for and nothing else — not how removal works, not how verification runs, not what the export report records.

Canonical source: docs/presets.md. The data itself is lib/redaction/presets/presets.json.


The one thing a preset must not say

A preset called "HIPAA" that somebody applies and then believes they have a compliant document is a worse outcome than having no presets at all. It turns a tool that helps into one that misleads, on exactly the question where being misled is most expensive.

So presets are named for what they search for, never for what they achieve. And the rule is enforced rather than documented: a preset whose id, label or description contains a regulation's name or a compliance claim fails validation at import (lib/redaction/presets.ts).

A narrowed search is carried forward everywhere it matters, because a short list of removals means either a clean document or a narrow search, and those are not the same thing:

  • the caveat sits under the chooser,
  • the editor says which preset the document was analyzed with,
  • the export report records it.

categoryAllowed applies to model proposals too, not just to the deterministic detectors: the model's per-chunk text detections and its spreadsheet column judgements are both filtered by it, and so are detections written by the workflow's expansion path. Asking a model to stay inside the preset is not the same as it having done so, and a narrowed preset that the contextual pass ignored would be a preset in name only. See Security Model §8.

The disclaimer, verbatim

PRESET_DISCLAIMER is a constant, so it cannot drift between the places it appears:

A preset changes what we look for, not what you are responsible for. It is a starting point for your review — nothing here certifies a document, and anything a preset does not look for stays in the file.

Where What is shown
Upload panel the full disclaimer under the chooser, with the preset's "looks for" list
Workspace header "looked for ", so an empty inspector is not read as a clean document
Export report lookedFor { presetId, presetLabel, categories, narrowed }, plus a note when narrowed: anything outside them was never proposed, so its absence from these counts is not evidence it is absent from the file
Export dialog the same idea, before you download

presetNarrows keeps the warning honest: the default preset is still a choice you made, but it narrows nothing, so it shows no narrowing note. A warning that does not apply is how real warnings stop being read.


The five shipped presets

detectors: null and categories: null mean "no restriction" — every detector runs and every category is in scope.

Everything we can detect

The default. Every detector, contextual pass unrestricted.

Detectors all (null)
Categories all (null)

Looks for: email/phone/postal addresses, people's names and customer/patient-named organizations, government identifiers, payment cards and bank/account numbers, dates of birth and customer/case references, credentials and API keys and token-bearing links, faces and signatures in images.

Names and contact details

The things that identify a person directly, and nothing else.

Detectors email-address, phone-number, street-address
Categories person, address, phone, email, face

Looks for: people's names, email addresses and telephone numbers, postal and street addresses, faces and signatures in images.

Identifiers and dates

Reference numbers and dates that pin a record to a person.

Detectors us-social-security, labelled-reference, labelled-date-of-birth
Categories government-id, customer-id, date-of-birth

Looks for: government identifiers (e.g. Social Security numbers), customer / client / member / policy / case / patient references, dates labelled as a date of birth.

Payment and account numbers

Money: cards, bank accounts, and the numbers that reach them.

Detectors payment-card, iban, labelled-account-number
Categories financial, bank-account

Looks for: Luhn-valid payment card numbers, IBANs, numbers labelled as an account or sort code, financial facts tied to a named party.

Credentials and keys

What leaks out of engineering documents: secrets and private links.

Detectors credential, link-with-token
Categories api-key, url, confidential

Looks for: API keys, tokens and provider credential formats, links carrying a token / invite / reset path, text marked confidential or internal.


Adding or changing a preset

Presets are data, so changing what one covers is a reviewable diff rather than a code change.

  1. Edit lib/redaction/presets/presets.json.
  2. Give it an id, a label and a description that describe what is looked for. Anything naming a regulation or claiming compliance will fail import validation.
  3. List detectors and categories, or null for no restriction.
  4. Run pnpm test — preset validation is covered.

PRESET_DISCLAIMER (lib/redaction/presets.ts) is the text that travels with a narrowed preset. It exists so the narrowing is visible at the moment somebody is deciding whether the result looks complete.


Presets and the rest of the review

  • A preset narrows detection only. Search and rules are not limited by it: they match the pattern you type, so you can always find and redact something the preset did not look for.
  • The benchmark harness uses an internal preset with an empty detector list to measure "model-only" analysis. It is not a preset anyone can pick. See Testing and Benchmarks.

See also

Clone this wiki locally