Uncontrolled AI agents can silently exfiltrate or corrupt production data, jeopardizing audit compliance.
What SOC 2 expects from automated workloads
SOC 2 evaluates five trust service criteria: security, availability, processing integrity, confidentiality, and privacy. For any system that runs code automatically, the standard demands concrete evidence that:
- Only authenticated identities can initiate a session.
- Each request is bounded by the principle of least privilege.
- All actions are recorded with exact timestamps and the identity that performed them.
- Any change that could affect data confidentiality or integrity is approved by a designated reviewer.
- Sensitive data in responses is protected from unintended exposure.
When the workload is an AI agent that talks to a PostgreSQL instance, the auditor will look for logs that tie every SQL statement back to the agent’s service account, records of any manual approvals, and proof that personally identifiable information (PII) or secret keys are masked before they leave the database.
The typical, insecure baseline for AI‑driven database access
Most teams provision an AI service account with a static database password and let the model connect directly to PostgreSQL. The connection bypasses any gatekeeper, so the agent can run arbitrary queries, retrieve raw rows, and write data without any visibility from the security team. Because the credential lives in the container image or secret store, a compromise of the container gives an attacker the same unrestricted database access. There is no session replay, no inline masking, and no approval workflow – all of which SOC 2 expects as part of a controlled environment.
Adding identity and least‑privilege controls, but still missing audit evidence
Moving the credential management to an OIDC‑based identity provider and assigning the agent a role that only allows SELECT on a specific schema is a step forward. The agent now authenticates with a short‑lived token, and the role limits the tables it can touch. However, the request still travels straight to PostgreSQL, leaving the following gaps:
- No guaranteed record of which exact rows were read or written.
- No mechanism to mask credit‑card numbers or social‑security numbers that might appear in query results.
- No real‑time approval step for high‑risk statements such as UPDATE or DELETE on production tables.
- No replayable session that an auditor can examine later.
Those gaps mean the environment cannot produce the evidence SOC 2 auditors require.
How hoop.dev fills the evidence gap
hoop.dev is an identity‑aware, layer‑7 gateway that sits between the AI agent and the PostgreSQL server. By proxying every connection, hoop.dev can:
