All posts

HIPAA Compliance for Embeddings

How can you prove HIPAA compliance for your embedding pipelines without exposing sensitive patient data? Most teams that build AI‑enabled applications treat embeddings as a simple function call: a service sends raw text to a hosted model, receives a vector, and stores it alongside other business data. The call is often made from a long‑running service account that holds a static API key for the model provider. Because the request travels directly from the application to the external endpoint, t

Free White Paper

HIPAA Compliance: The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

How can you prove HIPAA compliance for your embedding pipelines without exposing sensitive patient data?

Most teams that build AI‑enabled applications treat embeddings as a simple function call: a service sends raw text to a hosted model, receives a vector, and stores it alongside other business data. The call is often made from a long‑running service account that holds a static API key for the model provider. Because the request travels directly from the application to the external endpoint, there is no central point that can see who initiated the call, what data was sent, or whether the response contained protected health information (PHI). Audit logs are limited to the provider’s opaque telemetry, and any accidental leakage of PHI goes unnoticed until an incident response team discovers it in a downstream database.

This pattern fixes one piece of the puzzle, authentication of the service account, but it leaves the critical controls wide open. The request still reaches the model provider directly, bypassing any gateway that could enforce least‑privilege data handling, require a human approval step for high‑risk inputs, or mask PHI in the model’s response. Without a choke point, organizations cannot demonstrate that every embedding operation was authorized, recorded, or scrubbed of protected data, which are core expectations of HIPAA’s Security Rule.

HIPAA requirements for embedding services

HIPAA obligates covered entities to implement safeguards that protect the confidentiality, integrity, and availability of PHI. For machine‑learning workloads that generate embeddings, the rule translates into three technical expectations:

  • Access control: Only authorized identities may invoke the embedding service, and each invocation must be traceable to a specific user or system.
  • Auditability: Every request and response must be logged in an immutable fashion so that auditors can reconstruct who accessed PHI, when, and for what purpose.
  • Data minimization and masking: PHI should be stripped or masked before it leaves the protected environment, and any residual PHI in the model’s output must be redacted.

Meeting these controls requires a point in the architecture where identity, policy, and data flow intersect. That point is the data path, not the authentication provider or the downstream database.

Why a gateway is the only place to enforce those requirements

Setup components such as OIDC or SAML tokens decide who is making a request, but they do not enforce what the request can do once it reaches the embedding service. The enforcement must happen where the request is actually transmitted, the network layer that carries the payload. By inserting a Layer 7 gateway between the client and the model endpoint, the organization creates a single, inspectable choke point. The gateway can read the request, apply policy, and then forward only the allowed portion to the model.

Because the gateway sits in the data path, it is the only component that can guarantee the three HIPAA‑required safeguards. No other element in the stack has visibility into both the identity token and the raw payload, so only the gateway can combine those signals to make a real‑time decision.

How hoop.dev generates the evidence HIPAA auditors need

hoop.dev provides the required gateway. It authenticates each caller against the organization’s identity provider, extracts group membership, and then evaluates a policy that reflects HIPAA’s access‑control rules. When a request matches a policy that requires additional scrutiny, hoop.dev pauses the flow and routes the request to a human approver before forwarding it to the embedding service.

Continue reading? Get the full guide.

HIPAA Compliance: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

Once the request is approved, hoop.dev records the full session, including the identity, timestamp, input payload, and the model’s raw response. The recording is stored outside the client process, giving auditors an audit log that proves who accessed PHI and when.

Before the response leaves the gateway, hoop.dev applies inline masking. Any field that matches a PHI pattern is redacted or tokenized, ensuring that downstream systems never receive raw protected data. This masking happens in real time, so the downstream database only sees compliant data.

In addition to masking, hoop.dev can block disallowed operations entirely. If a policy forbids sending certain data types to the model, the gateway rejects the request with a clear error, preventing the data from ever leaving the protected environment.

All of these outcomes, just‑in‑time approval, session recording, inline masking, and command blocking, exist only because hoop.dev sits in the data path. Removing the gateway would eliminate the audit trail, the masking step, and the approval workflow, leaving the organization unable to satisfy HIPAA’s evidence requirements.

Getting started with hoop.dev for embeddings

To bring these controls to an embedding pipeline, deploy hoop.dev as a Docker Compose service or in a Kubernetes cluster, then register the embedding endpoint as a connection. The gateway holds the model provider’s credential, so your application never sees the secret. Identity is handled via OIDC, and policies are defined in the hoop.dev configuration to reflect your HIPAA risk model.

For a step‑by‑step walkthrough, see the getting started guide. The feature documentation explains how to configure just‑in‑time approvals, inline masking rules, and session replay for audit purposes.

FAQ

Does hoop.dev make my embedding service HIPAA‑certified?

No. hoop.dev generates the audit evidence that HIPAA auditors require, but compliance is a shared responsibility that also includes proper configuration, risk assessment, and organizational policies.

Can hoop.dev mask PHI in real time without changing my application code?

Yes. Because hoop.dev operates at the protocol layer, it can apply masking rules to responses before they reach your application, eliminating the need for code changes.

What happens to the logs after a session ends?

hoop.dev stores each session record outside the client process. The logs can be exported to your SIEM or retained for the period required by HIPAA.

Ready to add HIPAA‑ready guardrails to your embedding workloads? Explore the open‑source repository and start building a compliant pipeline today.

Open source

Save the open-source gateway for agent data access

Hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.

Star and save the repo →More posts