Imagine a contractor who left the company last week but still has a copy of the shared PostgreSQL password used by an internal ChatGPT‑powered code assistant. The assistant runs nightly jobs that generate SQL statements, writes data, and occasionally pulls back customer records for analysis. Without session recording there is no reliable way to prove what the AI did during those runs. Because the password lives in a plain‑text configuration file, the AI can continue to issue queries long after the contractor’s access should have been revoked. No one can tell which statements were generated by the assistant, which were issued by a human, or whether any sensitive rows were inadvertently exposed.
In many teams, the shortcut is to grant the AI service a static credential and let it connect directly to the database. The connection bypasses any audit layer, and the database logs only show the service account name, not the intent behind each statement. When a breach is discovered, investigators are left piecing together raw logs that lack context, timestamps, or any indication of who authorized the operation. The lack of visibility makes compliance audits painful and erodes confidence in AI‑driven automation.
Why session recording matters for AI coding agents
Session recording captures every request and response that travels between a client and PostgreSQL. For an AI coding agent, this means a complete, replayable transcript of every generated query, the exact parameters used, and the resulting rows. The transcript becomes forensic evidence, a debugging aid, and a compliance artifact. It also enables downstream tools to mask or redact sensitive columns before they ever reach a downstream system.
The missing piece in a token‑based setup
Most organizations already use OIDC or SAML to issue short‑lived tokens for service accounts. Those tokens answer the question, “Who is calling?” but they do not answer, “What is being called?” When an AI agent presents a valid token, the request still travels straight to PostgreSQL. The database sees a well‑authenticated client, yet there is no place in the data path where policies such as session recording, inline masking, or command‑level approvals can be enforced. The authentication layer alone is necessary but insufficient for a secure AI‑driven workflow.
hoop.dev as the enforceable data path
hoop.dev solves the gap by inserting a Layer 7 gateway between the AI agent and PostgreSQL. The gateway validates the OIDC token, extracts group membership, and then proxies the protocol‑level traffic to the database. Because the proxy sits in the data path, hoop.dev can record each client command, apply real‑time masking rules, and store a replayable audit trail. The AI agent never sees the database credentials; hoop.dev holds them securely and presents a temporary session token to PostgreSQL on behalf of the client.
