PHI and LLMs: handling patient data without sending it out
PHI and LLMs: when patient data can go to a model, what a BAA covers, how to de-identify records, and how a model in your own environment narrows exposure.
Updated
Yes, you can use a language model with protected health information (PHI), but only when the vendor signs a business associate agreement (BAA) for that exact product, and you control where the text is stored, logged and read. A consumer chat app is usually the wrong place for patient records, because its default terms were not written for PHI.
Can I put patient information into ChatGPT?
Not by default. Check three things before any PHI goes in: whether the vendor will sign a BAA for that specific product, how long prompts and outputs are stored, and who at the vendor can read them. Terms change, so confirm them on the vendor’s current policy pages, not from memory or from a blog post, this one included.
What changes when PHI enters a model pipeline?
PHI is health information that identifies a person and is held by a covered entity or a business associate. Once it reaches a model pipeline, it does not stay in one place. It appears in the prompt, the output, request logs, retry queues, error traces, evaluation sets and, if you train on it, the training files. Each copy falls under the same rules as the original record.
Logs need their own review. Many teams log full prompts while debugging. That creates a second copy of the patient record, often in a tool that more staff can open than the EHR.
Does an AI vendor need a BAA?
If a vendor creates, receives, maintains or transmits PHI for you, the HIPAA Privacy and Security Rules generally require a written BAA with that vendor. A model API that receives patient text usually falls in that group. Get the signed BAA before the first real record, not after the pilot. If the vendor will not sign one, remove PHI from the request instead of sending it anyway.
This is a general explanation, not legal advice. Your privacy officer or counsel decides whether a given arrangement needs a BAA.
How do you use AI with protected health information safely?
The HIPAA minimum necessary standard says you should use or request only the PHI a task needs. Apply that to prompts. A model that assigns a billing code needs the note sections that support the code, not the whole chart. Drop fields the task does not use, and replace the patient name with an internal ID you can join back on your own side. The administrative side of healthcare has the same problem with claims and forms.
Then decide where the model runs. A model served in your own cloud account or on-prem keeps prompts and outputs inside your network, under your access controls, logging rules and retention settings. That does not make the system compliant by itself. It does reduce the number of outside parties that touch the text, which is the first thing a security review asks about.
Can you de-identify patient data for AI?
Yes, but pick the method on purpose. HIPAA offers two routes. Safe Harbor removes a fixed list of identifiers, including names, contact details, record numbers and dates more specific than the year. An expert determination is a documented judgment by a qualified expert that the risk of re-identification is very small. Regex redaction catches the obvious identifiers. It misses names in free text, rare diagnoses that identify someone, and dates written in unusual formats. Redaction before an LLM covers what masking can and cannot do. Treat redacted text as still sensitive until your privacy team signs off on the method, and keep any re-identification key in a separate, access-controlled store.
Is a fine-tuned model a good fit for patient records?
It can be, for one narrow, high-volume task with a clear test. Training data that contains PHI is PHI, so the training set gets the same controls as production. Own Weights fine-tunes an open-weight model for one task a company now sends to a frontier API, tests it against the current model on the company’s own data, and serves it in the customer’s cloud account or on-prem. The customer owns the weights. More at Own Weights.
We have not run this on patient records. On a public contract extraction exam, models we fine-tuned scored 0.717 (Accuracy tier) and 0.650 (Standard tier). Claude Opus scored 0.635 and Claude Haiku 0.584. The Accuracy model led Opus by 0.082 and Haiku by 0.133, both larger than the margin of error, and it finished ahead of both in all 5 groups of 102 documents. Each model was scored on documents it never saw in training, and Claude got one prompt with no examples. The exam shows what training for one task can do. It is not a legal product, it says nothing about clinical text, and it does not mean a fine-tuned model beats Claude at everything.
Self-hosting is the wrong choice in several cases. If your volume is low, if you need one assistant for many unrelated tasks, or if nobody on your side can run a model in production, a BAA-covered hosted API with strict data settings is usually simpler. Either way, the model assists the people who review its output. It is not medical advice, and it does not make a clinical decision.
If you are weighing a model for PHI, start with a data map: every place a patient field lands, logs included. Run the free AI cost audit from the button below to see which calls your code makes and which models they use, or book a call and we will go through your task.
Questions
Can I put patient information into ChatGPT?
A general chat product is a poor fit for patient records unless the vendor signs a BAA covering that product. Ask how long prompts and outputs are kept and who at the vendor can read them. Policies change, so check the vendor's current pages before you send anything.
Does an AI vendor need a BAA?
If the vendor handles PHI on your behalf, the HIPAA rules generally call for a written BAA with it, and a model API that receives patient text usually counts. If the vendor will not sign one, take the PHI out of the request rather than negotiating around the gap.
How do you de-identify patient data for AI?
Use HIPAA's Safe Harbor list of identifiers or an expert determination, not regex alone. Regex misses names in free text and rare conditions that point to one person. Store any re-identification key separately with its own access controls.
Is an LLM for patient records privacy-safe?
It can be, when the model runs in your environment under your access, logging and retention controls. That limits who touches the text, but it does not make the system compliant by itself. Bring your privacy officer in before the first pilot.
What is the safe way to use AI with protected health information?
Send only the fields the task needs, swap names for internal IDs, and keep logs short-lived and locked down. Run the model where your security team can inspect it. Sign the BAA before go-live, not after.