Skip to content

Examples

This page is generated from the PhiSQL spec artifacts for v1.0. Do not edit it by hand; change the artifact and rebuild.

38 worked examples, each a PhiSQL source paired with the redaction policy JSON it compiles to. Every example is parsed by the reference implementation's test suite on each build. Grouped by the spec version that introduced it.

v1.0

Example Description
01-ssn-only Minimal PhiSQL example: redact U.S. Social Security Numbers
02-hipaa-safe-harbor HIPAA Safe Harbor de-identification (45 CFR 164.514(b)(2))
03-pci-dss-scope-reduction PCI DSS v4.0 Req 3.2-3.4: PAN to last 4 only, full CVV redaction
04-frbp-9037 FRBP 9037: redaction requirements for federal bankruptcy filings
05-support-tickets-with-allowlist Customer support ticket redaction with an allowlist for company names
06-multi-strategy-on-one-entity Two strategies on the same entity. Demonstrates that strategies arrays
07-format-preserving-encryption Format-preserving encryption preserves the surface format of an identifier
08-multiple-confidence-thresholds The same entity with different strategies at different confidence bands
09-ignore-pattern-policy-wide Policy-wide regex ignore. Useful for suppressing detections in known
10-mask-with-format-argument Custom redaction format. The %t placeholder is replaced by the entity
11-policy-wide-ignore-terms Policy-wide ignore terms. Without a FOR clause, IGNORE TERMS
12-date-shift Date shifting: move every detected date by a fixed offset
13-custom-identifier Custom identifier: define a regex pattern and redact what it matches
14-pheye-person-detection PhEye (AI/NER) detection: detect person names with the PhEye model and
15-find-pii-s3 Discovery: find SSN and credit card data in an S3 bucket, filtered to
16-discover-entities-gcs Discovery: discover any high-confidence PII in a Google Cloud Storage prefix
17-scan-azure-blob Discovery: scan an Azure Blob Storage container for all PII. No WHERE
18-find-pii-local-filesystem Discovery: find a curated set of PHI-relevant entities on a local
19-select-findings-groupby Discovery: query historical findings from the Phinder findings store,
20-crypto-encryption AES-GCM encryption (CRYPTO_REPLACE). The encryption key is read from an
21-date-relative Relative date redaction: replace each detected date with a date expressed
22-custom-dictionary Custom dictionary: detect a user-defined list of terms and redact them
23-section-redaction Section redaction: redact everything between a start and end regex pattern
24-config-settings Global configuration blocks. Each CONFIGURE ( ... ) form sets the
25-graphical-boundingbox Graphical redaction: draw fixed bounding boxes over regions of an image or
26-filter-options Per-filter OPTIONS: set arbitrary leaf properties on the filter a statement
27-strategy-params Strategy passthrough: any strategy property can be set by its Phileas schema
28-nested-options Nested OPTIONS values: objects ( k = v, ... ) and arrays [ ... ] let PhiSQL

v1.1.0

Example Description
identifier-validator Identifier checksum validation. A custom identifier can name a built-in
pheye-local-model Local on-device GLiNER inference. Point PhEye at a local model directory

v1.2.0

Example Description
component-ids PII-safe log references. An operator-assigned id on a filter or a strategy
ein EIN (Employer Identification Number) filter. A first-class entity type for the
generator-fallback MAP_REPLACE with a local-LLM generator fallback. When a detected value is not
map-replace-table Deterministic, caller-controlled substitution. MAP_REPLACE replaces a
pdf-strategy-color Per-strategy PDF bar color. An optional color on a strategy sets the color
phone-region Phone number detection for specific locales. The phone filter interprets
span-disambiguation Opt out of span disambiguation. The context-vector step that resolves
splitting-overlap Overlapping split chunks. When a large document is split for filtering, an