Why unrestricted AI agents are a hidden cost
Uncontrolled database access by an AI coding assistant like Claude can quickly become a hidden cost. When teams hand Claude a static service‑account key, the agent can run any query against BigQuery, bypassing human oversight, inflating cloud bills, and exposing sensitive rows. The immediate benefit is speed, but the lack of a central enforcement point means you lose visibility, cannot mask PII, and cannot require approval before costly operations run.
The missing piece in current AI‑driven database workflows
The core problem is that identity and least‑privilege apply only at the token level, while enforcement lives on the target side. A service account may be scoped to a project, but every query still reaches BigQuery unmediated. This leaves three critical gaps:
- Security teams lack a real‑time audit of which user or agent issued each SQL statement.
- BigQuery returns sensitive fields such as SSNs or credit‑card numbers in clear text to the agent.
- High‑cost operations, large scans, export jobs, or schema changes, run without a human checkpoint.
These gaps persist even after you configure OIDC authentication for Claude, because the request still flows straight to the data warehouse.
Introducing a gateway that sits in the data path
hoop.dev provides the missing enforcement layer. It is a Layer 7 gateway that proxies every BigQuery connection made by Claude. The gateway sits between the AI agent and the database, so all traffic must pass through it before reaching the target. Because hoop.dev is the only point where the protocol is inspected, it can apply the following controls:
- Session recording: hoop.dev records each query and its result set, creating a replay log for later review.
- Inline masking: hoop.dev redacts sensitive columns on the fly, ensuring Claude never sees raw PII.
- Just‑in‑time approval: hoop.dev holds queries that match a risk profile for a human reviewer before execution.
- Command blocking: hoop.dev rejects dangerous statements outright based on policy rules.
All of these outcomes exist because hoop.dev sits in the data path. The identity setup that authenticates Claude (OIDC, SAML, or a service‑account token) decides who is making the request, but without hoop.dev the request would reach BigQuery directly and none of the above protections would be possible.
How the architecture works for Claude and BigQuery
First, you deploy the hoop.dev gateway inside the same network segment as the BigQuery endpoint. You can start with Docker Compose for a quick trial or use Kubernetes for a production deployment. The gateway runs an agent that holds the credential needed to talk to BigQuery; Claude never sees this secret.
Second, you register a BigQuery connection in hoop.dev, specifying the project, dataset, and the credential the gateway should use. The registration also includes policy definitions that describe which queries require approval, which columns must be masked, and which users or agents are allowed to run them.
