Why session recording matters for Cursor
Allowing an AI coding assistant to run queries against Snowflake without a recorded trail creates an invisible attack surface. In many organizations the Cursor agent is given a long‑lived service account, the credentials are baked into CI pipelines, and the agent talks directly to Snowflake. No one sees which statements the model generated, which rows were returned, or whether a query inadvertently leaked sensitive data. If a breach occurs, the forensic path is missing, compliance audits cannot be satisfied, and the organization cannot prove that AI‑generated code behaved as intended.
Security teams therefore start by moving the identity of the AI workload into an OIDC‑based service principal. The principal is granted the minimum set of Snowflake roles needed for the workload, and token‑based authentication replaces static passwords. This step limits the blast radius of a compromised secret, but it does not close the audit gap. The request still flows straight to Snowflake, the gateway is the Snowflake server itself, and no component on the path records the interaction.
Implementing session recording with hoop.dev
hoop.dev provides the missing data‑path enforcement point. It is a Layer 7 gateway that sits between the Cursor client and the Snowflake endpoint. The gateway authenticates the OIDC token, validates the group membership, and then proxies the wire‑protocol traffic. While proxying, hoop.dev records every request and response, timestamps each packet, and stores a replay‑able session log. Because the gateway is the only place where traffic is inspected, the session recording capability exists solely because hoop.dev occupies the data path.
Key architectural steps are:
- Deploy the hoop.dev gateway in the same network segment as the Snowflake instance. The quick‑start guide shows how to launch it with Docker Compose.
- Register Snowflake as a connection inside hoop.dev, supplying the host, port, and the service account that the gateway will use. The gateway holds the credential; the Cursor process never sees it.
- Configure Cursor to point at the gateway’s address instead of the raw Snowflake endpoint. From the agent’s perspective nothing changes – it still uses its standard Snowflake client library.
- When a query is issued, hoop.dev forwards the wire‑protocol packets to Snowflake, captures the full round‑trip, and writes a session record to its persistent store.
Because hoop.dev is the sole enforcement point, the recorded session can be replayed in a sandbox, searched for specific statements, or exported for audit purposes. The recorded data includes the exact SQL generated by the AI model, the parameters used, and the result set size, giving teams full visibility into what the AI did.
