All posts

Keeping Self-Hosted Models HIPAA-Compliant

A single HIPAA violation can cost millions in fines and erode patient trust. When an organization runs its own AI models on‑premise, the same regulatory stakes apply: any protected health information (PHI) that passes through the model must be accounted for, masked where required, and never exposed to unauthorized eyes. Self‑hosted models are attractive because they keep data inside the corporate network, but that advantage disappears the moment a request reaches the model without a transparent

Free White Paper

Self-Service Access Portals + HIPAA Compliance: The Complete Guide

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

Free. No spam. Unsubscribe anytime.

A single HIPAA violation can cost millions in fines and erode patient trust. When an organization runs its own AI models on‑premise, the same regulatory stakes apply: any protected health information (PHI) that passes through the model must be accounted for, masked where required, and never exposed to unauthorized eyes.

Self‑hosted models are attractive because they keep data inside the corporate network, but that advantage disappears the moment a request reaches the model without a transparent control point. Engineers often connect directly with a client library, a curl command, or an internal script, trusting that the model’s runtime logs are sufficient. In practice those logs are incomplete, lack per‑user attribution, and rarely capture the exact query‑response exchange needed for a HIPAA audit.

Why HIPAA evidence matters for self‑hosted models

HIPAA’s Security Rule demands documented evidence that only authorized individuals accessed PHI, that every access was logged, and that any disclosure was intentional and approved. Auditors look for:

  • Exact timestamps of each request and response.
  • Identification of the user or service account that initiated the request.
  • Proof that sensitive fields were masked or redacted before leaving the system.
  • Approval records for high‑risk operations.
  • Replayable session recordings for forensic analysis.

Without a single point that can capture all of these items, organizations end up stitching together logs from the model runtime, the operating system, and network devices, an error‑prone process that often fails to satisfy auditors.

HIPAA evidence requirements

The rule does not prescribe a specific technology, but it does require that the evidence must be immutable, time‑ordered, and tied to an identity. That means the control surface must sit on the traffic path between the identity provider and the model endpoint, not after the fact.

Why a data‑path gateway is required

Setup components, OIDC or SAML identity providers, service‑account roles, and least‑privilege policies, decide who may start a request, but they cannot enforce masking, approval, or recording on the data itself. The only place enforcement can happen is the data path that carries the request to the model. By inserting a gateway at that point, you gain the ability to apply policies in real time and to produce the audit artifacts HIPAA demands.

hoop.dev as the enforcement layer

hoop.dev is a Layer 7 gateway that proxies connections to self‑hosted model endpoints. It authenticates users via OIDC/SAML, reads group membership, and then applies policy checks before any data leaves the model. Because hoop.dev sits in the data path, it can:

  • Record each session with full request and response details.
  • Mask PHI fields in real time, ensuring that only sanitized data is returned to the caller.
  • Require just‑in‑time human approval for operations flagged as high‑risk.
  • Store immutable logs that can be exported to a SIEM or audit archive.
  • Provide replayable recordings for forensic review.

All of these outcomes exist only because hoop.dev is the gateway that intercepts the traffic; the upstream identity system alone cannot produce them.

Artifacts hoop.dev creates for auditors

When a request passes through hoop.dev, the following artifacts are generated automatically:

  • Session log entry: User ID, client IP, timestamp, and the exact query sent to the model.
  • Response record: The model’s answer, with any PHI fields masked according to policy.
  • Approval chain: If a request required manual approval, the approver’s identity, decision, and timestamp are captured.
  • Audit trail: A chronological series of all session entries, stored in an immutable log.
  • Replay file: A binary recording that can be replayed to reproduce the exact interaction for investigations.

These artifacts satisfy the evidence checklist that HIPAA auditors expect, and they are produced without any code changes to the model itself.

Continue reading? Get the full guide.

Self-Service Access Portals + HIPAA Compliance: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

High‑level deployment steps

1. Deploy the hoop.dev gateway near your model runtime using Docker Compose or Kubernetes. The getting‑started guide walks you through a one‑command launch.

2. Configure OIDC or SAML authentication so that hoop.dev can verify each user’s token.

3. Register the model endpoint as a connection in hoop.dev, supplying the host, port, and the service credential that the gateway will use.

4. Define masking policies that identify PHI fields in model responses. The learn section provides examples of common patterns.

5. Enable just‑in‑time approval for any operation you consider high‑risk, such such as bulk data exports.

Once these steps are complete, every interaction with the model flows through hoop.dev, and the audit artifacts are generated automatically.

Operational considerations

hoop.dev does not replace a well‑designed IAM program; you still need to enforce least‑privilege roles at the identity provider. The gateway’s value is that it turns those roles into enforceable, observable actions on the data path. Because hoop.dev is open source and MIT‑licensed, you can inspect the code, extend policies, or integrate the logs with existing compliance tooling.

Remember that hoop.dev itself is not a HIPAA certification. It supplies the evidence you need to demonstrate compliance as part of a broader program that includes risk assessments, employee training, and breach‑response planning.

FAQ

Do I need to change my model code to use hoop.dev?

No. hoop.dev acts as a transparent proxy. Your existing client libraries or scripts simply point at the gateway’s address instead of the model’s raw endpoint.

Does hoop.dev store PHI in its logs?

hoop.dev records the interaction, but any PHI is masked according to the policies you define. Logs can be retained for the period required by your compliance calendar and can be encrypted at rest.

How does hoop.dev scale with high request volumes?

The gateway runs as a containerized service and can be horizontally scaled in Kubernetes or a Docker‑compose swarm. Each instance shares the same policy definitions, so scaling does not affect audit consistency.

By placing a policy‑driven gateway in front of your self‑hosted models, you generate the concrete, audit‑ready artifacts that HIPAA auditors demand while keeping the operational workflow familiar to engineers.

Explore the open‑source repository on GitHub to get started: https://github.com/hoophq/hoop.

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