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: an NER model runs in the browser and strips names before anything leaves the device.

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.

A free public version of this pipeline is now available: De-identify masks names and Australian identifiers in your browser before you paste text into any AI, and restores them locally afterwards.

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. What OpenAI, Anthropic, and Microsoft actually commit to, tier by tier, and what the Privacy Act requires on top of any vendor promise, is covered in Is it safe to paste client data into ChatGPT?

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, including hardware-secured enclaves, see What happens to your data when you press ‘Send’ on an AI tool.

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

Stay private. Protect your professional standing. De-identify is the free, browser-based version of the pipeline described in this post. Nothing you mask ever leaves your device.

Published 9 April 2026

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

Prepared by Claude, directed and approved by PAC.

More from Thinking

Building 7 min read

Why we let AI run the interviews (and why we never let it pretend to be human)

AI-conducted interviews compress weeks of stakeholder discovery into days, standardise what gets asked, and lower the guard that distorts honest answers.

Adoption 14 min read

How AI capability actually moves through a business

The decisive variable in SME AI adoption is the human absorption sequence, not the tooling. A working framework from observation across WA businesses.

Evaluation 7 min read

AHPRA advertising rules for psychologist websites

Recovery stories, 'specialist', 'clinical psychologist', and endorsement titles are where psychology sites breach the National Law. A practical read-through.

Adoption 6 min read

Customer service AI has finally grown up

Chatbots and AI receptionists earned their bad reputation. What changed, why the trick is in the data, and how the mature version answers every call without replacing anyone.

Evaluation 6 min read

Who can use the titles 'Dr', 'Specialist', and 'Surgeon'?

AHPRA restricts 'specialist' and 'surgeon' to specific registrations, and 'Dr' has its own rule. What health practice websites can and cannot claim.

Adoption 5 min read

Your best people hate writing reports

The operators you promote are brilliant at the work and allergic to reporting. A scheduled AI call interviews them, drafts the briefing, and they approve it. No ego, no politics, no blank page.

Building 6 min read

Your website isn't just for humans anymore

How to build a chatbot that keeps itself up to date, can't leak client information, and won't answer beyond what you've published. The answer was sitting in plain sight.

Evaluation 7 min read

Can you show Google reviews on your health practice website?

AHPRA bans clinical testimonials, even true ones, but service reviews are fine. What that means for the Google reviews widget on your practice site.

Evaluation 7 min read

What AHPRA's advertising rules mean for your website

Your practice website is advertising under the National Law. What AHPRA's rules prohibit, who is responsible, and how to check your own site.

Evaluation 8 min read

Is it safe to paste client data into ChatGPT?

What ChatGPT, Claude, and Copilot promise about your data, what the Privacy Act requires, and the honest answer for professionals handling client files.

Evaluation 6 min read

What a good AI audit actually delivers

The audit report named one recommendation specific enough to check. What the Build engagement that followed looked like, shown through one real engagement, generalised.

Evaluation 7 min read

AI and video, Mid-2026: the models can watch now, not just listen

AI could always transcribe video. It can now read the frames as well, and every hour of footage a business owns becomes something it can question.

Technical 5 min read

Why the privacy case against cloud AI memory isn't paranoia

An AI knowledge base concentrates everything sensitive a business holds. Dated 2026 incidents show what cloud custody means once legal process gets involved.

Technical 5 min read

Your AI knowledge base is an attack surface

A knowledge base an AI agent can read and write is a productivity tool, and dated 2026 incidents show it is also somewhere an attacker can plant instructions.

Adoption 5 min read

The real asset in an AI knowledge base isn't the notes

In every AI-maintained knowledge base, one file carries the owner's judgement and compounds. The wiki pages are the least valuable part.

Evaluation 5 min read

The missing measurement in the AI second-brain boom

Every claim about AI knowledge bases saving time is self-reported. The one controlled experiment measured token economics, not benefit.

Building 11 min read

From evidence base to delivery: a production AI methodology

How we delivered 34 evidence-anchored AI briefings to a WA peer-advisory chapter: fact-checked literature review, multi-agent verification, one method.

Technical 9 min read

The six functions of a working AI system

A working AI system is six functions doing six jobs. When all six connect, hallucinations get caught, outputs hold steady, and models become swappable.

Technical 7 min read

Supervised autonomy: the middle path for AI architecture

