How to Configure Devin Bigquery Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up devin bigquery permissions by creating a dedicated cloud service account. Next, you attach data viewer and job user roles to that account. Many engineering teams start by giving the AI agent broad project roles. This approach gets the agent running fast during early testing. Still, broad roles let the agent read every dataset and run expensive queries. A single bad prompt can scan terabytes of data or expose sensitive rows. How native devin bigquery permissions work Google Cloud co

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 devin bigquery permissions by creating a dedicated cloud service account. Next, you attach data viewer and job user roles to that account. Many engineering teams start by giving the AI agent broad project roles. This approach gets the agent running fast during early testing. Still, broad roles let the agent read every dataset and run expensive queries. A single bad prompt can scan terabytes of data or expose sensitive rows.

How native devin bigquery permissions work

Google Cloud controls data access through identity and access management roles. To let Devin query your data warehouse, you need two permission types. First, the agent needs permission to submit and run query jobs. Second, the agent needs permission to read the target tables and views. Teams create a unique service account just for the AI agent. They grant job execution rights at the cloud project level. Then they grant table read rights on specific datasets rather than the project.

Once the roles are ready, the team connects the agent to the cloud. Some teams generate a static JSON key file and upload it to Devin. This method works, but static keys stay valid until someone deletes them. If a key leaks in a build log, anyone can use it. Other teams link the agent work environment through cloud workload identity. Either way, the cloud checks the identity before starting any query job. If the service account holds the right role, the query runs.

What native roles solve and what they miss

Dataset roles do a good job of blocking access to unrelated business tables. You can keep the agent inside a staging dataset and away from billing. You can also use authorized views to share specific columns from a table. Cloud admins can set project byte limits to cap large table scans. These native controls decide which tables the identity can touch at login time.

Still, static cloud roles cannot inspect the actual SQL statements in flight. Once an agent has read rights on a table, it can pull everything. The agent might query customer emails, phone numbers, card numbers, or national IDs. Those raw values then enter the agent workspace and its prompt history. Also, a role that allows data edits lets the agent drop tables. Native roles check who is asking, not what each query will do.

BigQuery IAM + AI Agent Permissions: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Best practices for scoping AI warehouse roles

Always give the AI agent its own identity separate from human engineers. When an agent shares a human account, audit logs mix their actions together. Separate accounts let your security team track every query the agent runs. You should also remove edit and delete rights from the default agent role. Grant read access only to the specific datasets needed for the current task.

When the agent needs production schemas, share views with dummy rows first. Keep raw emails and card numbers out of the test datasets. If a task requires real data, require a human to review the query. Set tight daily query cost limits on the agent service account. Finally, rotate any stored keys often and revoke access when the task ends.

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

Should Devin use a personal user account for BigQuery?

No, you should never share a human login with an AI agent. Create a dedicated service account so audit logs show only agent actions. This also lets you revoke agent access without locking out an engineer.

How do we stop Devin from running high cost queries?

Grant read roles on small test datasets instead of full production tables. You can also set maximum bytes billed limits inside the cloud project settings. This stops runaway full table scans before they finish and drive up costs.

Can BigQuery roles hide emails or card numbers from the agent?

Standard dataset roles grant access to the whole table or block it completely. To limit column access natively, you must build separate views or policy tags. Otherwise, any allowed query will return raw emails and card numbers in results.

The query runs. The emails stay hidden.