All posts

Configuring autonomous agents access to BigQuery with just-in-time access

A system where autonomous agents receive just-in-time access to BigQuery, with approvals logged, sensitive results masked, and every query replayable, eliminates the blind spots of static keys. When an AI‑driven data pipeline or a scheduled analytics job needs to run a query, the ideal flow is a request that is evaluated at the moment of execution, granted for the minimum time required, and then revoked automatically. The request is tied to the identity that triggered it, and the outcome is rec

Free White Paper

Just-in-Time Access + Mean Time to Detect (MTTD): The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

A system where autonomous agents receive just-in-time access to BigQuery, with approvals logged, sensitive results masked, and every query replayable, eliminates the blind spots of static keys.

When an AI‑driven data pipeline or a scheduled analytics job needs to run a query, the ideal flow is a request that is evaluated at the moment of execution, granted for the minimum time required, and then revoked automatically. The request is tied to the identity that triggered it, and the outcome is recorded in a secure audit log. If the request tries to read a column that contains personally identifiable information, the response is redacted before it reaches the agent.

Why just-in-time access matters for BigQuery

BigQuery stores massive data sets that often include regulated or confidential fields. Granting a service account perpetual read rights means any compromised credential can sweep the entire warehouse. Just-in-time access limits exposure by issuing a short‑lived permission only when a specific query is approved. This reduces the attack surface, satisfies audit requirements, and aligns with the principle of least privilege.

The missing control in current agent setups

Most teams today provision autonomous agents with a shared Google service‑account key. The key is baked into CI pipelines, stored in secret managers, and copied across environments. The agents connect directly to BigQuery using that credential. The drawbacks are clear:

  • There is no per‑query approval workflow; any code path can issue a query at any time.
  • All query results flow back unfiltered, exposing sensitive columns to downstream services that may not need them.
  • Session data is not captured centrally, making forensic analysis difficult after a breach.

Even if an organization adopts per‑user OAuth tokens through GCP IAM federation, the request still travels straight to BigQuery. The gateway that could enforce masking, logging, or approval never sees the traffic, so the organization cannot guarantee that every access event complies with policy.

How hoop.dev enforces just-in-time access

hoop.dev sits on the Layer 7 path between the autonomous agent and BigQuery. When an agent initiates a connection, hoop.dev validates the OIDC token, extracts the user or service identity, and checks the request against a policy that requires just-in-time approval. If the policy matches, hoop.dev issues a short‑lived credential to the BigQuery backend on behalf of the request, then forwards the query.

Continue reading? Get the full guide.

Just-in-Time Access + Mean Time to Detect (MTTD): Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

During the session, hoop.dev records every request and response, applies inline masking to any field flagged as sensitive, and stores the audit trail for replay. If a query attempts an operation that is not permitted, such as exporting data to external storage, hoop.dev blocks the command before it reaches BigQuery and can route the request to a human approver for review.

Because the enforcement point is the gateway, the autonomous agent never sees the underlying credential. The agent only talks to hoop.dev, which abstracts the secret management and ensures that the least‑privilege token exists only for the duration of the approved query.

Benefits of the gateway approach

  • Dynamic least‑privilege: Permissions are granted per request, not per service account.
  • Real‑time data protection: Sensitive columns are masked before they leave BigQuery.
  • Comprehensive audit: Every query, approval decision, and masking action is logged and replayable.
  • Reduced blast radius: Compromise of an agent’s runtime does not expose long‑lived credentials.

Getting started with hoop.dev and BigQuery

To adopt this model, deploy the hoop.dev gateway in the same network segment as your BigQuery resources. Register the BigQuery connection in the gateway, configure the agent to use the standard BigQuery client libraries, and point it at the hoop.dev endpoint instead of the Google endpoint. The gateway will handle credential rotation, policy evaluation, and session recording automatically.

Detailed deployment steps, policy authoring guidance, and best‑practice recommendations are covered in the getting‑started guide and the broader learning portal. The full source code and example configurations are available in the GitHub repository.

FAQ

Does this approach require changes to existing BigQuery queries?

No. Agents continue to use the same client libraries and query syntax. The only change is the endpoint address, which points to hoop.dev instead of the native Google endpoint.

Can I still use service‑account keys for non‑interactive jobs?

Yes, but those jobs should also route through hoop.dev to gain the same audit and masking guarantees. The gateway can issue short‑lived credentials on behalf of the job, eliminating the need to store long‑lived keys.

What happens if an approval is denied?

hoop.dev blocks the request before it reaches BigQuery and returns a clear denial response to the agent. The denial event is logged alongside the policy that triggered it.

Open source

Save the open-source gateway for agent data access

Hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.

Star and save the repo →More posts