Building 9 min read

How We Built On-Device De-Identification So AI Never Sees Real Names

Most AI privacy is a policy. Ours is architecture. We run a named entity recognition model inside the browser to strip identifying information before it ever leaves the device. Here is how it works, what we tested, and where it applies.

An executive coach types session notes into a platform. The notes contain names, company details, family circumstances, health disclosures, financial figures, psychometric scores. The coach clicks “Generate Brief” and receives a pre-session coaching analysis that references every relevant pattern across months of sessions.

At no point did any of that identifying information leave the coach’s device.

The AI that generated the brief never saw a real name. It saw tokens: PHI_4fce, PHI_b2e1, PHI_c9d4. It analysed the relationships between facts, tracked patterns across sessions, identified avoidance behaviours and developmental arcs — all without knowing who any of it was about. The real names were swapped back in after the AI responded, inside the browser, before the coach saw anything.

This is not a privacy policy. It is a privacy architecture. And as far as we can determine, running a named entity recognition model inside the browser for real-time de-identification before any AI call has not been done before at this level.

Why most AI privacy is not privacy

When a business uses an AI tool with sensitive data, the standard approach is one of three things:

Policy-based privacy. The provider promises not to train on your data, not to retain it, not to share it. This is a contractual assurance. It depends on the provider honouring the contract, not being compelled by law enforcement, not suffering a breach, and not changing their terms.

Server-side de-identification. The data is sent to a server where identifying information is stripped before being passed to the AI. This is better than nothing, but the server sees the data in plaintext. The de-identification happens after the data has already left your environment.

Trusted execution environments. The data is processed inside hardware-secured enclaves where even the infrastructure provider cannot access it. This is strong protection, but it depends on trusting the hardware vendor’s attestation and adds infrastructure complexity.

Each of these has legitimate uses. But none of them solve the fundamental problem: the data leaves the user’s device in identifiable form.

What we built instead

We run the de-identification inside the browser. The identifying information is stripped before the data ever leaves the device. The platform, the server, the AI provider — none of them ever see real names.

The system has three layers. Each one catches a different type of identifying information, and they run in sequence.

Layer 1: Regex — structured identifiers

The first pass catches data that follows predictable patterns: phone numbers (Australian and international formats), email addresses, street addresses, dates of birth, government identifiers (Medicare, ABN, SSN, NHS numbers), and LinkedIn URLs. The pattern library was originally built for Australian data and has since been expanded to cover international formats for the CoachIQ platform. These are deterministic — a phone number looks like a phone number — so pattern matching is fast and reliable.

Every match is replaced with a deterministic token. The same input always produces the same token, which means “Geoff Hartley” is always PHI_4fce across every session, every document, every report. This consistency matters; without it, the AI would see what looks like a different person in each session and lose the ability to track patterns over time.

Layer 2: NER — natural language entities

Regex catches structured data, but it cannot catch a name mentioned in a sentence. “Geoff mentioned he’s been avoiding the conversation with Dave about the CFO hire” contains two names that no pattern can reliably match without understanding language.

This is where the named entity recognition model runs. We load a BERT-based NER model (Xenova/bert-base-NER) directly into the browser using Transformers.js. The model runs as WebAssembly — no server call, no API, no data leaving the device. It processes each paragraph of text, identifies person names, organisation names, and location names, and adds them to the token map.

The model is small (under 50MB), loads once, and caches in the browser. It preloads in the background on login so there is no delay when the user first generates a report. Its only job is spotting proper nouns. It does not do clinical reasoning, sentiment analysis, or anything else. One model, one task, running locally.

We maintain a false-positives list — words the NER model frequently misclassifies as entities. In coaching data, terms like “coach”, “advisor”, “driver”, “achiever”, “commander”, “integrity” and “legacy” regularly trigger false matches because they appear as capitalised role descriptors or psychometric profile labels. The list currently contains 24 terms and grows as we encounter new domain-specific misclassifications.

Layer 3: Propagation — context sweep

After regex and NER have built the token map, the third layer sweeps the entire text for any remaining instances of values already in the map. If NER caught “Dave Mitchell” in one paragraph, the propagation pass ensures that “Dave” appearing alone three paragraphs later is also masked.

