How to Configure GitHub Copilot Bigquery Prevent Delete

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up github copilot bigquery prevent delete rules by assigning read-only cloud roles. You also require manual approval for agent tool runs in your code editor. Many engineering teams connect coding assistants to cloud data warehouses for fast analysis. Developers often use their own local cloud logins when they test new queries. Those personal logins usually hold broad edit rights across many project tables. If an assistant runs a bad query, it can drop rows right away. How to set up git

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 github copilot bigquery prevent delete rules by assigning read-only cloud roles. You also require manual approval for agent tool runs in your code editor. Many engineering teams connect coding assistants to cloud data warehouses for fast analysis. Developers often use their own local cloud logins when they test new queries. Those personal logins usually hold broad edit rights across many project tables. If an assistant runs a bad query, it can drop rows right away.

How to set up github copilot bigquery prevent delete in your cloud project

GitHub Copilot runs tasks in your editor using local tools and model context servers. When the assistant queries BigQuery, it uses the cloud credentials on that machine. It can also use a service account key you pass to the tool. BigQuery checks those credentials against Google Cloud identity roles before any query runs.

To stop table drops and row deletes, you must change the account role. First, stop using personal developer accounts that have project editor or owner rights. Create a dedicated service account just for your coding assistant and local tools. Assign a read-only viewer role and a job user role to that account. This combination lets the assistant run select queries and read table schemas. At the same time, BigQuery blocks any command that alters or removes data.

You can also scope these roles down to specific datasets or single tables. This stops the assistant from reading sensitive tables it does not need. Inside your code editor, you should also keep manual tool approvals turned on. That way, the developer must review and approve every query before it runs.

What native cloud roles solve and what they leave open

Native cloud roles do a good job of blocking write commands for viewers. If an assistant only needs to read data, a read-only role works well. BigQuery will reject any drop or delete statement from that viewer account.

The problem starts when an assistant needs to write data for its task. For example, a developer might ask the assistant to insert test rows. They might also ask it to build a new staging table in BigQuery. In Google Cloud, data edit permissions are grouped together at the resource level. When you grant permission to insert or update rows, delete rights often follow. A standard data editor role can add rows, update rows, and delete rows.

BigQuery IAM + GitHub Actions Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Cloud roles check who logs in and which dataset they want to touch. They do not inspect the exact SQL text inside an active session. An account with edit rights on a dataset can still run a delete. Even if it avoids deletes, a broad update query can overwrite good records. Read-only roles also do not stop an assistant from pulling sensitive customer columns. Without query inspection, raw emails, phone numbers, and card numbers return in full.

Why local editor approvals are not a complete safety net

Code editors let developers review commands and tool calls before the assistant runs them. This human check catches obvious mistakes when a developer reads the prompt closely. Still, developers get tired when they approve dozens of queries during a long session. A complex SQL script can hide a destructive statement inside a long block. Also, local editor settings live on each developer laptop and can vary across teams. One engineer might turn on auto-approve to move faster during a busy sprint. Relying only on local prompts leaves your cloud data open to human error.

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 sits inline in the protocol beside each supported service as an open-source proxy, a sidecar for your database or API. For every query or command an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human approval.

First, hoop.dev guardrails block banned queries before they run or hold risky ones for review, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Can a BigQuery viewer role delete rows or drop tables?

No, a BigQuery viewer role can only read table data and metadata. Pair it with a job user role so the assistant can run read queries.

Why do assistants still delete data when using developer credentials?

Assistants inherit the local cloud login of the developer running the code editor. If that developer has edit rights in BigQuery, the assistant gets them too.

Can native cloud roles block delete statements while allowing insert statements?

Standard dataset editor roles bundle insert, update, and delete rights together on tables. Blocking only delete statements while keeping inserts active requires checking queries in flight.

The query runs. The emails stay hidden.