How to evaluate PII redaction: precision, recall and useful remaining context
Measure missed sensitive spans and unnecessary redaction with a worked example, synthetic fixtures and downstream usability checks.
Define the redaction task precisely
A redaction evaluation begins with a field policy: which types of content should be removed, under which task conditions and for which audience? Define how reviewers mark spans, including punctuation, partial identifiers and repeated mentions. Distinguish a requirement to remove direct identifiers from a broader requirement to minimize context. Neither can be measured by searching for one placeholder string. The workflow below uses invented examples and hypothetical counts. It is an engineering evaluation method, not a claim that one score establishes legal compliance or that removing names makes every document anonymous.
Create fixtures that reveal different failures
Build synthetic documents containing known target spans across ordinary text, tables, OCR-like formatting and repeated fields. Include confusing non-target material such as product numbers that resemble identifiers. Use recognizable markers whose presence can be checked without introducing real personal information. Have reviewers agree on the expected spans before running the redactor. Group fixtures by entity type and document condition. A system that succeeds on clean forms may behave differently on a line break inside an address. Preserve these distinctions in the result rather than allowing a large easy group to hide a failure in a smaller, consequential group.
Calculate precision and recall with a fixed matching rule
In a hypothetical exact-span evaluation, the reference contains 200 spans that require redaction. The system proposes 190 spans, of which 185 exactly match the reference. There are five false positives and fifteen missed reference spans. Precision is 185 divided by 190, about 97.4%; recall is 185 divided by 200, or 92.5%. Report the matching rule with the numbers. A partially covered identifier may need a separate failure category, and switching to overlap-based scoring changes what a match means. Do not quietly change the scorer to make a new version look better. Keep the underlying counts so another reviewer can reproduce the result.
Measure the cost of excessive removal
Run a separate task-utility review on the redacted documents. For a synthetic support-routing workflow, check whether a reviewer can still identify the product, problem and requested action without seeing the targeted identifiers. A document that contains no useful text may pass a simple sensitive-string search while failing the business purpose. Record cases where redaction removes evidence required for a label or answer. Decide whether those cases need a different data view, a revised task or a scoped reviewer permission. Do not solve an unnecessary redaction by exposing the original document to everyone who consumes the processed export.
Follow the transformed record through the system
Place a unique invented marker in a source document and trace the record through preview rendering, extraction, redaction, review, logging and export. Verify which components intentionally retain the original and who can access it. Search the resulting test artifacts for the marker using an authorized process. A correct final preview does not demonstrate that a diagnostic trace or cached attachment contains the same transformed version. Record the surfaces inspected and the ones outside the test’s scope. Use synthetic material so the exercise can be repeated after changes without creating another collection of sensitive evidence.
Choose release criteria by failure category
Set acceptance conditions before comparing versions. These may include no missed spans in a defined critical fixture group, a minimum recall on a reviewed evaluation set and a separate utility threshold. Such conditions are project decisions, not universal safety guarantees. Inspect every new failure in a sensitive slice and document remaining limitations. Keep scorer version, fixture version, redactor configuration and actual counts with the release record. Reevaluate when input formats or audiences change. A useful report explains which failures remain possible and what happens when they occur, rather than reducing the entire workflow to one flattering percentage.