- Home
- Use cases
- Choreo Labs
- PII Masking on LLM Traffic for a Health System
PII Masking on LLM Traffic for a Health System
Mask what a pattern can describe, add a second check for free text and test both with synthetic prompts.
The challenge
What teams are up against
Typical situation, not a client: staff at a health system paste notes into an AI assistant, and prompts may contain patient identifiers. The privacy office needs proof that masking works before the pilot starts.
Our approach
How we deliver it, step by step
- 01
List the identifiers
List the identifier formats that appear: record numbers, national IDs, phone numbers, emails.
- 02
Attach pattern masking
Use the gateway's PII masking guardrail with regex for formats you can describe.
- 03
Add a second check
For names and addresses in free text, add a meaning-based or external check and a hard rule on its result.
- 04
Build a synthetic test set
Write prompts in each case class, with identifiers in prompts and in answers. Never use real patient data.
- 05
Run and record
Run the set, record what was masked and what was missed, and fix the gaps before go-live.
Architecture
The components involved
From the top of the stack down
The guardrail sits at the AI gateway so every application inherits it. Pattern masking handles formats. A second check handles free text. Logs record each masking decision without storing the original value where policy forbids it.
Outcomes
What changes when it is in place
The privacy office has a test log, not an assurance.
Gaps in free-text masking are known before launch.
Every application behind the gateway inherits the same rule.
Why Duczer East
Senior practitioners, from scope to delivery
We test with synthetic prompts only and we say plainly what a regex guardrail does not catch.
About Duczer EastFAQ
Questions we are asked about this
Does regex catch names?
Not reliably. Regex catches formats. Names and addresses in free text need another check.
Do you use real patient data to test?
Never. We use synthetic data.
Can this run on Azure or on WSO2?
Both can host guardrails. This case describes the WSO2 AI Gateway, now Choreo AI Gateway.
Related use cases
More problems we solve this way
Use cases on the same platform or for the same industries. Browse all use cases.
WSO2 Agent ID: Give Every AI Agent Its Own Identity
Replace shared keys with a registered, scoped, revocable identity per agent, so every call traces to an agent, an owner and an authority.
Read use caseWSO2 FHIR Prior Authorization API for Health Plans
Translate between FHIR and the utilization management system built for fax, portals and X12, without changing how reviewers work.
Read use caseWSO2 Identity Server: Consolidating Workforce Sign-On
A wave plan that moves workforce applications onto one sign-on without a big-bang cutover.
Read use caseChoreo: Working Alongside WSO2 API Manager
A responsibility table that settles which team owns what when Choreo and API Manager run side by side.
Read use caseChoreo: An Internal Developer Platform for an API Team
An adoption plan and onboarding steps for a team that wants self-service deployment on Choreo.
Read use caseESB to WSO2 Micro Integrator Migration for a Bank
A staged migration from an old ESB to the current Micro Integrator, with a rollback step at each stage.
Read use caseRelated insights
Further reading from our practitioners
Analysis and guides on the questions this use case raises. All insights.
WSO2 AI Gateway Setup: What to Decide Before You Register a Gateway
Before you register a WSO2 AI Gateway, decide where it runs, which API Manager release you need and which guardrails to attach, then test them with a set of prompts.
GuidePrompt injection: 8 controls for AI agents that hold up in audit
How to limit damage when a language model follows hidden instructions
MCP Proxies on WSO2 API Manager: Create, Guard, Control and Log
WSO2 API Manager can create an MCP server from an OpenAPI definition, from an API it already manages or by proxying an existing MCP server, with the MCP gateway in 4.6 and governance in 4.7.
Let's Talk
Talk through this use case
Tell us about your systems and where you are today. A senior practitioner replies, and only your email is required.


