Case study · Private & Sovereign AI · Law 25
On-device AI for personal-information detection
Professional services · Canada
An autonomous AI component that finds 42 categories of personal information across thousands of documents — entirely inside the client’s environment, with no cloud, no external API and no LLM.
- 42 categories of personal information detected
- 100% on-premises, private environment
- 0 external API calls — no cloud, no LLM
Status In production
Context
A Canadian professional-services firm operates a document management platform holding thousands of client and internal documents. Québec’s Law 25 sets obligations for the protection of personal information; meeting them starts with knowing where that information lives. The firm needed a detection capability that would run entirely inside its own environment.
Challenge
Find personal information across thousands of heterogeneous documents — social insurance numbers, health-card numbers, medical conditions, banking identifiers and dozens of other categories — in French and English, with high precision, and without a single document being sent to a cloud service or an external API.
My role
Architecture and technology leadership: design of the detection pipeline and of the security model, delivery of the AI component with my team, and preparation of the architecture and code dossier for the client’s security review.
Architecture / approach
An autonomous AI service installed on a dedicated machine inside the client’s network. It reads the platform’s document queue, analyzes each document locally with four detectors running in parallel — two named-entity-recognition models, entity dictionaries and 79 pattern rules — then reconciles the candidates in three stages (merge, contextual validation, algorithmic checks) before writing the findings back to the platform. The design follows the four properties I use to evaluate sovereign AI: residency, isolation, model governance and accountability.
Technology
Frozen public NER models (CamemBERT for French, multilingual DistilBERT) compiled to Core ML for local inference on the machine’s neural engine; Python services (30,000+ lines) for document processing, classification and reconciliation; MariaDB integration with the platform; algorithmic validation of identifiers (Luhn, RAMQ, MRZ, IBAN).
Execution
Detectors were built and tuned category by category against the platform’s real document types, then assembled into the parallel pipeline and the three-stage reconciliation. The component was installed on the dedicated machine, connected to the document queue and delivered with a complete architecture and code dossier so that the client’s IT team could review it independently.
Constraints
No cloud, no external API, no large language model and no training on client data. A single outbound connection — to the client’s database. Bilingual documents, and identifier formats specific to Québec and Canada.
Business impact
42 categories of personal information detected automatically inside the client’s own environment. The component runs inside the client’s environment and was delivered with the architecture and code dossier for an independent security review by the client’s IT team.
Key takeaways
- Sovereignty is a set of verifiable properties; the simplest architecture that satisfies them is usually the right one.
- Frozen models combined with algorithmic validation give auditable behaviour that a general-purpose LLM cannot.
- Delivering the security-review dossier with the code — not after it — shortens the path to production.