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.

A psychologist drafts a progress note. It contains their client’s name, date of birth, employer, GP, partner’s name, and four sessions of clinical reasoning about a complex presentation. They click “Generate progress letter.” Two minutes later they have a clean, well-structured document ready to send to the referring GP.

The question that matters: where did the names go?

If the answer is “they were sent to an AI provider in plaintext along with the rest of the note,” that practitioner has a problem. Not a hypothetical problem: a regulatory one. AHPRA and the Psychology Board’s Code of Conduct require clinicians to protect client information across every system they use. The Australian Psychological Society’s recent guidance on integrating AI into practice is explicit that the choice of tool, including its data handling, is the practitioner’s responsibility.

PHI redaction is the architectural answer to that responsibility. It is not a feature you add to a clinical AI product. It is part of how the product is built, or it is missing.

This post is a design framework for clinical PHI redaction: what the components are, why they need to work together, and how we applied the framework to ClientJourney, the CBT-committed clinical AI tool we are preparing for UAT.

Why this matters more for clinical AI than other AI

There are three reasons clinical AI is a harder case than the generic “is it safe to paste this into ChatGPT” problem most businesses are working through.

The regulatory bar is higher. AHPRA and the Psychology Board do not care whether your AI tool has a strong privacy policy. They care whether client information was handled appropriately. A privacy policy is a promise. Architecture is a fact. Practitioners cannot point to a contract with an AI provider as evidence of compliance; they need to be able to demonstrate that PHI did not leave the boundary in identifiable form.

The downstream content is generative. A clinical AI tool generates an entire document (a progress letter, an intake assessment, a discharge summary) that the practitioner then reviews and sends. If the AI hallucinates a fact, attaches a real name to it, and the practitioner does not catch the error, the consequences compound. Hallucination plus identity is doubly harmful in clinical contexts.

The trust gap is wider. Clinicians are, correctly, sceptical of AI. The tools that earn trust in this space are the ones that respect the practitioner’s professional obligations rather than asking them to take privacy on faith. The audience for clinical AI reads documentation before they sign up.

What the literature says about redaction

We commissioned a literature review on local PHI masking before we built ClientJourney’s redaction layer. The review is published alongside this post as a resource. Seven principles emerged consistently across the academic record (Uzuner et al., 2007; Dehghan et al., 2015; Dernoncourt et al., 2017; Moore et al., 2023).

  1. Layered systems outperform single-technique systems. No single approach (pattern matching, statistical models, neural language models) covers every category of identifying information well. The strongest systems combine multiple techniques because different categories of identifying information fail in different ways.
  2. Catching the whole name matters, not just most of it. A system that masks the first name but misses the surname has still leaked a name. Privacy-critical evaluation has to measure whole-entity success, not partial credit. “Got most of the letters” is not the same as “got the name.”
  3. Performance has to be broken down by category, not averaged. A system can report 95% accuracy overall and still miss half the names if names are a small share of total identifying information. Per-category breakdown (names separately, dates separately, organisations separately) is the only way to see where the system is actually weak.
  4. Better to over-mask than under-mask. A missed name leaves identifying information in the text. An over-masked word removes content that did not need to be removed. Privacy-critical systems prioritise catching everything, even at the cost of occasionally masking words that did not need it.
  5. The system has to track recurring people. The same person mentioned by full name in the intake assessment is the same person referred to by first name in the progress note three months later. Without that connection, later mentions leak through.
  6. Replacements should preserve structure. Blanking every name out destroys the grammar and relationships in the text. Replacing names with consistent, role-aware codes maintains the structure the AI needs to produce useful output, and lets the system distinguish between the patient, their partner, their GP, and their psychiatrist even though the AI never sees any actual names.
  7. Real-world testing matters more than benchmark scores. Note styles vary between practitioners, regions, and disciplines. A system that performs well on a published benchmark may not perform well on Western Australian psychology notes. Production-grade systems have to be validated against the documents they will actually see.

These are not engineering preferences. They are the consensus of two decades of clinical de-identification research, and they describe what a system that takes its job seriously looks like.

The components of a working system

Translated into architecture, a PHI redaction system designed against those principles has five distinct components, running in a specific order.

1. Structured pre-pass: the practitioner is in charge

The most reliable layer is the one that does not need to guess. Most clinical software already holds key identifying information in structured fields: client name, DOB, contact details, employer, GP, psychiatrist, emergency contact. Before any text analysis happens, the redaction system walks those fields and extracts every known identifier directly. The system does not need to figure out whether “Sarah” is a name when the client record says the client’s name is Sarah.

This layer does the majority of the work, and it works because the practitioner controls it. ClientJourney’s client details screen captures the standard identifying fields automatically. A separate relationships screen lets the practitioner add the people who come up repeatedly in therapy: the partner, parents, siblings, manager, key team members, anyone whose name appears regularly in session content. Each entry is tagged with its relationship to the client, so the system can replace the name with a code that still tells the AI who the person is (partner, mother, manager) without telling it who the person is.

This is deliberate. The practitioner knows their clients better than any model does. Giving them a place to declare the recurring named people in a client’s life means those mentions are caught reliably, every time, without depending on a language model to recognise the name.

Every report generated by ClientJourney also shows what was redacted and what was not. The practitioner sees the audit trail. If a name slipped through, they can add it to the relationships screen and regenerate. The system gets stronger with use, and the practitioner is the one driving it.

2. Rule-based recognisers

The next layer catches PHI with predictable surface forms: phone numbers, email addresses, Medicare numbers, ABNs, AHPRA registration numbers, ICD-10 codes, context-anchored dates of birth, addresses. These categories are stable across institutions. A phone number looks like a phone number. The literature is clear that for highly regular PHI classes, rule-based recognisers outperform statistical models because the patterns are deterministic.

