Can the OpenAI Agents SDK be used to process phi without breaking the audit and privacy rules that regulators expect?
Regulations that protect protected health information require three core technical controls: a tamper‑evident record of who accessed what, mechanisms that prevent the accidental exposure of sensitive fields, and a way to demonstrate that each access was authorized at the moment it occurred. Auditors look for immutable logs, evidence of just‑in‑time approvals, and proof that any data returned to a downstream system was filtered according to policy.
When developers embed the OpenAI Agents SDK directly into an application, the SDK talks straight to the OpenAI endpoint using a static API key. The request travels over the public internet, the application reads the raw response, and no central point enforces masking, blocks disallowed prompts, or captures a complete audit trail. In practice this lets the system violate the evidence‑generation requirement, and any breach of phi may go unnoticed until after the fact.
The missing piece is a data‑path component that sits between the SDK and the OpenAI service, inspects each request and response, and applies policy before the data reaches the application. That component must record every session, mask sensitive fields on the fly, and trigger human approval for risky operations. Without it, the SDK alone cannot satisfy the evidence‑generation requirement.
How hoop.dev provides the required data‑path
You deploy hoop.dev, a Layer 7 gateway, inside the same network as the application so that all SDK traffic passes through it. The gateway forces every request through itself, authenticates callers via OIDC or SAML, reads group membership, and then decides whether the request may proceed.
After the gateway allows a request, it examines the payload. If the request or the response contains fields that match a phi pattern, hoop.dev replaces the value with a masked placeholder before the data reaches the application. If the operation qualifies as high‑risk, such as generating a large text block that could contain a full medical record, hoop.dev pauses the request and routes it to a human approver. The request continues only after an approver gives explicit approval.
Because hoop.dev sits in the data path, the gateway captures every interaction. It writes a session record that includes the caller identity, timestamp, request parameters, masking actions taken, and the approval decision. The system retains these records in a searchable audit log that auditors can query to see who accessed phi, when, and under what policy.
