When a contractor leaves a project, their CI job continues to run Claude‑driven code generation against a production Postgres cluster. The job still holds a static credential that was baked into the pipeline, and every new query it issues can read or modify live data without any human review. The result is a silent data‑exfiltration risk that goes unnoticed until a downstream service fails.
Why production access matters for AI coding agents
Claude, the large‑language model offered by Anthropic, can write and refactor SQL on the fly. When developers embed Claude in CI pipelines, the model becomes an automated actor that talks directly to the database. In a production environment that means any generated statement could affect billing, compliance, or customer privacy. Traditional access controls, static passwords or long‑lived service accounts, do not provide the granularity needed to limit Claude to read‑only or to require a human sign‑off before a destructive command runs.
The missing enforcement gap
Identity providers such as Okta or Azure AD can authenticate the CI job, and role‑based policies can restrict which databases the job may reach. Those policies stop the job from connecting to the wrong host, but they do not inspect the actual SQL payload. Without a gate that sits on the data path, there is no place to:
- Mask sensitive columns returned by SELECT statements.
- Block DROP, ALTER, or DELETE commands before they hit Postgres.
- Require a real‑time approval workflow for any statement that writes data.
- Record the full session for later replay and audit.
All of those controls are necessary to achieve true production access governance for an AI coding agent.
How hoop.dev secures Claude’s access to Postgres
hoop.dev is a Layer 7 gateway that sits between Claude’s client library and the Postgres endpoint. The architecture follows three distinct responsibilities:
- Setup: Identity is handled by OIDC or SAML. The CI job obtains a short‑lived token from the organization’s identity provider. The token proves who the request is and whether it may start, but it does not enforce any data‑level policy.
- The data path: The token is presented to hoop.dev, which proxies the TCP stream to Postgres. Because the gateway sits on the protocol level, it is the only place the system can inspect, modify, or block the SQL payload.
- Enforcement outcomes: While the request flows through hoop.dev, the gateway can mask columns that contain personal data, reject any command that matches a “dangerous” pattern, and trigger an approval workflow for write operations. Every interaction is recorded, enabling replay for forensic analysis.
In practice, a developer configures a Postgres connection inside hoop.dev, supplies the database credential to the gateway (the credential never leaves the agent’s network), and then points Claude’s client to the hoop.dev endpoint. When Claude generates a query, the gateway evaluates the statement against the configured policies. If the statement is a simple SELECT, the response may have sensitive fields masked before it reaches the CI job. If the statement attempts to modify data, the gateway either blocks it outright or forwards it to an approval queue where a security engineer can approve or reject the operation in real time.
