How to Configure Goose Bigquery Audit Log

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a goose bigquery audit log by turning on cloud data logs. Then you map the AI agent identity to a dedicated service account. Engineering teams often give AI agents broad project roles to move fast. Broad roles let the agent read sensitive tables or drop production data. How a goose bigquery audit log works in practice Goose runs on a local machine or a build server as an agent. It uses cloud credentials to send SQL queries to your data warehouse. Your cloud provider records these e

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 a goose bigquery audit log by turning on cloud data logs. Then you map the AI agent identity to a dedicated service account. Engineering teams often give AI agents broad project roles to move fast. Broad roles let the agent read sensitive tables or drop production data.

How a goose bigquery audit log works in practice

Goose runs on a local machine or a build server as an agent. It uses cloud credentials to send SQL queries to your data warehouse. Your cloud provider records these events in the platform log router. Admin activity logs turn on by default in the cloud console. Data read and write logs stay off until you turn them on. You must turn on data logs to see what Goose reads. Each log entry captures the service account email and the SQL text. It also records the target table and the number of billed bytes.

Teams usually create one service account for the Goose agent to use. If ten engineers share that key, every query looks the same. You lose track of which person asked the agent to run a query. Good setups link each user to a unique identity before running queries. You can also route these log entries to a central log table. Security teams query that table to spot odd patterns or huge scans.

What native logging solves and where gaps remain

Native cloud logs give you a solid record after a query finishes. You can check who logged in and which tables the agent touched. This record helps during a security review or a billing check. You can see if a bad prompt caused a full table scan. You can also see when an agent creates or deletes a table.

Still, native logs only tell you what happened in the past. They do not stop a bad query while it is in flight. Cloud roles decide who logs in, not what a single query does. If Goose has read rights on a table, it reads all columns. It pulls emails, phone numbers, card numbers, and national IDs into memory. The agent then sends those raw rows to the language model provider. A log entry shows the read event, but the data already left. Also, static service account keys sit on laptops where scripts can steal them. Teams need controls that check every statement and rewrite sensitive fields in results.

Audit Log Integrity + BigQuery IAM: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Steps to tighten agent permissions before logging

Start by removing project wide roles from the agent service account. Grant read rights only on the specific datasets the agent needs. Set a maximum bytes billed limit on the cloud project or user. This cap stops a confused agent from running up a huge bill. Avoid saving long lived JSON keys on developer laptops when you can. Use short lived credentials tied to a single human user login instead. Review your data access log settings each month to catch new datasets. Make sure your log sink keeps records long enough for audits.

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 runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values 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

Does BigQuery log every query from Goose by default?

No, the cloud platform only logs admin changes and metadata by default. You must turn on data access logs to capture read and query events.

How can I tell which engineer triggered a Goose query?

Give each engineer a unique identity instead of one shared service key. You can also add user labels or job tags to each query.

Can audit logs stop Goose from reading sensitive columns?

No, audit logs only record events after the database runs the query. To protect emails or card numbers, you need a tool that masks results.

The query runs. The emails stay hidden.