Clinical documents are among the most valuable targets for document AI and the least forgiving. The content is protected health information, the handling requirements are specific, and the consequences of getting it wrong are regulatory rather than merely operational.
Most of what determines whether a clinical pipeline is defensible is decided in architecture, before anyone writes a privacy policy. This is a practical account of those decisions. It is not legal advice — confirm specifics with your own privacy officer and counsel, because the details vary by organisation, jurisdiction and use case.
Establish the relationship first
If a vendor processes PHI on your behalf, they are a business associate and a business associate agreement is required before any PHI moves. This is not a formality to close after the pilot — a pilot on real records without an executed BAA is itself the problem.
Two follow-on questions get missed:
Subprocessors. If the vendor calls a third-party model API, that provider is in the chain. You need to know who is in it, that appropriate agreements exist at each link, and that you will be told before the list changes. "We use a major cloud provider's AI service" is not sufficient detail for a privacy review.
Training use. Whether your data can be used to improve models is a question to answer explicitly in the contract, not by inference from a policy page. Default to no unless you have decided otherwise deliberately, and get it in writing.
Minimise before you process
The strongest control is not processing what you do not need.
Scope the fields. A pipeline extracting dates of service and procedure codes does not need the narrative history. Narrow schemas reduce exposure and, incidentally, improve accuracy.
Consider de-identification. For some workloads — analytics, model evaluation, development — de-identified data is sufficient. Removing direct identifiers is straightforward; producing a defensible de-identification under the applicable standard is more involved, and re-identification risk from quasi-identifiers is real. Treat it as a controlled process with expert input, not a regex pass.
Separate development from production. Engineers debugging a pipeline should not be reading live patient records. Synthetic documents and a small de-identified corpus cover most development needs. Where production data access is genuinely necessary, it should be exceptional, logged, approved and time-limited.
Where the data goes
Deployment model. Options run from multi-tenant SaaS through single-tenant isolation to deployment inside your own environment. Each is defensible; they carry different control profiles and different costs. The decision belongs to your risk function, and the useful question for a vendor is which they support — a vendor with only one answer is constraining your options.
Residency. Know which region processes and which stores. For organisations with cross-border obligations this is a hard constraint, and it applies to the model inference call as much as to the database.
Retention. Documents, extractions, logs, and the feedback store from reviewer corrections all contain PHI. Each needs a retention period and an actual deletion mechanism. The commonly missed items are logs and intermediate artefacts — page images rendered during processing, request and response payloads captured for debugging, and cached model inputs.
Deletion that works. When a record must be deleted, the requirement covers every copy: primary store, backups within policy, logs, caches, and any derived datasets. Design for this at the start; retrofitting deletion across a system that scattered copies is painful and often incomplete.
Access and audit
Minimum necessary, enforced technically. Role-based access where a reviewer sees only the documents in their queue and only the fields they need. Policy statements are not controls; permissions are.
Audit everything that touches PHI. Who viewed which document, when, what they changed. This is required, and it is also genuinely useful for quality analysis.
Include the automated actors. System access to PHI should be logged with the same rigour as human access. When someone asks how a value entered a record, the answer needs to include which pipeline version, which model, and which source region.
Handling the model call
Do not send more than necessary. If a single field is needed from page fourteen, sending eighty pages of records for context is an exposure decision. Cropping and targeted retrieval reduce both risk and cost.
Disable retention at the provider where possible. Major model providers offer zero-retention or restricted-retention configurations for this use case. Confirm the setting, confirm it in writing, and confirm it applies to the specific endpoint you are calling.
Beware of debugging habits. Capturing full prompts and responses for troubleshooting is a natural engineering instinct and it creates a PHI store nobody classified. If you need it, treat it as PHI from the beginning, with retention and access controls.
Watch what goes into error messages and telemetry. Stack traces and monitoring events containing document content are a common and easily overlooked leak path.
Clinical-specific accuracy concerns
Compliance and quality intersect here in ways worth naming.
Fabricated clinical content is a patient safety matter, not only a data quality one. Grounding every extracted value in a source region, and verifying it, is not optional in this domain.
Negation and uncertainty change meaning entirely. "No evidence of pneumonia" and "pneumonia" differ by one word and completely invert the clinical fact. Any evaluation of clinical extraction must specifically test negated, hypothetical, historical and family-history statements — this is the single most common serious error class in clinical NLP and it is easy to miss in an aggregate accuracy number.
Temporality matters. A condition in the past medical history is not a current diagnosis. Extraction schemas should capture the temporal frame, not just the finding.
Provenance is required, not nice to have. Every extracted clinical fact should point at the note, the page and the passage it came from. Clinicians will not trust output they cannot verify quickly, and they are right not to.
A short checklist
- BAA executed, subprocessors enumerated, training use addressed in writing.
- Deployment model and data residency agreed with the risk function.
- Field scope minimised; development uses synthetic or de-identified data.
- Retention and deletion defined for documents, extractions, logs and feedback stores.
- Access controls enforced technically; all PHI access audited, including automated access.
- Model provider retention configured and confirmed.
- Grounding and provenance on every extracted clinical fact.
- Evaluation explicitly covers negation, uncertainty, temporality and family history.
- Incident response procedure exists and names people, not roles in the abstract.
None of this is exotic. All of it is much easier to build in at the start than to retrofit after a privacy review sends the project back.
Need a BAA and a deployment model that satisfies your privacy office?
We will walk your security and privacy teams through data flows, subprocessors, retention and deployment options.
Talk to Us