How to Configure Devin Bigquery Sandbox
You set up a devin bigquery sandbox by linking a scoped cloud role to the agent workspace. You then limit that role to specific datasets and set a strict query budget. Many teams start by giving the agent a broad project role to test fast. That wide role lets an agent read private tables or run huge queries by mistake. How the native devin bigquery sandbox setup works BigQuery Sandbox gives teams a free workspace with storage limits and table expiration dates. It lets you test schemas and run
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 devin bigquery sandbox by linking a scoped cloud role to the agent workspace. You then limit that role to specific datasets and set a strict query budget. Many teams start by giving the agent a broad project role to test fast. That wide role lets an agent read private tables or run huge queries by mistake.
How the native devin bigquery sandbox setup works
BigQuery Sandbox gives teams a free workspace with storage limits and table expiration dates. It lets you test schemas and run queries without adding a billing card first. When you pair this workspace with an AI coding agent, you need a cloud identity. You create a service account in your cloud console for the agent to use.
Next, you grant that service account a role that can run jobs and read datasets. You place the account key or token into the agent workspace settings. The agent uses those credentials to run SQL statements and inspect table schemas. It reads the query output and uses the results to write or fix app code.
To keep the workspace tidy, you apply dataset roles instead of whole project roles. You pick one test dataset and grant read rights to that single location. You can also give write rights to a scratch dataset for temporary test tables. The cloud platform checks these roles every time the agent starts a new query job.
What native roles solve and what they miss
Cloud IAM roles do a good job of deciding who can log in. They block the agent from touching datasets outside its assigned test project. Native quota controls also cap how many bytes a project can scan each day. These boundaries stop a test agent from deleting production datasets in another project.
Still, static cloud roles cannot inspect what an individual SQL statement does in flight. Once the agent has read rights on a dataset, it can read every column there. If a test table holds real emails or phone numbers, the agent pulls them into context. A broad role also allows destructive table drops inside the scratch dataset without human review.
BigQuery IAM + AI Sandbox Environments: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Storing a static service account key inside an agent workspace creates another risk. Anyone who opens the workspace settings can copy that key and use it elsewhere. Teams also lack a single audit log that links agent prompts to specific database queries. Cloud logs show the service account ran a query, but not which task triggered it.
Scoping test data and query rules for agents
Safe agent testing starts with clean data inside your sandbox tables. Teams often copy production rows into test datasets to debug real code issues. When you do this, sensitive fields like card numbers or national IDs move into the sandbox. Data masking solves this by rewriting matched fields in query results before the agent reads them.
You should also separate schema inspection from data changes during agent runs. An agent usually needs to read table structures and sample a few rows of data. It rarely needs to drop tables or alter schemas without a human checking first. Putting an approval step on destructive statements keeps your test workspace stable for the whole team.
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 an AI agent use BigQuery Sandbox without a billing account?
Yes, the native sandbox mode runs under free tier limits without a billing card. Your agent can create tables and run queries until it hits the daily scan cap.
How do I stop the agent from scanning huge tables?
Set a maximum bytes billed limit on the query job or project quota. Queries that exceed this byte limit will fail before they run and use up your quota.
What happens if test datasets contain real customer data?
Standard cloud roles return all columns in a permitted table to the agent workspace by default. You need field masking in the query path to rewrite emails or phone numbers in results.
Related guides
In this post