Implementation Guide

Encrypting PHI in Transit to an LLM API Under HIPAA

The HIPAA Security Rule transmission security standard (45 CFR 164.312(e)) requires safeguards against unauthorized access to electronic PHI in transit. Encryption is an addressable specification, so you either implement it or document an equivalent alternative and the reasoning.

Where PHI is exposed along the request path

An LLM call is rarely a single connection from an application to a model. Each hop is a place where traffic may be decrypted, copied, or misrouted.

PHI exposure by hop
HopExposure
1. Client SDKsMisconfigured clients may disable certificate verification, pin outdated protocol versions, or fall back to plaintext HTTP through a custom base URL.
2. Gateways and proxiesTLS often terminates here for inspection or routing. The upstream leg must be re-encrypted, and payload logging must be controlled.
3. Orchestration and agent tool callsAgents may pass PHI to tools, retrieval systems, or other services over connections that were never reviewed.
4. Logging and observabilityPrompts and completions captured in traces, debug logs, or analytics can leave PHI in plaintext at rest and in transit to a vendor.
5. Network egressWithout egress enforcement, a workload can reach unapproved endpoints, including model APIs outside your agreement scope.

Configuring an encrypted path

For LLM API calls, the practical approach is to enforce modern TLS with strict certificate validation on every hop, restrict egress to approved endpoints, keep plaintext PHI out of logs and telemetry, and retain evidence that these controls work.

Controls across the LLM request path
LayerControl
ClientEnforce a TLS minimum version and certificate validation in SDKs.
GatewayRe-encrypt upstream traffic and avoid plaintext payload logging.
NetworkAllow egress only to approved model endpoints.
ObservabilityRedact or exclude PHI from traces and logs.
EvidenceRetain configurations, scan results, and egress records.

Verifying and documenting the controls

Configuration alone is not evidence. Verify the path by testing it.

Test the path

Run protocol and cipher scans against every endpoint you operate, including internal gateways. Attempt connections with deprecated versions and with an invalid certificate from a test client, and confirm they fail. Capture packet-level or proxy-level samples in a test environment to confirm that no hop sends payloads in cleartext, including calls made by agent tools.

Address the places teams forget

Review what your logging and tracing pipelines record. If prompts and completions are captured, either redact PHI before capture or treat the logging system as in scope for the same safeguards, including its own transport encryption. Review SDK debug settings and error handlers, which sometimes write request bodies.

Keep audit evidence

For audit, keep records that show the decision and the operation of the control. Useful items include:

  • The documented addressable-specification assessment
  • The TLS baseline and the NIST revision it references
  • Gateway and client configuration records
  • Scan results with dates
  • A certificate inventory
  • Egress rules and egress logs
  • The executed business associate agreement with the provider

Where encryption in transit stops

Encryption does not replace the following controls, which must be addressed separately:

  • A business associate agreement
  • Minimum necessary review
  • Retention controls

Build evidence into the request path

See how runtime policy enforcement and audit logging can support verification of how AI agents handle sensitive data.

Explore Runtime Governance