How to Configure Aider Bigquery Read Only Access

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up aider bigquery read only access by pairing a viewer role with local keys. The coding agent then runs terminal commands to read tables without changing data. Many teams start by giving their local cloud profile broad admin rights. That quick shortcut lets a coding agent drop tables or change schemas by mistake. Scoping the cloud role down to read actions stops those bad writes right away. How to set up aider bigquery read only access Aider works in your terminal and runs shell comma

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You set up aider bigquery read only access by pairing a viewer role with local keys. The coding agent then runs terminal commands to read tables without changing data. Many teams start by giving their local cloud profile broad admin rights. That quick shortcut lets a coding agent drop tables or change schemas by mistake. Scoping the cloud role down to read actions stops those bad writes right away.

How to set up aider bigquery read only access

Aider works in your terminal and runs shell commands or scripts when you approve them. Those local commands use whatever cloud credentials live in your shell session. To limit what the agent can do, you create a dedicated cloud service account. You assign that account a role that only allows running jobs and reading table data. You do not attach roles that can edit tables, delete datasets, or manage permissions.

Next, you place the scoped account key in the shell session where the agent runs. When you ask the agent to inspect a dataset, it calls the cloud command tool. It can also run a small script using the standard cloud client library. BigQuery checks the cloud role before running the query job. If the agent tries to run a write command, the cloud engine blocks it.

Teams also limit which datasets the viewer role can reach inside the cloud project. Instead of granting read rights across the whole project, you grant rights per dataset. You pick the specific analytics or staging datasets that the agent needs for coding tasks. This step keeps the agent out of billing tables and raw customer data stores. You get a clean boundary around the tables that the agent can inspect.

What native cloud roles solve and what they miss

Native cloud roles do a great job of blocking destructive commands at the project level. The agent cannot drop a production table, alter a view, or delete a dataset. You also get basic cloud logs showing which service account ran a query job. For safe schema checks and basic query testing, a read role is a required base.

Still, a cloud role only checks who logs in and which datasets they can touch. It does not check what individual queries do in flight or what rows come back. A read query can still pull millions of rows and drive up cloud compute costs. Worse, a read role allows the agent to read sensitive columns inside an approved table. If a table holds emails, phone numbers, card numbers, or national IDs, the query returns them. The agent then reads those raw values and sends them out to the model provider.

Auditor Read-Only Access + Customer Support Access to Production: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Local credential files also create a key management task for your engineering team. Every developer who uses the coding agent needs a scoped key on their laptop. Those static keys sit on disk until someone remembers to rotate or revoke them. If a script logs the local shell variables, that key can leak into text files. Static cloud roles cannot rewrite sensitive fields in results or remove keys from laptops.

How to reduce risk during local agent sessions

You can lower the risk of big queries by setting byte limits on the account. Cloud settings let you cap how much data a single query job can scan. When the coding agent writes a bad join without a filter, the query fails fast. This simple cap protects your cloud budget while the agent tests new SQL code.

You should also keep production customer tables out of the datasets that the agent reads. Create smaller views or sample tables that leave out columns with emails and card numbers. Point the agent to those clean datasets when it needs to check data shapes. This keeps sensitive records out of your local terminal and out of model prompts.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

How does Aider run queries against BigQuery?

Aider runs terminal commands and helper scripts on your machine when you give permission. Those commands use the active cloud credentials in your shell to query BigQuery.

Which cloud roles are needed for read only queries?

The account needs a role to read table data and a role to run jobs. Without job permissions, the account can view schemas but cannot run a select query.

Does a read only role stop sensitive data from reaching the model?

No, a read only role returns every column in the permitted table by default. If that table holds emails or card numbers, the agent reads them and sends them upstream.

The query runs. The emails stay hidden.