Between drafts you approve and agents you hope about sits the middle path: an envelope of authorised routine work, supervised, audited, and yours to widen.

Evaluation 5 min read

The state of applied AI in Mid-2026

Our literature review of applied AI in mid-2026: ten capability categories, three fact-check passes, written for operational leaders.

Evaluation 8 min read

AI in building inspections, Mid-2026

AI defect detection is strong on obvious defects and weak on the subtle ones where liability lives. Which capabilities fit inspection work in 2026.

Evaluation 8 min read

AI in property valuation, Mid-2026

AVMs are reliable enough for triage, not for the final word on contested property. What has shifted in valuation work by mid-2026, and what has not.

Evaluation 8 min read

AI in family law, Mid-2026

Federal Court practice note GPN-AI makes AI verification a professional obligation. What the courts now require, and what the evidence says about legal AI.

Technical 9 min read

How to design a PHI redaction system for clinical AI

PHI redaction is part of a clinical AI tool's architecture, not a feature you add. What the literature says it should look like, and how we built it.

Technical 7 min read

Your agency's clients are about to ask why this costs so much

A solo consultant built in three weeks what your agency quoted twelve for. The client doesn't know why yet. The agencies that survive change what they sell.

Adoption 6 min read

What do you love doing? What do you hate doing?

Ask people what they love doing and what they hate doing, then show them AI is coming for the second list. Why the reframe works, and how it fails.

Technical 7 min read

Why I don't use n8n (and what I do instead)

n8n 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 is an architecture story: codebases built for human maintainers only, now maintained by AI.

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 the fix.

Building 7 min read

Your $2,000 day starts the night before: our system keeps you on the tools, not on the phone

Optimised routes overnight, automatic customer notifications, and promises the system keeps or corrects. A scheduling system that protects your daily rate.

Evaluation 4 min read

The fastest way for an executive to get across AI

AI moves faster than any executive can track. One focused conversation, one written report, and a decision you can act on: your time stays on the business.

Building 6 min read

Your IT department will take 18 months. You need this working by next quarter.

Senior leaders know what they need built; the gap is time. A prototype gets the tool working now and hands IT a validated blueprint for later.

Adoption 4 min read

What if you had perfect memory across every client?

Every practice captures more than it can recall. AI gives practitioners perfect memory across every client, so preparation becomes thinking 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. Why document analysis alone cannot stop fraud, and the five layers that can.

Building 5 min read

How to build an AI chatbot that doesn't lie to your customers

Woolworths scripted its AI to talk about its mother. The business fix is honesty; the technical fix is architecture that prevents fabrication by design.

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. The difference matters wherever 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 scripted to talk about its mother and uncle. When callers realised, trust broke instantly. The fix is honesty.

Evaluation 5 min read

Google is no longer the only way your customers find you

Customers now find businesses through ChatGPT, Perplexity, and Gemini. The sites AI cites are structured differently to the sites Google ranks.

Evaluation 4 min read

Two types of AI audit: and how to know which one you need

Where do we start with AI? It depends on whether you need to find the opportunities or reclaim the time. Two audits, two perspectives, one goal.

Evaluation 4 min read

The personal workflow analysis: what watching a real workday reveals about automation

People describe the work they value, not the work that eats their time. Recording a real workday reveals the automation opportunities interviews miss.

Evaluation 4 min read

AI audit that starts with your business

An operations-first AI 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 a demo and a working system is where the useful lessons live. Architecture, framing, privacy, adoption: the patterns repeat 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. Five predictable psychological barriers, each with a strategy that works.

Technical 4 min read

Stop telling AI what NOT to do (and what to say instead)

Instructions built on prohibitions make AI cautious and generic. Describing what you want instead transforms the output, and the reason comes from psychology.

Building 5 min read

How we turned generic AI into a specialist: and what that means for your business

Mediocre AI output is rarely the model's fault. Three structural changes that turn the same model from generic to specialist-grade.

Evaluation 5 min read

Your business has 9 customer touchpoints. AI can fix the 6 you're dropping.

You pay to get customers to your door, then lose them to missed follow-up. AI can handle the six touchpoints most businesses drop.

Technical 5 min read

What happens to your data when you press 'Send' on an AI tool

Businesses send customer data to AI tools without knowing what happens during processing. The spectrum of AI privacy is wider than you think.