Redaction policies

Start from a pre-defined Philterd redaction policy, then adapt it and apply it in Phileas, Philter, or PhiSQL.

A policy declares which types of sensitive information to look for and what to do with each one. It is the one thing every product shares: the same policy runs unchanged whether you embed Phileas in your own process or call Philter over HTTP.

Rather than writing one from scratch, start from a policy that already exists.

The policy library

The policies in pii-redaction-policies, Apache 2.0, are published as a browsable policy library with the full JSON for each.

CategoryIncludes
AI trainingLLM Training Data Preparation
Contact centerContact Center Call Recording Transcripts
EducationFERPA Student Records Redaction
FinanceGLBA Nonpublic Personal Information (NPPI) Redaction, PCI DSS Scope Reduction, and more
GeneralBrazilian Identifiers (CPF, CNPJ), Canadian Social Insurance Number (SIN) Redaction, and more
HealthcareClinical Notes De-Identification (Date-Shifted), HIPAA Safe Harbor De-Identification, and more
LegalBankruptcy Rule 9037 (FRBP 9037) Court Filing Redaction, FRCP 5.2 Federal Civil Filing Redaction, and more

Each page shows the policy JSON in full, so you can copy it directly or clone the repository and take the file.

Treat these as starting points, not compliance certifications. Detection is probabilistic, and you are responsible for validating a policy’s output against your own data.

Adapting a policy

A policy is a name plus a set of identifiers. Each identifier carries one or more filter strategies describing how to handle a match:

{
  "name": "default",
  "identifiers": {
    "ssn": {
      "ssnFilterStrategies": [
        { "strategy": "REDACT", "redactionFormat": "{{{REDACTED-%t}}}" }
      ]
    }
  }
}

The vocabulary is defined by the PhiSQL specification: 30 entity types and 14 strategies, consumed by both Phileas and Philter. REDACT, MASK, HASH_SHA256, and RANDOM_REPLACE cover most cases. ENCRYPT and FPE_ENCRYPT are the only reversible ones. The type system reference is the authoritative list.

Applying a policy

Where the policy lives differs by product, and it is the most common thing to get wrong.

Phileas takes the policy directly. Build it as a dict or object in your code, or load it from a file you manage. Nothing is registered anywhere.

Philter reads policies from /opt/philter/policies/. A fresh instance has none, so a filter request fails until you supply one. Mount a file at start, as the quickstart shows, then select it per request with ?p=.

PhiSQL compiles to the same JSON, so it is an authoring choice rather than a different format:

POLICY ssn_only;

REDACT SSN WITH MASK;

Referential integrity

Passing a context groups documents that belong together. Within one context the same input value maps to the same replacement, so relationships across documents survive redaction. Use different contexts when documents should not share replacements.

This is consistent pseudonymization rather than anonymization: values are replaced with stand-ins, and only the encryption strategies can be reversed.

Building and measuring

The Redaction Policy Editor builds policies visually if you would rather not hand-edit JSON.

Philter Scope scores a policy on precision and recall against gold-standard data, which turns tuning into something with numbers attached rather than a guess.