This handles the common pattern where a full name appears once and then the person is referred to by first name throughout. Without propagation, those subsequent references would leak through.

The sweep processes entries longest-first to prevent nested replacements, and uses word-boundary matching to avoid replacing “Lisa” inside “Lisabel” or similar substring collisions.

What the AI actually sees

When the coach requests a pre-session brief, the platform concatenates all session data for that member, runs the three-layer pipeline, and sends the masked data to the AI. A coaching session that reads:

Geoff mentioned he’s been avoiding the performance conversation with Dave Mitchell. Lisa thinks the CFO hire needs to happen before Q3. Revenue at Hartley Civil Engineering is tracking at $28.5M but EBITDA has dropped to 8.2%.

Becomes:

PHI_4fce mentioned he’s been avoiding the performance conversation with PHI_f3c7. PHI_d1f8 thinks the CFO hire needs to happen before Q3. Revenue at PHI_c9d4 is tracking at $28.5M but EBITDA has dropped to 8.2%.

The AI analyses the patterns, generates the brief, and returns text containing the same tokens. The browser then swaps the tokens back to real names before the coach sees the output. The coach’s experience is seamless — they see real names throughout and never interact with the masking system.

One line in the AI system prompt handles the model’s side: “PHI values in this data have been masked using deterministic token replacement (PHI_XXXX format). Return all PHI values as provided — do not substitute or invent replacements.”

What we tested

We ran a structured validation using realistic coaching session data spanning three sessions. The test document contained session notes, psychometric profiles (REACH assessment), values inventories, commitment tracking, group dynamics observations, financial snapshots, and personal context.

We generated the same pre-session coaching brief under two conditions: fully masked data and original unmasked data. The outputs were compared across five analytical dimensions:

  • Pattern recognition across sessions
  • Commitment tracking and follow-through analysis
  • Session-over-session trajectory and score trends
  • Psychometric integration (REACH profile mapping to coaching behaviour)
  • Coaching question generation

The finding: analytical fidelity loss between the two outputs was minimal. The AI produced equivalent quality analysis with or without real names. It does not need identifying information to deliver intelligence. It needs the relationships between facts, not the labels.

The limitation we documented

The test also revealed something we chose to document openly rather than ignore.

Even with all names and identifiers stripped, the combination of contextual facts — industry, revenue band, staff count, family details, geographic indicators, psychometric scores — can create a unique fingerprint. Someone with domain knowledge could potentially narrow identification from context alone. A peer in the same industry and region, seeing a masked profile that matches someone they know, could make the connection.

This does not invalidate de-identification. It means masking is a strong layer of protection but not a guarantee of anonymity against a motivated, knowledgeable observer. This is consistent with the privacy literature on re-identification risk in rich datasets. We consider it important to be honest about this boundary rather than imply that de-identification equals anonymity.

For applications where even contextual fingerprinting is unacceptable, the architecture supports an additional layer: hardware-secured confidential computing via trusted execution environments. PHI masking combined with TEE processing means that even if the hardware enclave were compromised, the attacker gets only tokenised data. Defence in depth.

Where this applies beyond coaching

We built this for executive coaching. But the architecture is domain-agnostic. The three-layer pipeline works on any text where identifying information needs to be stripped before AI processing.

Clinical psychology and counselling. Session notes, treatment plans, progress notes. Therapists need AI to help with documentation but cannot send client names to an API. This is already running in production across two platforms: ConfideAI for mental health professionals and MycenAI for psychedelic-assisted therapy practitioners.

Legal. Case notes, client correspondence, litigation strategy documents. Legal privilege depends on confidentiality. A lawyer who sends client names to an AI provider has a privilege problem. On-device de-identification means the AI analyses the legal reasoning without ever knowing who the client is.

Accounting and financial services. Client financial data, tax structuring advice, AML/CTF documentation. Regulatory obligations around client confidentiality are explicit. De-identified data can be processed by AI without triggering data handling obligations that apply to identified data.

Any professional seeking AI assistance on a sensitive matter. A business owner who wants to use AI to think through a dispute, a medical situation, or a personal legal matter — without creating a record of that information on a third-party server.

