All posts

HIPAA for AI agents: controlling access for audit-ready operations (on BigQuery)

A breach of protected health information (PHI) that violates HIPAA, handled by an AI agent, can trigger fines, lawsuits, and loss of patient trust. Organizations are eager to let large language models read and write data in warehouses such as BigQuery because the insight speed outweighs perceived risk. The temptation is to hand the model a service‑account key and let it run queries unattended. In practice many teams store that key in a CI secret store, embed it in container images, or check it

Free White Paper

AI Audit Trails + Audit-Ready Documentation: The Complete Guide

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

Free. No spam. Unsubscribe anytime.

A breach of protected health information (PHI) that violates HIPAA, handled by an AI agent, can trigger fines, lawsuits, and loss of patient trust. Organizations are eager to let large language models read and write data in warehouses such as BigQuery because the insight speed outweighs perceived risk. The temptation is to hand the model a service‑account key and let it run queries unattended.

In practice many teams store that key in a CI secret store, embed it in container images, or check it into code repositories. The agent then authenticates directly to BigQuery, bypasses any human review, and executes whatever SQL it generates. Because the connection is a straight line from the agent to the data service, there is no central log of who asked what, no ability to scrub protected fields, and no way to stop a dangerous command before it reaches the database. From a hipaa perspective this lack of visibility and control is a direct violation of audit and safeguard requirements.

The first step toward a safer model is to treat the AI process as a non‑human identity and assign it the minimum set of scopes required for its workload. Even with a tightly scoped service account, the request still travels straight to BigQuery, leaving the organization without a record of the exact query, without inline redaction of PHI, and without an approval checkpoint for high‑risk operations. Those gaps keep the environment out of compliance with HIPAA’s audit and safeguard requirements.

How hoop.dev generates HIPAA evidence for AI agents

hoop.dev inserts a data‑path gateway between the AI agent and BigQuery. The gateway runs inside the same network segment as the warehouse and terminates the agent’s TLS session. Because every request passes through this layer, hoop.dev can enforce policy in real time: hoop.dev masks protected health information in query results, hoop.dev requires a just‑in‑time approval for queries that touch regulated tables, hoop.dev records the full SQL statement and response, and hoop.dev stores the session for replay. All enforcement happens at the gateway, not in the agent or in BigQuery, ensuring that the control surface cannot be bypassed.

hoop.dev logs each user‑agent pair, the time of the request, the exact query text, and any masking actions applied. hoop.dev captures approvals as signed events, and hoop.dev records the session for forensic replay. Because the gateway is the sole point where data leaves the warehouse, auditors can rely on hoop.dev’s logs to demonstrate that only authorized queries accessed PHI, that hoop.dev never exposes PHI in clear text, and that any deviation would have been blocked.

Continue reading? Get the full guide.

AI Audit Trails + Audit-Ready Documentation: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

The architecture also respects the principle of least privilege. The AI service account only needs permission to talk to the gateway, while the gateway holds the credential that actually talks to BigQuery. This separation means that rotating the service account does not require changing database credentials, and compromised agents cannot reach the data store without passing through the enforced policy layer.

Mapping HIPAA requirements to the gateway

HIPAA’s Security Rule requires covered entities to implement audit controls that record user activity, transmission security that protects PHI in transit, and integrity controls that prevent unauthorized alteration of data. hoop.dev satisfies audit controls by logging every session with timestamps and the full request/response payload. Transmission security is maintained because the gateway terminates TLS and re‑establishes a separate, tightly scoped TLS connection to BigQuery, ensuring that any man‑in‑the‑middle attempt would be detected at the gateway. Integrity is enforced by the gateway’s command‑blocking engine, which can reject statements that attempt to modify protected tables without explicit approval. Because all these controls are applied at the data‑path gateway, the organization can point auditors to a single source of truth for HIPAA evidence.

Scalability and open‑source flexibility

Since hoop.dev is open source and runs as a lightweight Docker container, it can scale horizontally to handle thousands of concurrent AI queries without adding latency that would disrupt analytics pipelines. The community provides plugins for custom masking rules and approval workflows, allowing teams to tailor the solution to their specific PHI schemas. Being MIT licensed, the code can be inspected and extended to meet internal compliance reviews.

Start securing your AI‑driven analytics by following the getting‑started guide and reviewing the feature documentation. Explore the open‑source code and contribute on GitHub.

FAQ

How does hoop.dev differentiate between human and AI identities for audit purposes?
Setup decides the AI’s service account and OIDC token, but hoop.dev is the data‑path that validates the token, maps it to a policy, and records the activity, creating a clear audit trail for each non‑human request.

Will inline masking affect query performance?
hoop.dev applies masking at the gateway after the database returns results, adding only minimal processing overhead. The gateway is designed to keep latency low while still providing full session recording and audit logs.

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