How Document Processing Vendors Actually Operationalize Zero Data Retention for PHI Workflows
A signed BAA won't guarantee zero PHI retention without technical controls.

Self-hosted document processing can keep PHI off third-party servers when every part of the processing runs locally and no telemetry, support tunnel, or cloud callback exposes the data. For hosted workflows, a signed BAA does not establish zero data retention. Contracts, processing controls, and logs must agree on where PHI can persist.
Why a signed BAA does not close the PHI retention risk in document pipelines
Teams can sign a Business Associate Agreement and still operate a pipeline that retains PHI in places they have not examined. A BAA establishes legal obligations for handling PHI, but it does not disable request logging, empty caches, or configure an inference endpoint. Those are separate technical controls. If the infrastructure retains inputs by default, signing an agreement does not itself change that behavior.
OpenAI’s standard API keeps prompts in abuse-monitoring logs for 30 days when there are no zero data retention agreements. That distinction shows why an approved commercial relationship is not enough to establish a non-retaining workflow. The agreement must cover the service being used, and its required controls must be active. A retention exception must therefore be evaluated as actual PHI storage. Retention may have a legitimate purpose, but it still needs explicit governance.
How PHI actually moves through a document processing pipeline and where retention risk appears at each stage
The first stage is inference input, when a prompt reaches the API endpoint. At this boundary, the service can log the request, cache it for performance, or flag it for abuse monitoring. Retention can begin before the model runs. A claim about what happens during inference therefore says little about what happened when the request arrived.
The second stage is model processing, where the model generates a response in memory without persistent storage. This is the narrow stage at which a ZDR claim can be technically accurate while the surrounding pipeline still retains content. The third stage begins with operational logging after the response returns. Logs can record timestamps, query length, user IDs, and error codes. Removing document content is not enough if the remaining metadata can re-identify patients.
The fourth stage is the subprocessor chain, including cloud infrastructure, model providers, and logging services. Those parties are not bound by a vendor’s policy just because the vendor has one. HHS sample BAA provisions require subcontractors to accept the same PHI protections, making contractual coverage part of the pipeline map. Meanwhile, a clinical-record pipeline that stages documents, saves intermediate results for debugging, and writes output to a data lake can create four or five copies of the same PHI. Staging buckets, debug logs, and caches each have their own retention clock, even when there is a sound reason to keep every copy for operations.
The standard carve-outs vendors write into ZDR policies and what each one means for a PHI pipeline
Abuse monitoring creates the first decision point in a ZDR policy. A provider may retain content for trust-and-safety review even when the application needs it only long enough to produce a response. Engineers must establish whether ZDR removes that storage window for their requests or leaves an exception. The exception determines the actual retention behavior. A general commitment to privacy does not answer that question.
Training opt-out is a different commitment altogether. It means inputs will not be used to improve models. Operational logs can remain compatible with a training opt-out while being incompatible with the intended ZDR design. The decision is therefore whether the policy prohibits persistence. Those commitments cannot substitute for one another.
Safety and compliance holds need to be read separately because flagged sessions may be kept. If a BAA does not address those holds, the agreement leaves an unresolved question about what happens to PHI during an investigation. Legal orders introduce a further distinction between historical and future content. A provider cannot disclose content it never collected, but it can be compelled to stop deleting new content going forward. Engineers who review either exception need to find out what it covers and its retention period before treating the service as non-retaining.
How the major hosted AI providers operationalize ZDR in practice, and what each path actually requires
Hosted providers put ZDR in place through different mixes of contracts, account settings, and service configuration. There is no universal activation path. Some arrangements need approval through a contract, while others have an organization-level control. Customers cannot check for themselves that nothing is stored anywhere in a provider’s infrastructure, so the contract must hold the provider to that claim.
Google Vertex AI handles ZDR contractually through the Cloud Data Processing Addendum. Its terms differ by region and product, some Workspace products are not covered, and standard security logs are still kept. The resulting design depends on platform controls. Engineers must map the specific product and region to the applicable terms instead of assuming that one agreement covers every endpoint.
AWS documentation states that Amazon Bedrock model invocation logging is disabled by default and configured by the customer. Customers choose logging destinations and data modalities through the console or API, which makes their own configuration part of the retention decision. Bedrock is a HIPAA-eligible service under the AWS BAA. Nevertheless, a disabled default is not a contractual prohibition on content logging.
Together AI lets customers on any tier turn on ZDR themselves with an organization-level toggle. Fireworks AI offers ZDR that is enforced across the whole account as an Enterprise feature. Both offer zero-retention terms, but BAA availability and the full contract require separate confirmation. Anthropic’s official ZDR support page distinguishes HIPAA-ready services from ZDR, stating that the Claude API with HIPAA configuration enabled and HIPAA-ready Enterprise plans do not require ZDR for BAA availability. For Claude Code using a Claude Console API key, however, BAA coverage requires that ZDR be on for that Console organization.
The architectural split that lets ZDR and mandatory retention coexist in the same pipeline
The design response is split custody, with transient processing separated from the governed business record. Engineers should place required retention in the business layer rather than allowing processing services to accumulate their own copies. The two layers serve different purposes. The processing layer handles content only while needed for the operation, while the business layer retains the record under its applicable obligations.
This separation resolves the apparent conflict between minimizing data and preserving required records. If the processing layer writes no PHI to disk, there is no stored PHI to encrypt at that layer. Encryption-at-rest obligations instead attach to the governed stored record. That conclusion depends on the absence of storage. A debug file or cache containing PHI would change the premise.
Prompt payloads and model output fields should be scrubbed before reaching observability systems, which should record only request IDs, latency, confidence distributions, and error codes. Otherwise, telemetry becomes an ungoverned second record store. The inference layer’s TTL rules should also apply to telemetry stores, whose retention schedules may otherwise run longer. Retrieval-augmented generation needs the same custody analysis for embedding, vector storage, retrieval, and inference, rather than treating the model endpoint as the whole workflow.
Three technical pillars that make ZDR a verifiable architecture rather than a contractual promise
The first pillar is dynamic PII masking before transmission. PHI is masked or tokenized before it crosses the organization’s network boundary, so the provider receives a representation it can process without receiving identifiable data. This reduces exposure through the subprocessor chain. The control belongs before transmission because masking after arrival cannot change what the provider has already received.
The second pillar is a stateless AI gateway that intercepts every outbound request and enforces the provider’s ZDR API options. It must never write session content to disk. That constraint makes the gateway’s own retention behavior an architectural requirement. It does not, however, make the remote provider’s infrastructure visible to the customer. The gateway enforces the outbound configuration while the contract governs the provider’s obligations.
The third pillar is metadata-only audit logging. Logs should capture timestamps, token counts, policy outcomes, confidence scores, and anomaly flags without preserving prompts or model output. Human-review events need the same discipline. The audit record should identify the confidence event, reviewer assignment, approval or rejection timestamps, and modification notes without reproducing the content that triggered review.
45 CFR §164.312(b) requires ways to record and examine what happens in information systems that hold or use electronic protected health information. Its scope is the information system. Metadata-only logging helps meet that control without keeping another archive of prompts. The metadata must still be checked to see whether it can identify patients.
How can a self-hosted document processing API keep PHI off third-party servers?
Self-hosted deployment keeps inference away from third parties when all processing stays within the organization’s environment. That is a legitimate architectural choice when contractual assurances about cloud retention leave unacceptable residual risk. The deployment boundary is the deciding factor. An API can be hosted locally and still expose PHI through remote inference, telemetry, or support access.
A genuinely air-gapped document intelligence pipeline must run parsing, OCR, chunking, embedding, vector storage, retrieval, and inference locally, without external dependencies. Local parsing alone is not an air gap. If inference routes to a cloud API, that stage still exposes data to a third party. The same review must check remote telemetry, support tunnels, and cloud callbacks as well as where the document store is.
A software vendor with no access to the environment may not qualify as a Business Associate, so a BAA may not be required for the on-premises deployment itself. Remote support or licensing callbacks change that assessment and require BAA coverage where the vendor handles PHI. A hybrid design offers another option. Parsing, OCR, and embedding can remain on-premises while only sanitized queries and retrieved text chunks reach a cloud model. In that pattern, raw document content stays on local hardware, but the sanitized outbound material still needs a defined boundary.
The verification steps engineers should run before any PHI document workflow goes to production
Engineers should begin with contractual verification for the exact services and endpoints the workflow uses. The BAA must clearly cover all PHI, state the retention periods for exceptions, and name every subprocessor that handles PHI. For each subprocessor, confirm that an agreement covers the specific services involved. An unnamed subprocessor leaves the chain unresolved. The contract review should also distinguish an actual ZDR commitment from a promise not to use data for training.
Next, request the vendor’s log retention schedules. The answers need to identify what survives processing, how long it remains, where it is stored, and who can access it. Vague deletion language is not sufficient evidence. “We do not retain data for training purposes” does not address operational logs, while “data is deleted after [period]” is incomplete unless the provider defines the data. ZDR language that omits exceptions should block signing until those exceptions are explicit.
The architectural self-audit should then trace every copy of PHI created by the workflow. Staging buckets, intermediate debugging results, cache layers, and telemetry stores each need an explicit retention policy and TTL. This review must include both the application’s own infrastructure and its vendors. For self-hosted deployments, it must also check whether any component connects to an external service or lets the vendor in.
Provider terms change, and endpoints change. Either change should lead to a fresh audit that checks the affected contracts, controls, and data paths against the architecture running in production. Zero data retention remains credible only while those three continue to agree.