The pattern is the same every time. Sensitive data exists locally. AI analysis would be valuable. The barrier is that sending the data to an AI provider creates a confidentiality risk. On-device de-identification removes that barrier architecturally, not contractually.

The architecture decision that makes this possible

The reason this works in the browser is a decision made early: the NER model’s only job is entity detection. It does not do any of the analytical work. It spots proper nouns and adds them to a map. That task is small enough for a compact model running as WebAssembly.

The analytical work — pattern recognition, trajectory analysis, coaching intelligence — is done by a large language model via API, but that model only ever sees tokens. The division of labour is clean: a small local model handles identification, a large remote model handles analysis, and the two never share real data.

This separation is what makes the architecture portable across domains. The NER model does not need to understand coaching, or law, or clinical psychology. It needs to understand that “Dave Mitchell” is a person and “Hartley Civil Engineering” is an organisation. The domain expertise lives in the prompts and templates, not in the de-identification layer.


For more on how we approach data handling across AI systems, see What Happens to Your Data When You Press ‘Send’ on an AI Tool. For the broader privacy architecture including hardware-secured enclaves, see Why AI Safety Features Are Load-Bearing Architecture.

If your practice handles sensitive data and you want AI analysis without the confidentiality risk, start with a conversation.

Published 9 April 2026

Perth AI Consulting delivers AI opportunity analysis for small and medium businesses. Start with a conversation.

Written with Claude, Perplexity, and Grok. Directed and edited by Perth AI Consulting.

More from Thinking

Building 8 min read

Your Practice Needs an AML/CTF Program by July 1. Here's What That Actually Looks Like.

AUSTRAC's Tranche 2 reforms hit accountants, real estate agents and settlement agents on 1 July 2026. We built a complete compliance program for a small practice in three days. Here's the process, the output and the boundaries.

Technical 7 min read

Your Agency's Clients Are About to Ask Why This Costs So Much

A solo consultant just built in two weeks what your agency quoted eight for. The client doesn't understand AI yet; but they will. The agencies that survive aren't the ones that cut costs. They're the ones that change what they sell.

Adoption 6 min read

What Do You Love Doing? What Do You Hate Doing?

Most AI rollouts fail the same way. Leadership announces efficiency. Staff hear replacement. A developer at a recent peer group meeting offered a reframe that changes everything; the psychology of why it works tells you how to deploy AI without destroying trust.

Technical 7 min read

Why I Don't Use n8n (And What I Do Instead)

If you've been pitched an AI system recently, there's a good chance you saw n8n in the demo. It demos well. But a compelling demo and a reliable production system are different things; and the distance between them is where businesses get hurt.

Technical 10 min read

Your Codebase Was Not Built for AI. That's the Actual Problem.

Amazon's mandatory meeting about AI breaking production isn't an AI tools story. It's an architecture story. The codebases AI is being pointed at were never designed to be understood by anything other than the humans who built them.

Adoption 4 min read

Your Team Has AI Licences. You Don't Have an AI System.

Fifteen people, fifteen separate AI accounts, no shared context. The problem isn't the tool; it's the architecture around it. Here's what fixing it looks like.

Building 7 min read

Your $2,000 Day Starts the Night Before: Our System Keeps You on the Tools, Not on the Phone

Your route is optimised overnight. Your customers are notified automatically. When something changes mid-day, every affected customer gets told without you picking up the phone. A tradie scheduling system that protects your daily rate.

Evaluation 4 min read

The Fastest Way for an Executive to Get Across AI

AI is moving faster than any executive can track. The alternatives: learning it yourself, sitting through vendor pitches, hiring a consultant who arrives with a hammer, all waste your scarcest resource. There is a faster way.

Building 6 min read

Your IT Department Will Take 18 Months. You Need This Working by Next Quarter.

Senior leaders often know exactly what they need built. The gap isn't technical; it's time. A prototype approach gets the tool working now and gives IT a validated blueprint to build from later.

Adoption 4 min read

What If You Had Perfect Memory Across Every Client?

