Scrub PHI and PII from Healthcare Data Before AI

Remove patient identifiers from clinical notes, billing records, and healthcare documents before AI processing. Local browser processing with no BAA required.

ZERO UPLOAD · ALL LOCAL
  1. Paste your original prompt or code into the input box - detections appear instantly in the Variables section.
  2. Review the detected items in the Variables JSON and the Scrubbed Output textarea with safe placeholders like [IP_1].
  3. Use the Download Variables buttons to save the mapping as JSON or CSV for later restoration.
  4. Copy the scrubbed text and paste it into your AI tool.
  5. Switch to the Restore tab, paste the AI response, upload your variables file, and the restoration happens automatically.

Worked examples for this use case

Discharge summary for AI-assisted generation

Before
Patient: R.J. Martinez, DOB 1968-07-22, SSN 456-78-9012. Admitted 2026-05-15. Dx: T2DM. Attending: [email protected].
After
Patient: R.J. Martinez, DOB 1968-07-22, SSN [SSN_1]. Admitted 2026-05-15. Dx: T2DM. Attending: [EMAIL_1].

Patient portal message with contact details

Before
Message from [email protected] (Cell: (408) 555-0199): My prescription wasn't ready. Account #: 1234-5678.
After
Message from [EMAIL_1] (Cell: [PHONE_1]): My prescription wasn't ready. Account #: 1234-5678.

ORIGINAL PROMPT

SCRUBBED OUTPUT

VARIABLES

Scrub PHI and PII from Healthcare Data Before AI

Healthcare data holds the most sensitive personal information a person can share. Patient records combine direct identifiers such as name, SSN, and date of birth with health status information, diagnoses, medications, and procedures in a single document. When healthcare professionals use AI tools to draft clinical documentation, analyze case histories, or generate patient communications, any of these fields in the prompt creates a HIPAA exposure.

The scrubber removes the identifiable fields that make health data protected, the direct identifiers, before the document reaches an AI provider. Clinical content and medical context remain intact, giving the AI model what it needs to assist without receiving what HIPAA protects.

Protected health information in clinical workflows

HIPAA protects 18 categories of identifiers when combined with health information1. The most frequently digitized identifiers in clinical workflows are patient email addresses from intake forms, phone numbers from contact records, Social Security Numbers from insurance claims, and IP addresses from patient portal access logs. Furthermore, clinical system hostnames such as .hospital.org and .clinic.internal used in IT support queries are organizational identifiers that link the system to specific patients. The scrubber detects all of these pattern types and reduces the identifiable surface of a clinical document before AI processing.

The pattern-detectable identifiers are only part of the picture, however. A clinical document that has been scrubbed of emails, phone numbers, and SSNs may still contain patient names, admission dates, and geographic subdivisions that qualify as PHI under HIPAA. The scrubber addresses the machine-readable fields efficiently, but a complete de-identification workflow requires a second pass for the identifiers that regex cannot catch, particularly patient names embedded in clinical narrative text.

Clinical documentation use cases

AI is increasingly used for clinical documentation assistance: transcribing patient-physician conversations, summarizing case histories, generating discharge summaries, and drafting referral letters. Each of these documents is rich in PHI. Building on this, administrative tasks such as billing query resolution, insurance preauthorization letters, and patient complaint responses also touch patient identifiers. The scrubber is most practically used at the copy-paste step: before the clinician copies a section of the record into the AI tool, they paste it through the scrubber first. The scrubbed text retains the clinical meaning while removing the identifying markers.

Referral letters are a high-value target for scrubbing because they combine the patient's clinical history with their contact information, insurance details, and the referring provider's identity, all in a single document. When a specialist pastes a referral letter into an AI tool to help draft a response or summarize the clinical question, the scrubber removes the patient email, phone, and SSN while preserving the diagnosis codes, medication lists, and clinical narrative that the AI needs to generate a useful response.

Limitations for full HIPAA compliance

The scrubber is a practical risk reduction tool, not a certified HIPAA de-identification system. It addresses pattern-detectable identifiers but cannot detect patient names, geographic sub-unit data, dates associated with the patient, face photographs, or biometric data. Consequently, clinical documents run through the scrubber still require manual review for names and dates before being passed to an AI tool in a strictly HIPAA-compliant workflow. The scrubber handles the machine-detectable majority, and human review handles the remainder.

For healthcare organizations that require certified de-identification, the HIPAA expert determination method provides a formally recognized alternative to Safe Harbor2. Under this method, a qualified statistician certifies that the risk of re-identification is very small, even if some identifiers remain. The scrubber can serve as the first step in an expert-determination workflow: the automated pass removes the easily detectable fields, and the human expert evaluates the residual risk from the remaining quasi-identifiers such as rare diagnoses, unusual age values, or small-sample geographic data.

EHR systems and the clinical copy-paste intervention point

Electronic health record systems (Epic, Cerner, Oracle Health, Meditech) display patient data as a combination of structured field values and free-text clinical narrative. Clinicians copy sections of EHR notes for AI-assisted documentation, discharge summary generation, and referral letter drafting. The copy-paste step between the EHR and the AI tool is the correct intervention point for scrubbing: the scrubber runs on the clipboard content before it is pasted into the AI interface, with no EHR system integration or API access required.

