How to Configure Goose Bigquery Prevent Delete
To set up a goose bigquery prevent delete rule, assign a read-only role to your agent. You must remove table drop and row delete rights from the service account. Most engineering teams start by giving the Goose AI agent a standard developer key. That broad role lets the agent run any query on the cloud warehouse. If the agent makes a mistake, it can wipe out production tables in seconds. How a goose bigquery prevent delete setup works Goose is an local AI agent that runs tasks on your machine
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.
To set up a goose bigquery prevent delete rule, assign a read-only role to your agent. You must remove table drop and row delete rights from the service account. Most engineering teams start by giving the Goose AI agent a standard developer key. That broad role lets the agent run any query on the cloud warehouse. If the agent makes a mistake, it can wipe out production tables in seconds.
How a goose bigquery prevent delete setup works
Goose is an local AI agent that runs tasks on your machine. It talks to external tools and databases to read data and write code. When Goose queries BigQuery, it uses local Google Cloud credentials or a service account key. BigQuery checks the cloud identity and access management roles tied to that specific key.
To stop deletions, you must build a custom cloud role with narrow rights. You keep the permissions that let the user run jobs and read table data. You strip out the permissions that drop tables, remove datasets, or mutate table rows. Then you bind this restricted role to the identity that Goose uses.
You can also apply dataset-level controls inside your Google Cloud project. This lets the agent edit scratch tables in a sandbox while keeping production tables safe. BigQuery checks these rules before it runs any query from the agent.
What native roles solve and what they miss
Cloud roles are great for stopping an agent from dropping an entire table. If Goose tries to remove a protected dataset, the cloud API blocks the call. This basic step keeps your most important data assets safe from total loss.
Still, cloud permissions are very coarse when it comes to SQL statements. In many cloud setups, the permission to update data is tied to row deletion. If Goose needs to insert new rows or update status flags, it needs write rights. Those same write rights often allow the agent to run a delete statement.
BigQuery IAM + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Even worse, an update statement without a filter can overwrite every row in a table. Cloud roles only check who logs in and which general API call they make. They do not inspect the actual SQL text that the agent sends in flight. A single bad prompt can still ruin a table if the agent has write roles.
Why local agent keys create extra risk
Giving a local AI agent a static service account key creates another big problem. That key sits on a laptop where any local script or tool can read it. If a developer switches tasks, the agent still holds the exact same database rights. You have no easy way to approve one safe update while blocking a risky delete.
Cloud logs also make it hard to track why an agent ran a specific query. When five engineers share one service account for their agents, all logs look the same. You see the service account name, not the person who prompted the AI tool. Also, native roles do not rewrite sensitive fields like emails or phone numbers. Raw card numbers and national IDs flow straight into the agent context window.
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
Can I let Goose insert rows into BigQuery while blocking deletes?
Native roles group table data changes together in most standard setups. To split inserts from deletes, you must check the SQL command text before it runs.
How does Goose log in to BigQuery on a developer laptop?
Goose usually reads the local cloud SDK login or a saved service account key file. It sends those tokens with every API request to the data warehouse.
How can I protect sensitive fields when Goose queries a table?
Data masking rewrites matched fields like emails, phone numbers, and card numbers in query results. This keeps raw personal data out of the model prompt history.
Related guides
In this post