Any practice managing dozens of ongoing client relationships captures more than it can recall. AI gives practitioners perfect memory across every interaction, so preparation time becomes thinking time, not retrieval time.

Building 8 min read

We Built an AI Invoice Verifier. Here's Where It Hits a Wall.

We built an AI invoice verifier and watched a fake beat a real invoice. Here's why document analysis alone cannot stop invoice fraud; the five layers of detection that most businesses never reach.

Building 5 min read

How to Build an AI Chatbot That Doesn't Lie to Your Customers

Woolworths deliberately scripted its AI to talk about its mother. The business fix is simple: be honest about the bot. The technical fix is harder: architecture that prevents fabrication by design, not by hope.

Technical 9 min read

Why AI Safety Features Are Load-Bearing Architecture, Not Political Decoration

The 'woke AI' label came from real failures; but they were engineering failures, not safety failures. Understanding the difference matters for every organisation deploying AI where errors have consequences.

Adoption 3 min read

Woolworths' AI Told a Customer It Had a Mother. That's a Problem.

Woolworths' AI assistant Olive was deliberately scripted to talk about its mother and uncle during customer calls. When callers realised they were talking to an AI pretending to be human, trust broke instantly.

Evaluation 4 min read

Google Is No Longer the Only Way Your Customers Find You

People are using ChatGPT, Perplexity, and Gemini to find businesses. The sites that get cited are structured differently to the sites that rank on Google. Most businesses are optimising for one and invisible to the other.

Evaluation 4 min read

Two Types of AI Assessment: And How to Know Which One You Need

Most businesses considering AI face the same question: where do we start? The answer depends on whether you need to find the opportunities or reclaim the time. Two assessments, two perspectives, one goal.

Evaluation 4 min read

The Personal Workflow Analysis: What Watching a Real Workday Reveals About Automation

When asked how they spend their day, most people describe the work they value, not the work that consumes their time. Recording a typical workday closes that gap, revealing automation opportunities no interview could surface.

Evaluation 4 min read

What a Good AI Audit Actually Delivers

A useful AI audit produces two things: a written report with specific, costed recommendations and a working prototype you can test. Not a slide deck. Not a proposal for more work.

Evaluation 4 min read

Your Website Looked Great Five Years Ago. Now It's Costing You Customers.

The signals that used to build trust online (polished design, stock imagery, aggressive calls to action) now trigger scepticism. Most businesses don't realise their digital presence is working against them.

Evaluation 4 min read

AI Audit That Starts With Your Business

Most AI consultants arrive with a toolkit and look for places to use it. An operations-first audit starts with how your business actually runs, and only recommends AI where the evidence says it will work.

Building 6 min read

What Production AI Teaches You That Demos Never Will

The gap between AI that works in a demo and AI that works in your business is where the useful lessons live. Architecture, framing, privacy, and adoption; the patterns are the same every time.

Adoption 6 min read

The Psychology of Why Your Team Won't Use AI

You buy the tool, run the demo, and three months later nobody is using it. The reason is not the technology; it is five predictable psychological barriers. Each one has a specific strategy that overcomes it.

Technical 4 min read

Stop Telling AI What NOT to Do: The Positive Framing Revolution

Most businesses get poor results from AI because they instruct it with constraints and prohibitions. Switching from negative framing to positive framing transforms output quality, and the principle comes from psychology, not computer science.

Building 5 min read

How We Turned Generic AI Into a Specialist: And What That Means for Your Business

Most businesses get mediocre AI output and blame the model. The fix is almost never a better model; it's a better architecture. Three structural changes that transform AI from 'fine' to 'actually useful.'

Evaluation 5 min read

Your Business Has 9 Customer Touchpoints. AI Can Fix the 6 You're Dropping.

You are spending money to get customers to your door. Then you are losing them because you cannot personally follow up with every lead, nurture every client, and ask for every review. AI can handle the touchpoints you are dropping: quietly, consistently, and at scale.

Technical 5 min read

What Happens to Your Data When You Press 'Send' on an AI Tool

Most businesses are sending customer data, financials, and internal documents to AI tools without understanding what happens during processing. The spectrum of AI privacy protection is wider than you think; recent research shows that even purpose-built security can have structural flaws.