Where PHI Can Appear in an AI Workflow: Prompts, Attachments, Logs, and Support Tools
The use of AI tools in healthcare raises complex privacy concerns. Under HIPAA, Protected Health Information means “individually identifiable health information” held by a covered entity or its business associate that relates to an individual’s health status, care, or payment and that identifies the person.
In an AI workflow, PHI can surface at many points: a doctor typing a patient’s name and symptoms as a prompt, uploading a clinical image or record file, or having the model connect to an EHR database.
Each of these steps can copy or expose PHI unless properly controlled. This post maps a typical AI workflow end-to-end and pinpoints where PHI might appear or leak.
It also outlines HIPAA obligations for covered entities and business associates versus consumer tools, and offers practical risk scenarios and controls like data minimization, de-identification, encryption, access controls, BAAs, logging practices, etc. Our aim is educational guidance for healthcare leaders, compliance officers, security teams, and AI product managers.
Mapping the AI Data Flow and PHI Entry Points
AI applications often involve multiple stages: data input, processing, storage, output, and ongoing management. At each stage, PHI can be introduced, copied, transformed, or exposed. Key points include:
User Prompts and Chat Inputs
Any user-supplied text or speech to an AI system can contain PHI. For example, a clinician might prompt an AI chatbot with “Patient X’s symptoms are…”, or a patient might enter personal health details.
If the system retains conversation history or uses prompts to improve models, all that data becomes ePHI. It’s critical to treat prompts with PHI as ePHI and restrict them to HIPAA-compliant tools.
Uploaded Attachments and OCR/Transcription
Some AI tools allow uploading files (like PDFs or images) or dictating audio.
Attachments may include scanned records, images of lab results, or photos of documents. The system often runs OCR (optical character recognition) or speech-to-text transcription on these inputs, converting them into text. Any PHI in those files (patient names, IDs, notes, etc.) is thus extracted and processed.
For example, if an X-ray image with an embedded patient ID is uploaded, the text from that image becomes PHI data for the AI model.
Model/Provider Processing
When the AI provider (cloud service or on-premises model) handles data, they effectively see PHI unless it is de-identified first. Generic public AI services do not sign HIPAA Business Associate Agreements and typically log or even train on user inputs.
Thus, entering any PHI into a non-HIPAA AI chat or API is a HIPAA violation. Even HIPAA-enabled AI offerings only cover specific products and promise “no training on data” and strong access controls. Any PHI processed by the model is ePHI and must flow through HIPAA-compliant infrastructure and BAA-covered environments.
Retrieval and Vector Stores
Many AI systems use retrieval-augmented generation with vector databases.
Here, source documents or notes are embedded into vectors. Recent research shows such embeddings can be inverted to reconstruct original text – meaning embeddings of patient records still count as PHI. In practice, storing clinical embeddings in a vector store is equivalent to storing PHI.
Any cloud vector DB holding such embeddings becomes a business associate and must be protected by a BAA. Poor safeguards here can directly leak PHI.
Integrations and APIs
If an AI system connects to external APIs or EHR systems, PHI can flow across interfaces. For instance, a chatbot plugin might fetch a patient’s record via an API.
Each integration point (FHIR or custom API calls) is an opportunity for PHI disclosure or interception if not secured. Even system telemetry (usage analytics, exception tracking) can inadvertently capture query contents or user identifiers linked to PHI.
Application Telemetry and Audit Logs
Modern applications record logs for debugging, monitoring, or compliance.
These logs might include user IDs, timestamps, prompt texts, and error messages. If those logs contain PHI (e.g. a portion of a patient’s name or diagnosis from a prompt), they themselves become ePHI.
HIPAA’s Security Rule requires audit controls for systems that create, receive or transmit ePHI. Any third-party logging or observability service like Splunk, Datadog, etc. storing such logs is a BA and must be HIPAA-eligible and under a BAA.
Analytics and Backups
Analytics data (reports on model usage or patient outcomes) can aggregate PHI or use identifiable subsets. Database backups, snapshots, or audit archives likewise contain PHI if not filtered.
Retaining these without proper encryption, access controls, and deletion policies exposes long-term risk.
Human Review and Support Tools
Some AI vendors use human content reviewers to improve quality or compliance.
A human reviewing an AI conversation or transcript may see PHI. Likewise, if users seek help for example, support tickets or call centers, chat or ticketing systems may contain PHI.
Such support contractors or internal review staff become business associates when handling PHI.
Downstream Vendors and Subcontractors
Finally, any third party handling the data must be considered. For example, an AI platform might use external identity services, cloud functions, or subcontracted data labeling teams.
- HIPAA requires CEs and BAs to have BAAs with any vendors that create, receive, maintain, or transmit PHI. Subcontractors of BAs are also treated as BAs (and likewise bound by HIPAA).
- If PHI leaves the covered environment without a BAA (e.g. sent to a consumer-grade AI tool or open cloud storage), that is a violation.
Each of these points in the AI pipeline is a potential exposure of PHI.
Covered entities must assume that unless data is properly de-identified or shielded, any internal or external AI component will see actual patient information.
As NIST emphasizes, “the ePHI that a regulated entity creates, receives, maintains, or transmits must be protected against reasonably anticipated threats”. In practice, that means designing AI systems with PHI risk in mind at every stage.
Covered Entities, Business Associates, and Consumer Tools
HIPAA’s rules apply only to covered entities, health plans, health care providers, and health care clearinghouses and their business associates.
Any CE using AI on PHI must ensure a HIPAA-compliant setup.
- For example, if a hospital sends patient data into an AI system in the cloud, the cloud provider is a BA and must sign a BAA.
- Likewise, any subcontractor of that cloud service who touches the data is effectively a sub-BA and must abide by the same PHI rules.
- The BAA must explicitly limit uses/disclosures to those permitted by HIPAA and forbid unauthorized secondary use such as AI training of PHI.
By contrast, consumer-grade AI tools are not HIPAA-regulated, and they typically do not offer BAAs.
As one analysis noted, “Generic ChatGPT services are not HIPAA compliant… Because they do not offer the safeguards and BAAs required… OpenAI will not enter into a BAA for the Free, Plus, Team, or Enterprise versions of its product”.
In short, employees or patients entering PHI into these consumer tools would be a HIPAA violation by the covered entity. Even specialized “wellness” or symptom-checker AI apps for consumers, despite greater privacy features, operate under consumer privacy laws, not HIPAA.
Healthcare organizations must therefore forbid or strictly control any use of non-HIPAA AI tools with PHI in their environment.
Example Risk Scenarios
Staff using a public chatbot for note-taking
A clinician asks a public AI chatbot to help write a patient note, copying the patient’s name and condition into the prompt. The chatbot logs this conversation and may use it to further train its model. This exposes PHI outside the CE’s control and without a BAA.
Even if the clinician doesn’t see a breach immediately, HIPAA would consider this an impermissible disclosure of PHI to an unapproved recipient.
Transcript mismatch in AI scribe
An AI scribe service listens to doctor-patient conversations and generates notes.
If the system “hallucinates” information or misattributes findings to the wrong patient (for example, mixing details between two concurrent charts), PHI intended for one person could be incorrectly placed in another’s record.
Such an error is not just a documentation problem – it can trigger a reportable HIPAA breach if PHI is disclosed to the wrong individual or unauthorized record. It underscores the need for human review of AI-generated notes.
Vector database inversion
A health system uses a RAG chatbot that embeds patient records into a cloud vector store without a BAA and without encryption. Attackers exploit an embedding inversion method (like Vec2Text) to recover identifiable patient details from the vectors.
By HIPAA’s Safe Harbor standard, any identifiability means these vectors count as PHI. Because the hospital failed to properly de-identify the data, storing it in an unapproved cloud database is a violation.
Logging ePHI to analytics
An AI service is instrumented with an observability platform. The developer logs every prompt and response for debugging. Those logs contain patient names and brief histories.
Without anonymization, these logs are themselves ePHI. If the analytics vendor did not agree to a BAA or secure storage, this log aggregation could lead to a breach of patient data via the logging service.
Customer support chat leaks
A patient uses an AI-based telehealth app and has a problem. They start a support chat with the vendor’s team and paste sensitive medical details or record snapshots.
The support transcripts, which now contain PHI, are stored in a third-party helpdesk system. That support company becomes a BA, and the transcripts must be protected accordingly; otherwise, the patient’s PHI has been impermissibly disclosed.
Unvetted AI training on PHI
An AI vendor fine-tunes its medical language model using chat logs from a hospital, including patients’ medical histories. Unless each use of PHI was authorized (often needing patient consent or qualifying as healthcare operations), this constitutes unauthorized use of PHI.
The vendor must not train models on actual PHI without a clear HIPAA basis.
These scenarios show how easy it is for PHI to slip into AI systems. They also show the interplay of the Privacy Rule which governs “uses and disclosures” of PHI, and the Security Rule, which mandates safeguards like access controls and audit trails. In each case, oversight and good safeguards can prevent a reportable breach.
Safeguards and Best Practices
To mitigate these risks, healthcare organizations and AI product teams should follow HIPAA security principles and recognised best practices:
Data Minimisation
Only share the minimum PHI needed. For example, use unique patient IDs instead of names in prompts, or omit unnecessary dates/IDs.
Train users and clients to avoid free-text PHI entry when possible. If generative AI is used for drafting notes, populate only de-identified or pseudonymized data.
De-identification
Whenever possible, strip out HIPAA identifiers before feeding data into AI. HIPAA’s Safe Harbor standard lists 18 identifiers to remove (names, geographic data smaller than state, dates, contact info, SSNs, MRNs, etc.). If claiming data is de-identified, ensure it truly meets one of HIPAA’s methods.
- For instance, simple removal of names from a medical transcript may not suffice if enough details remain to re-identify a patient.
- For RAG systems, consider storing only pseudonymous record keys in vectors and keeping identifiers in a separate secure database.
Note HHS guidance: properly de-identified data is no longer PHI, but flawed de-identification is a liability. If a vendor is hired to de-identify PHI, they must be a BA under a BAA.
Access Controls
Implement strict role-based access to AI tools. For example, only certified clinicians or analysts should be able to query patient data in an AI app.
Use multi-factor authentication and unique user IDs for all logins. Ensure that even internal staff cannot see PHI in logs or support tickets unless absolutely authorized.
Many AI platforms now offer enterprise controls specifically to support HIPAA compliance. Enforce the “minimum necessary” rule: each user’s permissions should be restricted to only the PHI they need to know.
Encryption
Use strong encryption for all PHI data at rest and in transit.
- This includes API communications (TLS 1.2+), database encryption, file storage, and backups.
- HIPAA’s Security Rule makes encryption addressable but many experts treat it as mandatory in practice.
- For AI-specific flows, ensure that any uploaded attachments, model files, and vector indexes are encrypted on disk (for example, with customer-managed AES-256 keys in a cloud KMS).
- OpenAI’s ChatGPT for Healthcare and similar products often offer “customer-managed encryption keys” for compliance.
In transit, always require TLS, and use HIPAA-compliant crypto suites.
Make sure encryption keys are protected (e.g. HSMs or restricted KMS roles). Avoid keeping any PHI in plaintext logs or telemetry; if logs must capture content, consider automated redaction.
Retention and Deletion
Have clear policies on how long AI data is kept. For example, disable any “memory” or long-term conversation storage unless needed; if enabled, ensure it is covered by the BAA and that data is purged when no longer necessary.
Under HIPAA, documentation including security documentation and potentially audit logs must be retained for six years from creation. But clinical data beyond that should be deleted once the use case ends.
In practice, this means setting auto-expiry for logs or outputs in an AI system. Regularly audit storage buckets, databases, and backup media to confirm that obsolete PHI is securely destroyed.
Vendor Due Diligence and BAAs
Rigorously vet any AI vendor or third-party tool before sharing PHI. Ensure that they sign a HIPAA-compliant BAA that explicitly covers all relevant services and data types. For example, an observability tool or cloud database used by the AI platform must be listed under the BAA.
Verify that the BAA prohibits unauthorized PHI uses for example, no training on PHI without written authorization. Check that vendors follow “reasonable and appropriate” safeguards as required by HIPAA in line with their risk assessments.
Remember that any subcontractors the vendor uses also must be bound by HIPAA. If a vendor claims “we encrypt everything in their cloud,” confirm whether that encryption is truly customer-controlled or under a shared environment.
Logging Hygiene and Monitoring
Configure logs to minimize PHI collection.
- For example, in a chatbot app, avoid logging entire user messages; instead log only usage metadata or anonymized IDs.
- If you must log prompts/responses (for quality assurance), ensure those logs are secured and access-limited.
- Use immutability and integrity checks on audit trails: HIPAA expects systems to protect log integrity and have the ability to examine them after an incident.
Implement anomaly detection on logs and analytics: e.g., alerts for unusually large data exports or unfamiliar IP access, which could indicate a data scrape or breach attempt.
Regularly review audit logs for unauthorized PHI access.
Incident Response and Training
Have a clear plan for responding to a suspected PHI leak via AI including breach notification procedures. This means identifying who gets alerted if an AI system behaves anomalously, and how to freeze activities for e.g. revoking API keys.
Train all staff on AI use policies: clarify that no real patient info should be entered into non-approved tools. Conduct drills where AI-related incidents like a simulated data leak from an AI app are handled.
As one guidance note says, “Vendors… and health systems must treat AI scribes not just as software, but as data stewards embedded into patient care”. Everyone from developers to doctors should know that HIPAA covers all appearances of PHI in these systems.
Build Secure, AI-Ready Healthcare Workflows with CapMinds
Building AI-powered healthcare workflows requires more than choosing the right model; it requires a secure, connected technology foundation.
CapMinds helps healthcare organizations modernize EHR platforms, integrate systems through FHIR interoperability, streamline workflows with automation, and strengthen cloud, data, and IT operations.
Our healthcare-focused teams can help you assess where patient information moves across applications, APIs, infrastructure, and support processes, then identify opportunities to improve interoperability, visibility, and security controls.
Ready to move forward with confidence?
Partner with CapMinds to plan and build healthcare technology that supports responsible AI adoption and more connected care. Contact CapMinds directly to discuss your needs.



