Skip to content

Case study · Legal-tech · Privacy & Compliance

Multi-Jurisdiction PII Anonymization Engine for Court Decisions

A compliance-grade anonymization engine for legal case decisions. A triple-search architecture finds personal data that single-pass detection misses, reaching 98% detection accuracy with dedicated safeguards for minors and vulnerable parties.

Client
Legal-tech platform · French-language case law, Côte d'Ivoire & OHADA
Project
Legal Anonymization Engine
Status
Delivered
PII detection accuracy
98%
Independent search passes
3
Decisions anonymized before release
100%

The challenge

Court decisions are full of personal data: names of parties, witnesses and minors, addresses, ID numbers and financial details, often written inconsistently across thousands of documents and jurisdictions.

Publishing or indexing them safely demanded near-complete detection. A single missed name of a minor is a legal and ethical failure, so a simple named-entity pass was not enough.

anonymizer · triple-search
98% detection

Original

Le mineur Koffi A., domicilié à Cocody, rue des Jardins, représenté par sa mère Awa D.… K. Adjouaconfirme…

Anonymized

Le mineur [MINEUR 1], domicilié à [ADRESSE], représenté par sa mère [PARTIE B]… [MINEUR 1]confirme…

  • Pass 1Contextual entities (Claude)
  • Pass 2Patterns & identifiers
  • Pass 3Variants & later mentions

4 entities · 1 variant spelling caughtminor-protection rules applied

Illustrative interface · client data never shown

Architecture · 6 stages

  1. 01

    Parse

    Decision text and structure extraction

  2. 02

    Search 1

    Contextual entity detection with Claude

  3. 03

    Search 2

    Pattern and rule-based identifiers

  4. 04

    Search 3

    Document-wide variant and mention search

  5. 05

    Reconcile

    Merge passes, apply minor-protection rules

  6. 06

    Release

    Anonymized output to index and publication

The solution

I designed a triple-search architecture: three complementary detection passes run over every decision, and their results are reconciled so that an entity caught by one pass is masked everywhere it appears, including variant spellings and later references.

Claude handles the context-heavy judgment, such as telling a party's name from a street name, while rule-based and search-based passes enforce consistency across the full document.

Stricter rules protect minors and other vulnerable parties, and multi-jurisdiction privacy requirements are applied per document. The engine is the mandatory gate in front of the Data Greffe Justice platform: nothing reaches the index without passing through it.

Engineering highlights

  • Triple-search detection with cross-pass reconciliation
  • 98% PII detection accuracy on legal case decisions
  • Stricter masking rules for minors and vulnerable parties
  • Consistent masking of variant spellings and repeat mentions
  • Multi-jurisdiction privacy rules applied per document
  • Mandatory gate before indexing and publication

Technology

  • Python
  • Claude API
  • OpenAI
  • Elasticsearch
  • NER
  • Flask

Building something similar?

Get a candid view of the architecture, risks and timeline on a free 30-minute call, or ask the AI assistant how this approach would map to your project.

Book a discovery call
Available for new engagements

Have an AI initiative in mind? Let’s scope it in 30 minutes.

Free discovery call. You'll leave with a clear view of the architecture, risks and next steps, whether or not we work together. I reply within 24 hours.

Not ready to talk yet? Get an instant project plan.