:root{--bg:#080a0f;--panel:#10131a;--panel2:#141822;--text:#f2f4f8;--muted:#a7afbd;--soft:#d9dee7;--line:#272d38;--accent:#b8ff5a} *{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;line-height:1.72} a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline} main{max-width:860px;margin:auto;padding:72px 28px 96px} .eyebrow{font-size:12px;letter-spacing:.16em;text-transform:uppercase;color:var(--accent);font-weight:750} h1{font-size:clamp(42px,7vw,70px);line-height:1.02;letter-spacing:-.045em;margin:18px 0 24px} .dek{font-size:21px;line-height:1.48;color:var(--soft);max-width:780px} .meta{font-size:13px;color:var(--muted);margin:24px 0 54px} h2{font-size:32px;line-height:1.18;letter-spacing:-.025em;margin:58px 0 18px} h3{font-size:20px;line-height:1.3;margin:28px 0 10px} p,li{font-size:17px;color:#d6dae2} .callout{background:linear-gradient(135deg,#141a12,#11151b);border:1px solid #33402a;border-radius:18px;padding:24px 26px;margin:30px 0} .grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:24px 0} .card{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:22px} .card h3{margin:0 0 8px;font-size:18px}.card p{font-size:15px;color:var(--muted);margin:0} .steps{display:grid;gap:12px;margin:24px 0}.step{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:20px 22px} .example{background:#0d1016;border-left:3px solid var(--accent);padding:19px 22px;border-radius:10px;margin:22px 0} .label{font-size:11px;text-transform:uppercase;letter-spacing:.12em;color:var(--accent);font-weight:750;margin-bottom:7px} .compare{overflow:auto;border:1px solid var(--line);border-radius:16px;margin:28px 0} table{border-collapse:collapse;width:100%;min-width:680px;background:var(--panel)} th,td{padding:15px 17px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top} th{font-size:12px;color:var(--accent);text-transform:uppercase;letter-spacing:.06em}td{font-size:15px;color:#d9dde5} .sources{margin-top:64px;padding-top:26px;border-top:1px solid var(--line)}.sources li{font-size:14px;color:var(--muted)} .cta{margin-top:60px;border:1px solid #39482e;border-radius:20px;padding:30px;background:#11170e}.cta h2{margin:0 0 10px;font-size:26px} small{color:var(--muted)} @media(max-width:680px){main{padding:48px 20px 72px}.grid{grid-template-columns:1fr}h2{font-size:28px}.dek{font-size:19px}p,li{font-size:16px}}
Healthcare · AI Privacy

How to Remove PHI From Medical Documents Before Using AI

A practical workflow for protecting patient identifiers in medical documents before sending them to an AI system, including structured data, free text, dates, images and clinical case reports.

IdentityVeil Resources & Insights · Healthcare · 10-minute read
The practical goal: Removing PHI from a medical document before using AI is not simply a matter of deleting every name. A robust workflow needs to address structured fields, free text, dates, identifiers, locations, images, and combinations of facts that could still identify a patient.

Start with the distinction between redaction, pseudonymization, and de-identification

ApproachWhat it doesTypical AI use
RedactionRemoves or obscures information.Useful when the information is not needed at all.
PseudonymizationReplaces identity with consistent tokens while retaining a controlled mapping.Useful when relationships and continuity matter.
HIPAA de-identificationMeets the HIPAA regulatory standard through Safe Harbor or Expert Determination.Used when an organization needs information to qualify as de-identified under HIPAA.

These concepts should not be used interchangeably. HHS describes two HIPAA methods for de-identification: Safe Harbor and Expert Determination. citeturn0search0

Why removing names is not enough

HHS's de-identification guidance explicitly addresses identifiers beyond names, including medical record numbers, dates, geographic information, telephone and fax numbers, email addresses, account numbers, device identifiers, IP addresses, biometric identifiers, full-face photographs and other unique identifying characteristics or codes. citeturn0search0

The guidance also emphasizes that the HIPAA standard applies to information in free text, not only structured database fields. Clinical narratives can contain rich contextual information that makes a patient identifiable. citeturn0search0

A practical workflow for protecting a medical document before AI

1. Inventory the document.
Identify whether the source is a clinical note, discharge summary, laboratory report, case report, referral, claim, scanned document, PDF, image, or another format.
2. Extract all relevant content.
Do not inspect only the visible text layer. Scanned pages, embedded images, signatures, headers, footers and tables may contain identifying information.
3. Detect identifiers.
Look for names, addresses, phone numbers, emails, MRNs, health-plan identifiers, account numbers, dates, geographic details, URLs, IP addresses, biometrics and other unique identifiers.
4. Inspect free text.
Look for narrative clues such as occupation, rare events, unusual procedures, family relationships, specific locations, or combinations of facts that could identify the patient.
5. Decide what the AI actually needs.
Not every sensitive field must be removed if it is necessary and appropriately governed for the intended task. The objective is controlled minimization, not indiscriminate destruction of context.
6. Transform the document.
Redact unnecessary information or replace it with consistent placeholders when the relationship needs to be preserved.
7. Validate the protected copy.
Run a second privacy inspection. Check the body, tables, headers, footers, metadata, OCR text and images.
8. Send only the protected version.
Keep the original document and identity mapping outside the AI-facing workflow.

Worked example: a clinical case report

This is where the third proposed article fits naturally. A case report is an excellent example because the clinical narrative itself is valuable. Removing too much information can destroy the educational or analytical purpose of the case.

Before

“A 52-year-old patient, Maria Rodriguez, living at 18 Oak Street, presented to St. Mary's Hospital on 14 May 2026. Her MRN was 483920. She worked as the chief financial officer of a regional company and had previously been treated by Dr. James Patel...”

Protected for AI analysis

“A 52-year-old patient, [PATIENT_001], presented to [FACILITY_001] on [DATE_001]. Her medical record number was [MRN_001]. She worked as a senior executive and had previously been treated by [PROVIDER_001]...”

The protected version retains the chronology and relationships while reducing direct identifiers. Whether particular facts should be retained depends on the purpose of the case and the applicable privacy standard.

Why consistent placeholders are useful

Suppose a clinical report refers to the patient 20 times. Replacing the name with “[REDACTED]” everywhere preserves less semantic structure than replacing it consistently with [PATIENT_001].

The same principle can apply to other entities:

Dates deserve special attention

Dates can be clinically important and privacy-sensitive at the same time. Under the HIPAA Safe Harbor method, many dates directly related to the individual are among the identifiers addressed by the rule. At the same time, chronology can be essential to clinical reasoning.

For an AI workflow, a date can sometimes be transformed rather than simply deleted — for example, preserving relative sequence or a controlled time representation where the task allows it. Whether such a transformation satisfies a particular legal de-identification standard is a separate compliance question and should not be assumed.

Free text is one of the hardest problems

Structured fields are comparatively straightforward: a field labeled “Medical Record Number” can be detected as an MRN. Free text is harder.

A clinician may write:

“The patient is the only neurosurgeon in a small town and was injured in a highly publicized accident last winter.”

No single phrase necessarily looks like a standard identifier. Together, however, the details may make the person recognizable. HHS specifically warns that clinical narratives can contain rich contextual information that readily allows patient identification. citeturn0search0

What about physician and facility names?

HIPAA's Safe Harbor method does not require every provider or workforce member name to be removed simply because it is a person's name. HHS explains that the names of the individuals associated with the health information — including patients and specified related individuals — are the focus of the Safe Harbor identifier requirement, while provider/workforce names are not automatically required to be removed. citeturn0search0

However, organizations may have additional confidentiality, employment, contractual, or policy reasons to protect professional identities. AI workflows should therefore define their protection policy explicitly rather than assuming that the HIPAA Safe Harbor list is the only information that matters.

Scanned PDFs and images create another layer

A document may contain PHI that is invisible to a conventional text-only extraction pipeline: a scanned admission form, handwritten note, photograph, signature, embedded image, or image-based table.

A practical protection system therefore needs document-aware inspection, OCR where appropriate, and a final validation pass on the rendered document — not just a regular-expression scan of extracted text.

How to validate the protected document

Text layer

Search for names, identifiers, dates, contact information and residual narrative clues.

Structure

Inspect tables, headers, footers, captions, notes and document metadata.

Visual content

Inspect scans, photographs, signatures, charts and embedded images.

Consistency

Confirm the same person or entity receives the same placeholder throughout the document.

A useful checklist before sending a medical document to AI

Important: “anonymized” is not always the right word

If your system replaces Maria Rodriguez with [PATIENT_001] and retains a private mapping that can restore Maria Rodriguez later, the result is not necessarily anonymous.

For product and policy language, protected, pseudonymized, or identity-protected may be more precise. True legal de-identification under HIPAA has a defined standard, and GDPR separately distinguishes pseudonymisation from anonymisation.

Where IdentityVeil fits

The IdentityVeil model is deliberately built around the separation between identity and context. The original values remain in a controlled private vault while the AI-facing copy uses consistent placeholders.

That makes the clinical case-report scenario a concrete example of the broader architecture: the AI receives the information required for the task, while the organization retains control over the identity layer.

Key takeaway

Removing PHI before using AI should be treated as a document-protection workflow, not a simple find-and-delete operation. The best workflow understands the document, detects both structured and unstructured identifiers, protects unnecessary identity, preserves useful relationships, validates the result, and keeps restoration under appropriate control.

Sources & further reading

Protect the identity. Preserve the context.

IdentityVeil is designed around a simple principle: protect sensitive identity information while preserving the context needed for useful AI work.

Learn about IdentityVeil →