How to Configure OpenHands Bigquery Prevent Delete
To set up openhands bigquery prevent delete rules, build a custom cloud role. Remove table drop and row delete rights from that role before the agent runs. Engineering teams often give coding agents broad editor roles to move fast. Broad roles let an autonomous agent wipe out production tables with one bad query. How openhands bigquery prevent delete works with cloud roles OpenHands runs tasks by writing code and calling cloud APIs from a sandbox. When it queries BigQuery, it uses a service a
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 openhands bigquery prevent delete rules, build a custom cloud role. Remove table drop and row delete rights from that role before the agent runs. Engineering teams often give coding agents broad editor roles to move fast. Broad roles let an autonomous agent wipe out production tables with one bad query.
How openhands bigquery prevent delete works with cloud roles
OpenHands runs tasks by writing code and calling cloud APIs from a sandbox. When it queries BigQuery, it uses a service account key or workload identity. BigQuery checks the cloud role tied to that identity before running any job.
Standard roles bundle read, write, and delete actions together in one broad package. A standard data editor role lets the agent add rows and drop tables. To stop deletes, you must create a custom role in your cloud console.
You pick the exact actions the agent can run in that custom role. Keep the rights to create jobs, read table data, and add new rows. Leave out the rights that remove tables, drop datasets, or run delete statements.
Next, bind this custom role to the specific dataset rather than the project. Project-level roles grant access across every dataset in that workspace at once. Dataset-level roles keep the agent inside one safe boundary during its work.
Where native cloud permissions fall short in daily work
Custom cloud roles decide who can log in and which API calls pass. They work well when an agent only needs to read tables or append data. Still, BigQuery groups row updates and row deletes under the same general write permission.
Wait until an agent needs to update existing rows as part of a job. If you grant data modification rights for updates, you also allow delete statements. Native cloud roles do not read the SQL text to block specific verbs.
BigQuery IAM + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Static roles also stay active twenty-four hours a day without human review. If a prompt confuses the agent, it can still alter millions of rows. Cloud permissions also cannot mask sensitive fields like emails or phone numbers in results. When the agent runs a select query, the full table returns to the workspace. Masking rules are needed to rewrite card numbers or national IDs in results.
Setting up safe dataset workflows for coding agents
Teams reduce risk by splitting agent workloads across separate staging and production datasets. Give the agent a read-only role on the main production dataset first. Then give it a write role on a scratch dataset for temp tables.
Turn on table history and time travel settings inside your cloud data warehouse. If an agent alters the wrong rows, you can restore the old state. Set billing limits on the agent service account to stop runaway scan costs.
Review your cloud audit logs each week to see what queries the agent ran. Check for failed permission checks, which show when the agent tried blocked actions. Keep service account keys short-lived so old credentials do not linger on laptops.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Can BigQuery IAM block row deletes while allowing row updates?
No, native BigQuery roles bundle SQL update and delete statements into one permission. To separate them, you must inspect the SQL statement before it reaches BigQuery.
How can I recover data if an agent deletes a BigQuery table?
You can use the built-in time travel feature to restore a deleted table. You must run the restore job before your dataset time travel window expires.
Should OpenHands use a personal user account for BigQuery tasks?
No, you should always assign a dedicated service account to the coding agent. Personal accounts carry extra rights and make audit logs much harder to trace.
Related guides
In this post