How to Configure Goose Bigquery Read Only Access

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up goose bigquery read only access by giving a cloud account viewer roles. Then, you pass those login keys to the agent on your machine. Teams often start by sharing personal developer profiles with their local AI tools. This quick habit gives the automated agent far too much power. A broad role lets the tool change tables, drop datasets, or rack up huge bills. How to set up goose bigquery read only access A safe setup starts inside your cloud console. You must create a new service ac

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 goose bigquery read only access by giving a cloud account viewer roles. Then, you pass those login keys to the agent on your machine. Teams often start by sharing personal developer profiles with their local AI tools. This quick habit gives the automated agent far too much power. A broad role lets the tool change tables, drop datasets, or rack up huge bills.

How to set up goose bigquery read only access

A safe setup starts inside your cloud console. You must create a new service account just for the AI agent. Do not reuse an account that runs other apps or data pipelines. Next, you assign two basic roles to this new identity. The agent needs a role to read table data and metadata. It also needs a role to run query jobs in the project.

If you skip the job role, the agent can see tables but cannot query them. If you assign an editor role, the agent can wipe out production rows. You should scope the data viewer role to single datasets when you can. Avoid giving read rights across the entire cloud project. This step keeps sensitive tables out of reach from the very start.

After you set the roles, you link the local agent to the cloud project. You can log in with a local key file or use default cloud credentials. The agent reads these settings when it starts a new work session. It then uses the cloud API to send SQL statements and read the results.

Why native cloud roles are not enough

Cloud roles do a great job of blocking write commands and table drops. When the agent sends an update or delete query, the database rejects it. This native rule protects the integrity of your stored records. Still, cloud roles only check who logs in and which tables they touch. They do not inspect the actual SQL text or the data coming back.

An AI agent with read rights can still pull raw customer records into memory. If a table holds emails, phone numbers, or card numbers, the agent reads them. Those private values then get sent to the external language model provider. Masking tools fix this by rewriting matched fields in results before the agent reads them.

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.

Static service keys on laptops also create a big security risk for teams. Anyone who copies that local file gets the same database rights. Also, an AI tool might write a bad query that scans terabytes of data. Native viewer roles will not stop a messy join from draining your budget. Teams need a way to inspect queries in flight and redact private fields.

Best practices for safe agent queries

Start by putting strict byte limits on the project where the agent runs jobs. This simple cap stops a bad prompt from scanning a massive history table. Next, build clean views that leave out sensitive columns like national IDs. Point the agent to those safe views instead of the raw production tables.

You should also rotate service keys often or switch to short-lived tokens. Check your cloud job history every week to see what SQL the agent writes. Look for failed queries, huge table scans, and odd access patterns. These habits help your team catch bad prompts before they cause real trouble.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Why does my read-only agent fail to run any SQL queries?

Data viewer roles only let the account see tables and read rows. You must also grant a job user role so the account can run queries.

Can a read-only AI agent still leak sensitive customer data?

Yes, a viewer role still reads raw emails, phone numbers, and card numbers. Without field masking, the agent sends those exact values to the model provider.

How do I stop the agent from running huge, costly queries?

Set a maximum bytes billed limit on the cloud project or user account. The database will block any query that tries to scan too much data.

The query runs. The emails stay hidden.