← Alok Joshi

Where patient data leaks in an AI pipeline

| Client work, Data privacy, Healthcare | By Alok Vishwas Joshi

Ask a team where patient data goes in their AI app and they will usually point at the model call. That is one stop. I built a clinical document review prototype for a US healthcare consulting client, using synthetic records only, and here is what I would check.

1. Upload. The file now sits in a temp folder, maybe in storage, maybe in someone's downloads. When is it deleted?

2. OCR. It sees the raw page. Watch for a fallback that quietly sends a hard page to a hosted model.

3. Masking. Names and numbers become placeholders. I used three layers: known intake details, pattern rules, and a small model for other names.

4. The leak check. If a hosted model looks for leftover names, it sees whatever you missed. The checker is inside your privacy boundary too.

5. The model call. Your provider gets the prompt, and so might a gateway in between. Anyone handling protected health information for you needs to be covered, usually by a business associate agreement.

6. Everything around it. Logs, tracing tools, caches, error reports, test datasets and backups. None of these feel like sending data to AI. All of them can hold it.

7. Human edits. A reviewer types a patient's name into a revision request. Mask that input as well.

One caution: masking is not the same as de-identification under HIPAA. It lowers risk. You still need the agreements, access controls and logging.

Try this: draw your pipeline and mark every box that can see raw text. Ask who runs it, whether there is an agreement, and how long it keeps data. The boxes you cannot answer are your work list. This is engineering experience, not legal advice.