How to Configure Claude Code Bigquery Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up claude code bigquery approval by keeping the agent in Manual mode. You also link the agent to your warehouse with a read-only database user. Engineering teams often connect AI coding agents to cloud data warehouses to write queries fast. Many developers start by giving the agent their own local cloud role. When those roles have broad write rights, a bad query can break production tables. It can also pull sensitive customer records right into the model context. How claude code bigque

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 claude code bigquery approval by keeping the agent in Manual mode. You also link the agent to your warehouse with a read-only database user. Engineering teams often connect AI coding agents to cloud data warehouses to write queries fast. Many developers start by giving the agent their own local cloud role. When those roles have broad write rights, a bad query can break production tables. It can also pull sensitive customer records right into the model context.

How claude code bigquery approval works in practice

Claude Code reaches external databases in two main ways. First, it runs shell commands through its built-in Bash tool. In Manual mode, the Bash tool asks for your approval before it runs commands. Only a small built-in list of safe read commands can skip this check. When the agent wants to run a cloud query tool, it pauses first. It waits for a human to review and approve the command on screen.

Second, the agent reaches external tools, databases, and APIs through Model Context Protocol servers. You set up an MCP server and give it a database connection string. Vendor docs tell teams to use a read-only database user in that string. That way, the queries the agent runs cannot change or delete your data. You must also check that you trust each MCP server before you use it. Combining Manual mode with a read-only role gives you a basic local check.

What native agent prompts solve and what they leave open

Local approval prompts and read-only cloud roles solve two basic problems. A read-only role stops the agent from dropping tables or changing rows. Manual mode stops the agent from running shell tasks behind your back. These steps decide who can log in and when a tool starts.

Still, this native setup leaves a big operational gap in flight. Once a developer approves a tool call, the cloud role decides everything else. A read-only user can still read every column in an allowed table by default. If that table holds emails, phone numbers, or card numbers, the query pulls them. Data masking is needed to rewrite matched fields in results before they return.

Claude Code Security + Approval Chains & Escalation: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Local prompts also rely on one tired human reading a terminal screen. Developers often click approve fast when they run dozens of prompts in a row. A single local prompt does not give central security teams a clear audit log. Team leads cannot review a query from Slack before it hits a sensitive dataset. Also, the local machine still holds the raw database credentials in its setup files. To stay safe, teams need controls that inspect each statement in flight. They also need a way to mask sensitive fields like national IDs by default.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev sits inline in the protocol beside each supported service as an open-source proxy, a sidecar for your database or API. For every query or command an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human approval.

First, hoop.dev guardrails block banned queries before they run or hold risky ones for review, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

How does Claude Code connect to external databases like BigQuery?

The agent reaches databases through Model Context Protocol servers or its built-in Bash tool. Both paths use the local credentials or connection strings you give them.

Does Manual mode stop an AI agent from reading sensitive columns?

No, Manual mode only asks the user before a command or tool runs. Once approved, the query returns whatever columns the database role allows it to read.

Why do vendor docs suggest a read-only user for database connections?

A read-only user ensures that the queries the agent runs cannot modify data. It protects tables from changes, though it does not redact sensitive text in results.

The query runs. The emails stay hidden.