HIPAA Model Index HIPAA LLM APIs
Which AI Gateway Layer Intercepts PHI Before the Model Provider Sees It
- Published
- November 5, 2026
- Updated
- November 14, 2026
- Reading time
- 9 min read
Summary
The input policy layer is the checkpoint that keeps patient data from reaching providers.
The AI gateway’s input policy layer intercepts PHI after authentication and before routing to a model provider. For teams handling patient data, a HIPAA-compliant AI gateway needs more than redaction, including BAA coverage, retention controls, access controls, and audit logs that do not retain raw PHI. Every request bound for a provider must pass through that enforcement point.
Why the boundary between your application and a model provider is where patient data is most at risk
A nurse’s clinical note can contain a room number, a medical record number, a relative’s name, and a discharge date. A phone-number regex can run successfully while leaving those details untouched. Successful detection is not the same as complete protection. When that note enters a prompt, the remaining identifiers cross the provider boundary unless another control catches them.
The exposure begins with how applications assemble requests. Application code combines instructions, conversation history, retrieved records, tool results, and user input into a single payload. Any component can introduce PHI without a deliberate decision to disclose it. A retrieved discharge summary and a tool result that contains a medical record number need the same checks as the user’s message.
HIPAA’s 18 identifier categories extend well beyond names and phone numbers. They include sub-state geography, date elements other than year, medical record and account numbers, device identifiers, URLs, IP addresses, biometrics, and full-face photos. A single prompt can hold identifiers from several categories at once. The model cannot serve as the privacy boundary because it has no native concept of data sensitivity. Once the payload reaches an external provider, that provider’s logging, abuse-monitoring, and retention policies apply before the application team can step in.
What default provider data handling means for a team that has not yet deployed a gateway
Provider defaults are not a substitute for HIPAA controls. Model providers keep API data for abuse monitoring by default, and eligible API customers must get approval for OpenAI’s zero-data-retention access because it does not come with standard pay-as-you-go access. Deleting data after it has been sent does not undo an unauthorized disclosure. Sending PHI to a provider without a signed Business Associate Agreement is a HIPAA Privacy Rule violation and a presumed breach, although a risk assessment may establish a low probability of compromise and affect reportability.
Eligibility also depends on the product surface. The Anthropic API and sales-assisted Claude Enterprise, OpenAI Enterprise, Azure OpenAI, Google Vertex, and AWS Bedrock can support BAAs for eligible configurations. Consumer ChatGPT and Claude.ai do not offer that coverage. The underlying model’s identity therefore cannot establish whether a particular integration is appropriate for PHI.
Retention controls also need ongoing work because zero-data-retention settings must be enforced on every request. Just one call through a non-ZDR path breaks that guarantee. Without central enforcement, each new microservice, integration, or agent must independently select a covered endpoint, apply retention settings, and avoid consumer surfaces.
Where in the request pipeline PHI interception must happen, and why earlier is not always enough
A gateway addresses that fragmentation by acting as a reverse proxy between application services and model providers. The logical flow is application → input policy → gateway routing → model provider → output policy → application, with a branch to the audit log. The input hook runs after caller authentication and before routing begins. At that point, the gateway can apply one policy to the assembled prompt regardless of which service produced it.
Earlier redaction can help, but it is insufficient. Redaction embedded in individual services or SDKs can drift across implementations, disappear from new features, and leave no unified audit trail. It also cannot protect content added after that particular check. The provider-bound payload is the object that needs inspection.
Input and output policies protect different boundaries. Input redaction prevents disclosure to provider logs and abuse-monitoring systems, while output redaction protects the caller without undoing an upstream transmission. Scanning both directions covers more of the data path but adds latency, especially when streamed responses require buffering.
The audit branch needs an enforcement policy of its own. A gateway that forwards a sanitized prompt but stores the raw version in logs has preserved PHI in a long-lived copy. Exported traces belong within the same review because protecting the live request does not protect its stored replicas.
How the detection layer works and what regex, NER, and secret scanners each miss
Regex identifies structured formats, named entity recognition detects contextual mentions, and secret scanners identify credentials that may not be PHI but should not reach a provider. Each covers gaps left by the others. Policies must account for what those engines miss, since a successful match does not prove that the rest of the payload is safe.
Regex works well for structured identifiers such as SSNs, phone numbers, email addresses, and IP addresses. Validation, including checksums where applicable, reduces false positives. But a pattern detector cannot reliably spot a person’s name or tell what a room number beside a discharge date reveals. Custom health-record recognizers are needed for identifiers and combinations that generic patterns overlook.
Named entity recognition adds contextual coverage for names, addresses, and locations. Its accuracy can degrade on short inputs, non-English text, uncommon names, and clinical abbreviations, all of which are relevant to healthcare prompts. General-purpose NER is therefore not a complete clinical detector. Secret scanning provides a separate safeguard for API keys, tokens, JWTs, and private keys rather than attempting to classify them as patient identifiers.
HHS de-identification guidance requires removal of all date elements except year for dates directly related to an individual under Safe Harbor. Those dates fall into that category even when no other identifier appears nearby. Context-sensitive recognition must supplement that explicit requirement.
What happens to a detected value through masking, blocking, or synthetic replacement
A match becomes protection only when the gateway enforces an action. Irreversible masking replaces a value with a typed placeholder, such as [NAME] or [SSN], without retaining the original for restoration. This suits workloads where reasoning does not depend on the actual value. The policy can keep the clinical content around the identifier without exposing the identifier itself.
Reversible tokenization serves workflows that need coherent values returned to the application. Data443 describes a detect-redact-and-restore round trip in which the gateway keeps the mapping in encrypted session state. In a name-only illustration, a raw prompt containing a patient’s name becomes a provider-bound prompt containing [NAME], and a returned response containing that token has the original name restored before reaching the application. The mapping stays inside the gateway environment. Other detected identifiers require their own treatment.
The token’s construction affects de-identification claims. Under Safe Harbor, re-identification codes must not derive from or relate to information about the individual, making randomly generated tokens with a secure mapping the standard approach. Under Expert Determination, hashed codes derived from PHI may be used if the keys are not disclosed.
Synthetic replacement instead inserts a realistic fictitious value of the same type when format is useful to the task. Blocking is appropriate when substitution would be unsafe, including a payment workflow requiring an exact account number or a prompt containing a private key. Monitor mode changes nothing in the payload. It is a tuning tool, so enforcement choices must be tailored to the detector and workload.
What the HIPAA compliance stack requires from a gateway beyond redaction alone
HIPAA-compliant AI requires coordinated controls beyond the detector. These include signed BAAs with providers receiving PHI, per-request zero-data-retention enforcement, encryption in transit and at rest, access controls with audit logging, PHI minimization, and breach notification readiness. Redaction addresses only part of that obligation. A gateway can centralize much of the technical enforcement, but its presence does not replace contracts or operational readiness.
A hosted gateway receives unredacted prompts before sanitizing them, so its operator becomes a business associate and must sign a BAA. A self-hosted gateway inside the customer’s network keeps a third-party gateway operator out of the raw-prompt path.
Access controls then determine which principals can reach PHI-touching workloads. RBAC can restrict teams to particular models, virtual keys can be scoped per project, and SSO can connect access to an identity provider. Audit records need enough detail for an OCR investigation, including authenticated user, team identity, key ID, model version, token usage, detector matches, and enforcement actions. They should not preserve the raw matched values.
Centralization works only if every relevant call passes through it. Under that condition, a new service inherits routing, retention, redaction, and audit policies, eliminating the need to rebuild them independently. A bypass path reintroduces the same per-integration fragility that the gateway was intended to remove.
Which AI gateway options support PHI interception, and how do their architectures differ
Deployment boundary is the first distinction between implementations. Self-hosting can keep raw prompts inside the customer’s network, while a managed gateway introduces another operator into the PHI path. The protection a deployment can give then depends on its detection engines, enforcement actions, response inspection, and whether it has audit records. These capabilities are not interchangeable.
Gravitee AI Gateway introduced its gateway in version 4.10 and added the PII Filtering Policy in version 4.11. The policy attaches at the API level and covers incoming prompts and outgoing responses, with redaction or blocking for MCP and LLM proxy traffic. Its named policy placement makes the interception point explicit. That is a different architectural question from whether the selected deployment has the necessary contractual coverage.
AISIX AI Gateway uses gateway-local detectors in cloud and open-source deployments. Its coverage includes email addresses, mainland China mobile and resident ID numbers, bank cards, SSNs, IP addresses, API keys and tokens, JWTs, and PEM private keys. It supports masking, blocking, custom patterns, and scoped policy attachments. Structured number detectors use checksum validation to reduce false positives, but that coverage does not eliminate the need to test clinical free text.
LiteLLM Proxy has an OpenAI-compatible interface for a large catalogue of models, but admin SSO, audit logs, and some enterprise controls need an enterprise license. Kong AI Gateway’s PII Anonymizer Service offers placeholder and synthetic replacement, with response scanning available in version 3.12 and later. The service is Enterprise-only.
Cloudflare AI Gateway is within the scope of Cloudflare’s HIPAA attestation, and Cloudflare enters into BAAs with Enterprise customers whose use involves PHI. Its DLP capability scans prompts and responses and can flag or block sensitive information. The documentation does not describe an action that rewrites and forwards a sanitized payload. Blocking therefore should not be represented as equivalent to redaction when a workflow needs the request to proceed.
How to evaluate a gateway's PHI interception capability before committing to it
A team evaluating a gateway should first trace where the raw prompt travels. If it reaches a third-party operator, the evaluation must establish that operator’s BAA coverage and HIPAA posture. Provider coverage requires the same precision at the model-surface level. Routing policies should restrict PHI workloads to covered endpoints and block uncovered destinations.
Detection tests should use the data patterns the team works with. Clinical notes, insurance forms, and healthcare agent tool results expose weaknesses that generic NER benchmarks may miss, including abbreviations, combined fields, and room numbers adjacent to dates. Response and tool-call scanning are required for agentic healthcare workloads because tools and models can return PHI absent from the original prompt. Input-only inspection leaves that path incomplete.
The audit design deserves a separate test. Records should name the principal, detectors, and enforcement actions without keeping raw PHI for debugging. Rollout should begin with monitor mode on a narrow scope to measure false positives and latency, with caller handling for policy errors defined before enforcement expands. Traffic like the kind the gateway will handle should be tested before deployment expands, and monitor mode should never be described as a protected data path.
With BAA coverage verified for each destination and controls enforced at the gateway, a team can use eligible providers and future models without rebuilding compliance logic in every application. Concentrate AI, a managed, HIPAA-compliant AI gateway that redacts PHI before requests reach model providers and offers a BAA on its paid plan, is one such option for healthcare startups and other teams handling PII or PHI. That flexibility depends on the gateway controlling the whole provider-bound path.
How to cite
Marcus Delacroix-Webb. Which AI Gateway Layer Intercepts PHI Before the Model Provider Sees It. HIPAA Model Index. November 5, 2026. hipaamodelindex.com/posts/which-ai-gateway-layer-intercepts-phi-before-the-model-provider-sees-it
© 2026 HIPAA Model Index