All posts

SOC 2 for AI agents: controlling access for audit-ready operations (on Azure)

How can you prove that your AI agents are operating within SOC 2 controls? Auditors ask for concrete evidence that every request made by an automated workload is authorized, that sensitive data never leaks, and that any deviation from policy is captured and reviewed. In many Azure deployments, AI agents run as service principals with wide‑ranging permissions, connect directly to databases or internal HTTP services, and leave no trace of what they actually did. The result is a black box that sati

Free White Paper

AI Audit Trails + SOC Operations: The Complete Guide

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

Free. No spam. Unsubscribe anytime.

How can you prove that your AI agents are operating within SOC 2 controls? Auditors ask for concrete evidence that every request made by an automated workload is authorized, that sensitive data never leaks, and that any deviation from policy is captured and reviewed. In many Azure deployments, AI agents run as service principals with wide‑ranging permissions, connect directly to databases or internal HTTP services, and leave no trace of what they actually did. The result is a black box that satisfies functional requirements but fails every audit checkpoint.

Typical AI‑agent pipelines start with a static client secret stored in a key vault, then launch a container that talks straight to a PostgreSQL instance, an internal API, or a Kubernetes exec endpoint. The agent authenticates once, holds the credential for the whole lifetime of the pod, and can issue any command the underlying role permits. When a breach occurs, there is nothing to show which query exposed personal data, which command triggered a privilege escalation, or whether a human ever approved the operation.

From an auditor’s perspective, the missing artifacts are:

  • Immutable logs that tie each request to a specific identity and time stamp.
  • Evidence that privileged actions were gated by a human or automated policy.
  • Proof that any response containing regulated fields (PII, PHI, credit‑card numbers) was masked before it left the system.
  • Replay‑able sessions that can be examined line‑by‑line during a compliance review.

Providing these items requires more than just configuring Azure AD roles. The setup, identity federation, least‑privilege service accounts, and token issuance, determines who may start a request, but it does not enforce any guardrails on the request itself. Without a control point in the data path, the request reaches the target directly, bypassing audit, masking, or approval mechanisms.

Why the data path must host the enforcement layer for SOC 2

SOC 2’s Trust Services Criteria demand that access to critical systems be both authorized and monitored. When the enforcement point lives inside the agent process, the agent can be compromised, the logs can be altered, and masking can be disabled. The only place where you can guarantee that every byte flowing between identity and resource is inspected is the gateway that sits between them. That gateway becomes the single source of truth for who did what, when, and how the data was transformed.

In practice, this means routing every AI‑agent connection through a Layer 7 proxy that understands the underlying protocol (SQL, HTTP, SSH, etc.). The proxy can apply policies in real time, record the full session, and emit structured events that map directly to SOC 2 audit requirements. Because the proxy is deployed as a network‑resident agent inside the customer’s VNet, it never exposes credentials to the calling AI service, and it can be hardened independently of the workload.

How hoop.dev creates audit‑ready evidence for SOC 2

hoop.dev is built exactly for this purpose. It sits in the data path and becomes the authoritative enforcement point for every AI‑agent request. The platform records each session, masks regulated fields on the fly, and requires just‑in‑time (JIT) approval for privileged commands. Because the enforcement happens outside the AI container, the evidence cannot be tampered with by the workload itself.

Session recording

hoop.dev records the full request‑response stream for every connection. The recordings are stored in an immutable log that includes the identity token, the timestamp, and the exact protocol payload. Auditors can replay a session to see the exact query that was run against a database, the parameters passed, and the response returned. This satisfies the SOC 2 requirement for “complete and accurate logging of system activity.”

Continue reading? Get the full guide.

AI Audit Trails + SOC Operations: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

Inline data masking

When a response contains fields marked as sensitive, such as Social Security numbers or credit‑card digits, hoop.dev masks those values before they leave the gateway. The masking policy is defined centrally and enforced on every response, ensuring that downstream systems or logs never receive raw PII. The masking outcome is recorded alongside the original payload, giving auditors proof that the control was applied consistently. For details on configuring masking, see the feature guide.

Just‑in‑time approvals

For commands that exceed a predefined risk threshold (for example, a DROP DATABASE statement or a privileged Kubernetes exec), hoop.dev pauses the request and routes it to an approval workflow. A human reviewer can grant or deny the operation in real time. The approval decision, the reviewer’s identity, and the timestamp are all logged as part of the session record, providing the “authorized access” evidence required by SOC 2.

Policy‑driven command blocking

If a command violates a rule, such as attempting to read an unmasked column that is marked confidential, hoop.dev blocks the request outright. The block event is logged with the reason and the originating identity, demonstrating that the system actively prevents unauthorized data exposure.

All of these enforcement outcomes exist only because hoop.dev sits in the data path. The setup (Azure AD service principals, role‑based access controls, and token issuance) tells the gateway who is making the request, but hoop.dev is the component that actually enforces masking, approval, and logging.

Putting the pieces together on Azure

To achieve SOC 2‑ready evidence for AI agents on Azure, follow this high‑level flow:

  1. Define a minimal Azure AD service principal for each AI workload. Grant only the permissions required for its function.
  2. Deploy hoop.dev inside the same virtual network as the target resources (databases, internal APIs, Kubernetes clusters). Use the getting started guide for a quick Docker Compose or Helm installation.
  3. Configure each target connection in hoop.dev (PostgreSQL, HTTP API, etc.). The gateway stores the credential; the AI agent never sees it.
  4. Set up masking rules for any columns or JSON fields that contain regulated data. Define JIT approval policies for high‑risk commands.
  5. Run the AI agent against the hoop.dev endpoint instead of the raw resource. The agent authenticates via OIDC, and hoop.dev validates the token before allowing traffic.
  6. During a SOC 2 audit, export the session logs and approval records from hoop.dev. The logs are already structured for the Trust Services Criteria, so you can hand them to the auditor directly.

This approach satisfies the three core SOC 2 principles, security, availability, and confidentiality, without adding custom logging code to each AI service.

FAQ

Does hoop.dev replace Azure’s native logging?

No. hoop.dev complements Azure Monitor by providing protocol‑level visibility that Azure diagnostics does not capture. It records the exact payloads exchanged between the AI agent and the target, which Azure logs cannot reconstruct.

Can I use hoop.dev with existing AI pipelines?

Yes. Because hoop.dev works with standard client libraries (psql, curl, kubectl, etc.), you only need to point the endpoint to the gateway. No code changes are required in the AI model or container.

Is the recorded data tamper‑proof?

hoop.dev stores logs in an append‑only store that is separate from the agent’s runtime. While the platform does not claim cryptographic immutability, the separation ensures the workload cannot delete or modify its own records, which satisfies the auditor’s requirement for reliable evidence.

Ready to see how the open‑source project works? Explore the source code on GitHub and start building SOC 2‑ready AI agents 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