How to Configure n8n Bigquery Sandbox

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up an n8n bigquery sandbox workflow, link your cloud account to an n8n node. Then attach that workflow as a tool for your AI agent to run queries. Teams often start by giving the workflow broad project roles to make testing fast. Broad roles let automated steps read or change every table in the project. If a prompt goes wrong, the workflow can expose sensitive rows or delete test data. How an n8n bigquery sandbox architecture works In n8n, the AI Agent node pairs a chat model with one

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 an n8n bigquery sandbox workflow, link your cloud account to an n8n node. Then attach that workflow as a tool for your AI agent to run queries. Teams often start by giving the workflow broad project roles to make testing fast. Broad roles let automated steps read or change every table in the project. If a prompt goes wrong, the workflow can expose sensitive rows or delete test data.

How an n8n bigquery sandbox architecture works

In n8n, the AI Agent node pairs a chat model with one or more tools. The agent decides which tools to call to finish a task. You must attach at least one tool sub-node to an AI Agent node. From n8n 1.82.0 on, all AI Agent nodes run as a Tools Agent. Node version 1 and the old agent type setting are removed in n8n 3.0.

The deprecated SQL Agent only supported MySQL, SQLite, and Postgres data sources. To reach a cloud data warehouse today, teams use other built-in agent tools. N8n offers a Call n8n Workflow Tool, a Custom Code Tool, and an HTTP Request Tool. Teams also use a registry of MCP servers to link external data systems. In a typical setup, the agent calls a sub-workflow or HTTP tool that sends queries. That tool holds the cloud credential and runs the SQL against the sandbox dataset.

What native cloud roles solve and what they miss

Cloud identity roles control which user or service account can log into the data project. You can scope a role to one dataset so the tool cannot touch other tables. This setup stops outside users from reaching your test tables without a valid key. It also lets cloud admins turn off a key when a test project ends.

Still, static cloud roles only check who logs in at the start of a request. They do not inspect what individual SQL statements do while a workflow runs. Once the n8n tool authenticates, every query from the AI agent runs with full role rights. If a table holds test emails or phone numbers, the query returns those fields in plain text. Data masking is needed to rewrite matched fields like card numbers or national IDs in results. Native cloud roles also cannot pause a bad drop or delete statement for human review.

BigQuery IAM + AI Sandbox Environments: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Why shared workflow credentials create audit gaps

Most teams store one shared account key inside the n8n credential store. Every person and every AI agent trigger in that workspace uses the same identity. When you check the cloud query log, every statement comes from that single service account. You cannot tell which user prompt or workflow run triggered a specific table scan.

Sharing keys across builders also makes rotation hard. If one builder leaves the team, you must replace the key in every linked workflow. Keeping static keys inside workflow settings increases the risk of accidental leaks during exports. Teams need a way to verify each query in flight and tie actions to real users.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Can I use the built-in n8n SQL Agent with a BigQuery sandbox?

No, the old SQL Agent is deprecated and only supports MySQL, SQLite, and Postgres. From n8n 1.82.0 on, all AI Agent nodes work as a Tools Agent instead. You can link a Call n8n Workflow Tool or HTTP Request Tool to run your queries.

How do I limit what tables an n8n agent can read in the sandbox?

Assign permissions at the dataset or table level instead of the whole cloud project. Create a dedicated service account that only has read rights on your specific sandbox dataset. Still, remember that dataset roles will return all columns, including any sensitive test fields by default.

What happens if an AI agent writes a bad query in an n8n workflow?

The database will execute any query that the attached cloud role allows. If the role permits table edits, a bad prompt can alter or drop sandbox tables. Put strict read-only permissions on the role or add query checks before statements run.

The query runs. The emails stay hidden.