How to Configure Claude Code Snowflake Read Only Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up claude code snowflake read only permissions by creating a restricted database role. Then you pass that user string to a Model Context Protocol server. Teams often start by handing an agent their own developer login. If that role has write grants, a bad prompt can alter or drop tables. How claude code snowflake read only permissions work in practice Claude Code reaches external databases and tools through Model Context Protocol servers. It can also run local shell scripts through it

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 snowflake read only permissions by creating a restricted database role. Then you pass that user string to a Model Context Protocol server. Teams often start by handing an agent their own developer login. If that role has write grants, a bad prompt can alter or drop tables.

How claude code snowflake read only permissions work in practice

Claude Code reaches external databases and tools through Model Context Protocol servers. It can also run local shell scripts through its built-in Bash tool. In manual mode, the Bash tool asks for human approval before running most commands. It only skips approval for a small list of safe local read commands. When you link a database server, the agent sends queries through that server process.

Vendor docs for database servers advise using a read-only database user in your string. That way, the queries the agent runs cannot modify any stored data. In your cloud data warehouse, permissions flow through role hierarchies. An admin creates a custom role and grants usage on a warehouse and database. Next, the admin grants select rights on chosen schemas, tables, or views.

You then assign this restricted role as the default for a dedicated service user. When the Model Context Protocol server logs in, the warehouse checks that role. If the agent tries to run an insert or delete statement, the database blocks it. The agent can still inspect table schemas and run select queries to help you code.

How to scope schemas and warehouse usage for AI agents

A read-only role stops writes, but you still need to scope what it reads. Start by separating production customer tables from analytics or test schemas. Create a dedicated role for your coding agent and grant usage on one small warehouse. This keeps heavy agent queries from eating up compute credits on primary workloads.

Only grant select permissions on the specific schemas the agent needs for its task. Avoid granting select across an entire database when a few views will do. Also check that the user has no secondary roles that hold higher privileges. Before you use any Model Context Protocol server, verify that you trust its code. The server process holds your database credentials on the local machine.

Claude Code Security + Read-Only Root Filesystem: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native roles solve and the gap they leave open

Native warehouse roles do a great job of blocking write commands at the database level. They decide who can log in and which objects that user can read. Once a session starts, Still, a read-only grant allows any select query on permitted tables.

Database roles do not inspect individual queries in flight to block huge table scans. A single select statement can pull thousands of rows into the model prompt window. Those rows often contain sensitive fields like emails, phone numbers, card numbers, or national IDs. Unless you set up column policies on every table, raw values flow back to the agent. Masking at the query layer rewrites matched fields in results before they reach the tool. Also, static credentials stored in local config files remain hard to rotate and audit.

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 sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses 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

How does Claude Code query a database?

It uses Model Context Protocol servers or runs CLI tools through its Bash tool. Both paths use the database login details stored on the developer machine.

Can a read-only database user still expose sensitive data to an AI agent?

Yes, a read-only role can still select every row and column in allowed tables by default. Without field masking, queries return raw emails, phone numbers, and card numbers to the agent.

Does Manual mode stop an AI agent from running bad SQL queries?

Manual mode asks for approval on Bash commands, which helps catch risky shell calls. Yet once you approve a query or tool call, the database runs the full statement.

The query runs. The emails stay hidden.