Paste the copied EHR section into the scrubber, copy the scrubbed version, then paste into the AI tool. The AI receives the clinical narrative structure with identifiable fields replaced by tokens. For discharge summary drafting, the AI produces a structured summary from the scrubbed clinical context; the care team then reviews the output and reinserts patient-specific values as needed before finalizing3. Oracle Health (formerly Cerner) embeds its Clinical AI Agent directly into EHR workflows, demonstrating that AI-assisted documentation is becoming native to the systems clinicians already use4. This workflow requires no changes to EHR configuration and no vendor relationship with any AI provider on the healthcare organization's behalf.

Integration with EHR ambient documentation workflows

AI ambient documentation tools (clinical note generation from conversation audio) present a different scrubbing challenge: the text is generated by the AI rather than pasted by the clinician. Review the output from ambient documentation tools for HIPAA identifiers before including it in any subsequent AI processing step. The scrubber applies to any text: ambient documentation output can be pasted into the scrubber to remove identifiers before the note is sent to a second AI tool for formatting or summarization.

Billing and prior authorization workflows with PHI and financial data

Insurance prior authorization letters require linking patient identifiers with diagnosis codes, procedure codes, and clinical justification narratives. Revenue cycle management teams use AI tools to draft denial appeals, write prior authorization letters, and summarize clinical justifications for payors. These documents combine financial identifiers (member ID, group number, insurance plan name) with protected health information, qualifying as PHI under HIPAA in a healthcare organizational context.

Scrubbing removes the contact and identity fields that make the document PHI while preserving the clinical codes, procedure descriptions, and financial logic that the AI needs to draft or review the document. An AI that sees [EMAIL_1] for the patient contact and [PHONE_1] for the billing phone can still produce a correctly structured prior authorization narrative. The payor name and insurance plan information do not qualify as patient PII under HIPAA and can remain in the prompt without scrubbing.

Remittance advice and explanation-of-benefits processing

Remittance advice documents (ERA files, 835 EDI transactions) and explanation-of-benefits statements from payors contain patient identifiers, service dates, claim amounts, and adjustment reason codes. AI tools are used to analyze these documents for billing error identification and denial pattern recognition. Pull member IDs, keep the adjustment codes when preparing ERA text for AI analysis; the claim amounts, procedure codes, and adjustment reason codes that reveal billing patterns are not PHI and do not require removal.

Patient communication templates and AI-assisted personalization

AI tools draft appointment reminders, care gap outreach letters, discharge instructions, and post-visit follow-up messages for healthcare organizations. Personalizing these communications requires patient name, phone number, preferred email, appointment date, and sometimes insurance information. Each of these fields is a HIPAA identifier when combined with the health context of the communication.

Use the scrubber to remove personalization identifiers before AI drafting, then have the care team reinsert the correct patient-specific values in the final document. The AI produces the structural template (the language for a missed appointment reminder, the explanation for a care gap notification) from the scrubbed context. Staff then replace [EMAIL_1], [PHONE_1], and [NAME_placeholder] (manually added before scrubbing for name fields) with the actual patient values in the final step. This workflow separates the AI's structural work from the patient-specific data, keeping PHI within the healthcare organization's controlled environment throughout the drafting process.

Secure messaging platforms and AI integration risk

Healthcare organizations using secure messaging platforms (TigerConnect, Klara, Spruce Health) sometimes enable AI features within those platforms for message summarization or response drafting. These platform-embedded AI features transmit message content to the platform's AI provider. TigerConnect, for example, uses AI assistants that ingest EHR signals and route them to the right clinical role in real time, which means message content may pass through AI processing within the platform itself5. Review the BAA status of your secure messaging platform's AI features before enabling them, and apply the same scrubbing discipline to message content shared across AI-enabled channels within the platform.

Treating message content with the same scrubbing discipline as any other prompt keeps patient identifiers inside the platform's protected environment. CapyToolkit runs the scrubber locally in your browser, so the clinical text never leaves the device during processing, and the variables file you download is the only record that maps the tokens back to the real PHI.

When to use this

Use this before pasting clinical notes, patient communications, billing records, or healthcare administrative documents into any AI tool when the document contains identifiable patient information.

Examples

Discharge summary for AI-assisted generation

Before
Patient: R.J. Martinez, DOB 1968-07-22, SSN 456-78-9012. Admitted 2026-05-15. Dx: T2DM. Attending: [email protected].
After
Patient: R.J. Martinez, DOB 1968-07-22, SSN [SSN_1]. Admitted 2026-05-15. Dx: T2DM. Attending: [EMAIL_1].

Patient portal message with contact details

Before
Message from [email protected] (Cell: (408) 555-0199): My prescription wasn't ready. Account #: 1234-5678.
After
Message from [EMAIL_1] (Cell: [PHONE_1]): My prescription wasn't ready. Account #: 1234-5678.
Sources
  1. 1.

    HHS OCR, "De-identification of Protected Health Information," hhs.gov, accessed June 2026. https://www.hhs.gov/hipaa/for-professionals/special-topics/de-identification/index.html

  2. 2.

    Accountable HQ, "HIPAA De-Identification Explained: Safe Harbor, Expert Determination, and Risk Controls," accountablehq.com, accessed June 2026. https://www.accountablehq.com/post/hipaa-de-identification-explained-safe-harbor-expert-determination-and-risk-controls

  3. 3.

    Epic, "AI Charting," epic.com, February 2026. https://www.epic.com/epic/post/ai-charting/

  4. 4.

    Oracle Health, "Oracle Health — Clinical AI," oracle.com, accessed June 2026. https://www.oracle.com/health/

  5. 5.

    TigerConnect, "HIPAA Compliant Secure Messaging," tigerconnect.com, accessed June 2026. https://tigerconnect.com/hipaa-compliant-secure-messaging/

FAQ