How to Configure OpenHands Bigquery Credentials
You set up openhands bigquery credentials by giving the agent a dedicated cloud identity. You then bind that identity to a specific project role with clear read limits. Many teams start by handing the agent a broad project key to move fast. Broad keys let an automated agent drop tables or scan millions of private rows. How to set up openhands bigquery credentials OpenHands runs tasks inside a workspace that acts like a human developer. When the agent needs data, it uses standard cloud librari
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 openhands bigquery credentials by giving the agent a dedicated cloud identity. You then bind that identity to a specific project role with clear read limits. Many teams start by handing the agent a broad project key to move fast. Broad keys let an automated agent drop tables or scan millions of private rows.
How to set up openhands bigquery credentials
OpenHands runs tasks inside a workspace that acts like a human developer. When the agent needs data, it uses standard cloud libraries to run queries. You first create a dedicated service identity inside your cloud account for the agent. Next, you grant that identity a role that allows running jobs and reading tables.
Teams should scope this role to a single dataset instead of the whole project. You then place the identity file or token into the agent workspace. The agent reads this file from a standard file path when it starts a task. If the workspace runs in the cloud, it can use attached identity metadata instead. Static key files carry higher risk because anyone who copies the file gets full access. Short-lived tokens work better because they expire after the agent finishes its current job.
What native roles solve and where they fall short
Native cloud roles decide which datasets and tables the agent can reach at login. They do a great job of blocking access to unrelated projects in your account. You can also set project quotas to limit how many bytes a user scans. This stops a bad loop from running up a massive cloud bill over the weekend.
Still, a cloud role only checks permissions before the query starts to run. Once a role grants table read rights, the agent can read every column inside by default. The native role cannot rewrite emails, phone numbers, or card numbers in the output. If a table holds sensitive customer rows, those values flow straight into the agent prompt. Also, grant roles cannot pause a single risky statement for a human to review first. You must choose between giving full dataset access or giving no access at all.
Ephemeral Credentials + BigQuery IAM: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Managing sensitive data and active query sessions
Autonomous agents write and run their own SQL statements based on user prompts. A prompt mistake can cause the agent to request raw national IDs or phone numbers. Cloud logs will show that the service role ran a query at a certain time. Those logs do not link the query back to the user who prompted the agent.
Data teams need a way to inspect every query while it is in flight. When you control the session at runtime, you can block destructive commands before they hit data. You can also apply rules that rewrite emails and card numbers in query results. This keeps sensitive customer fields out of external model logs and local agent files. Teams get fast data analysis without handing raw database keys to the agent workspace.
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 I use a static key file for an OpenHands agent?
No, static key files stay valid until a team member deletes them by hand. If the agent workspace leaks a file, an attacker can read your cloud tables. Use short-lived tokens or attached workload identities whenever your setup allows it.
Can BigQuery roles hide specific sensitive columns from the agent?
Yes, you can set up column policy tags on specific fields inside your tables. Still, maintaining tags across hundreds of changing tables takes a lot of manual work. Many teams prefer runtime masking that rewrites emails and card numbers in results on the fly.
How do I stop an agent from running expensive full table scans?
You can set a maximum bytes billed limit on the cloud project or user. If the agent writes a query that exceeds that size, the database cancels the job. You should also restrict the agent role to smaller views instead of raw event tables.
Related guides
In this post