Can you prove that every AI‑driven request made through the OpenAI Agents SDK is auditable enough for HIPAA?
Most teams hand the SDK a static API key and let it call OpenAI’s endpoints directly. The key lives in source code, configuration files, or container images. Engineers share it across services, and the same credential is used for production, staging, and test environments. When an agent generates a prompt that contains protected health information (PHI), the request and response travel over the public internet without any central log, without any record of who triggered the call, and without any way to scrub the PHI before it reaches downstream storage.
Even when organizations adopt modern identity providers and issue short‑lived tokens to the SDK, the request still bypasses any enforcement point. The token proves the caller’s identity to OpenAI, but the call lands straight on the OpenAI service. No gateway records the payload, no inline masking removes unnecessary PHI, and no just‑in‑time approval step can stop a risky query. The result is a gap between the HIPAA requirement for detailed audit trails and the reality of an unchecked API call.
What HIPAA expects from AI‑enabled workloads
HIPAA’s Security Rule demands that covered entities maintain:
- Complete logs of who accessed or modified electronic protected health information (ePHI).
- Evidence that access was limited to the minimum necessary.
- Controls that can block or require approval for actions that could expose PHI.
- Durable records that can be produced during an audit.
For an AI service, those controls translate into:
- Recording each prompt and response together with the invoking identity.
- Masking or redacting PHI that appears in the model’s answer before it is stored or displayed.
- Requiring a human reviewer to approve high‑risk prompts, such as those that request large amounts of patient data.
- Keeping a persistent session log that can be replayed for investigations.
How hoop.dev creates the evidence stream
hoop.dev sits in the data path between the OpenAI Agents SDK and the OpenAI endpoint. The gateway terminates the SDK’s HTTP request, inspects the payload, applies policy, and then forwards the request onward. Because every request passes through this single proxy, hoop.dev becomes the only place enforcement can happen.
When a prompt arrives, hoop.dev records the caller’s identity, the exact prompt text, and the time of the request. Before the request reaches OpenAI, the gateway can apply a just‑in‑time approval workflow: if the prompt matches a pattern that could expose PHI, a designated reviewer must approve it. If approval is not granted, hoop.dev blocks the request and logs the denial.
After OpenAI returns a response, hoop.dev scans the answer for fields marked as PHI. Configured masking rules replace those values with placeholders, ensuring that downstream systems never see raw PHI. The masked response, together with the original prompt, is stored as a replayable session record. The record includes the identity of the original caller, the approval decision (if any), and the masking actions applied.
All of this evidence lives outside the SDK process, in a storage backend that the gateway writes to. Because hoop.dev controls the entire session lifecycle, it can guarantee that every piece of evidence required by HIPAA is captured, retained, and can be exported for audit without any additional instrumentation in the SDK.
Setup: identity and least‑privilege tokens
The first step is to configure the OpenAI Agents SDK to obtain an OIDC token from the organization’s identity provider. That token proves who the caller is but does not grant direct access to OpenAI. Instead, the token is presented to hoop.dev, which validates it and maps group membership to access policies. The SDK never sees the credential that the gateway uses to talk to OpenAI, preserving the principle of least privilege.
The data path: hoop.dev as the enforcement boundary
All network traffic from the SDK to OpenAI flows through hoop.dev. Because the gateway is the only point where traffic is inspected, it can enforce masking, approval, and logging consistently. No other component in the architecture can bypass these controls without a separate, equally secure tunnel, which the design deliberately avoids.
Enforcement outcomes that satisfy HIPAA
- hoop.dev records each session, providing a complete audit trail.
- hoop.dev masks PHI in real time, ensuring the minimum‑necessary principle.
- hoop.dev requires just‑in‑time approval for risky prompts, blocking unauthorized exposure.
- hoop.dev retains persistent logs that can be replayed during an audit.
Because these outcomes exist only because hoop.dev sits in the data path, removing the gateway would eliminate the evidence stream entirely.
Getting started with hoop.dev
Deploy the gateway using the official getting‑started guide. The documentation walks you through configuring OIDC authentication, defining PHI masking rules, and enabling approval workflows for the OpenAI Agents SDK. For a deeper dive into policy language and audit‑log formats, see the learn section of the site.
Once the gateway is running, point the SDK’s endpoint URL to the hoop.dev proxy address. From that point forward, every request is subject to the controls described above, and every piece of evidence required by HIPAA is automatically generated.
FAQ
Does hoop.dev make the OpenAI Agents SDK HIPAA‑compliant?No. hoop.dev generates the audit evidence that HIPAA expects, but compliance is ultimately a responsibility of the organization and requires a full risk assessment.How does hoop.dev mask PHI in AI responses?It inspects the response payload at the protocol layer, applies configurable redaction patterns, and stores only the masked version while retaining a record of the masking action.What audit data is retained for each session?hoop.dev logs the caller identity, timestamp, original prompt, approval decision, masking actions, and the final masked response. All logs can be exported for audit purposes.
Ready to see the code and contribute? Explore the open‑source repository on GitHub and start building a HIPAA‑ready AI workflow today.