This is also where Australian-specific identifiers earn their keep. Generic clinical AI tools built for the US market do not recognise Medicare numbers or AHPRA provider numbers as PHI. A clinical AI tool intended for Australian practitioners has to know what identifiers exist in Australian clinical text.

3. Named entity recognition: the safety net

By the time the first two layers have run, the majority of identifying information is already masked. The structured pre-pass has handled the client, their relationships, and their care team. The pattern-based layer has handled phones, emails, dates, and registration numbers. What is left is the residue: the people mentioned once in passing. The shopkeeper named in a session about social anxiety. The uncle mentioned in a single line of family history. The previous therapist named once in an intake.

This is where a small language model runs locally on the practitioner’s device. Its only job is spotting proper nouns the earlier layers missed: names of people, organisations, hospitals, places. It does no clinical reasoning, no diagnosis, no analysis. One model, one task, running in the browser.

Running the model on the practitioner’s device is the critical architectural choice. A redaction system that performs this step on a remote server has already sent the data off the practitioner’s machine. The privacy boundary has been crossed before the redaction begins. ClientJourney runs this layer inside the browser, which means the entire redaction process, including the language model: happens before any data leaves the practitioner’s machine.

4. Propagation

Once entities are identified, the system sweeps the entire note set for any remaining mentions of values it has already found. The patient mentioned by full name in the intake assessment is the same patient referred to by first name in the progress note. Without propagation, those later mentions leak through.

Propagation is what the literature calls a second-pass patient-specific dictionary: a temporary, in-memory map built from high-confidence detections in the first pass, used to catch residual mentions in the second pass. Dehghan et al. (2015) attribute measurable recall gains to this technique. It costs almost nothing computationally and substantially reduces residual leakage.

5. Replacement that preserves meaning

The final component decides what the redacted text actually looks like. The naive approach, replacing every name with [REDACTED], destroys the structure the AI needs to do useful work. The patient and their partner both become [REDACTED]. The GP and the psychiatrist both become [REDACTED]. The AI loses the ability to tell anyone apart.

The right approach replaces each name with a consistent code that carries the person’s role. The patient becomes one code, the partner becomes another, the GP becomes a third, and the same person always gets the same code, every time they appear, across every report. The AI sees the same grammar and the same relationships it would see in the original text. It can still tell who is who. It just never sees an actual name. When the AI response comes back, the practitioner’s browser swaps the codes for the real names before anything appears on screen.

This is the layer that lets a redacted progress letter still read like a progress letter, and lets the practitioner trust that the document was generated from a coherent understanding of who is who, even though the AI never saw a real name.

Why ClientJourney does it this way

ClientJourney is a drafting tool, not a system of record. The practitioner’s official notes still live in their primary practice management system. ClientJourney’s job is to take clinical content the practitioner has already captured and synthesise it into the 17 clinical documents practitioners draft repeatedly: intake assessments, case formulations, treatment plans, progress reviews, SOAP/BIRP/DAP notes, discharge summaries, referrer letters, supervision reflections.

That positioning lowers the regulatory bar (ClientJourney is not the source of truth) but raises the trust bar. The practitioner has to be confident that nothing identifying leaves their device, because the alternative is not using the tool at all.

The five-component architecture above is how that confidence is earned. The structured pre-pass walks the schema. Rule-based recognisers handle Australian identifiers. The local language model catches the residue. Propagation links recurring mentions of the same person. Role-preserving replacement maintains the structure the AI needs to produce a useful document. Names never reach the AI provider, and the entire redaction pass happens before the data leaves the practitioner’s machine.

An earlier version of this architecture has been running in production since April 2026 for CoachIQ, our executive coaching platform: same on-device redaction pipeline, applied to a different professional context. The clinical version refines two things specifically: the structured pre-pass is elevated to a first-class layer with practitioner control over the relationships register, and the AHPRA-relevant identifier set (Medicare, AHPRA registration numbers, Australian provider numbers) is built into the rule-based layer rather than added as a domain extension. We wrote about the original architecture in How we built on-device de-identification so AI never sees real names.

This is grounded in the literature, not in marketing copy. We commissioned the lit review before we wrote the redaction code because we wanted the architecture to follow the evidence, not the other way around.

What we are doing next

ClientJourney is entering UAT shortly. Two further evaluations will follow, documented to the same standard as the literature review:

  1. Redaction performance under realistic clinical text. How does the five-component system perform on real Australian psychology notes, not benchmark corpora? Recall on rare names, professions, organisations. Performance broken down by category.
  2. Document fidelity under redaction. Do the 17 clinical reports degrade in quality when generated from redacted input compared to unmasked input? Where does redaction hurt the output, and where doesn’t it?

These may be published together as a single paper or separately, depending on how the findings sit alongside each other. Either way, both will be fact-checked before publication using the same methodology applied to the lit review itself: every numerical claim traceable to its source, every limitation acknowledged in the open.

If you are a psychologist, counsellor, or allied mental health practitioner with clinical experience who would like to participate in ClientJourney’s UAT, the call for testers is on the portfolio page. Benefits are early access during testing and 12 months free subscription on launch.

The literature review on local PHI masking is available as a resource: it is the source material for everything in this post and the foundation under ClientJourney’s redaction architecture. For where this work sits in the wider practice context, see our professional services page.

Redaction keeps client identities away from the model. A separate obligation governs what a psychology practice says to the public: its website is advertising under the National Law. AHPRA’s advertising rules for psychologist websites sets out where those sites most often breach.

Published 17 May 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.

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.

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.