How to Configure Amazon Q Snowflake Read Only Permissions
You set up amazon q snowflake read only permissions by creating a restricted database role. You then bind that role to the credentials your AI assistant uses during queries. Many teams start by giving the assistant their own admin role for fast testing. That shortcut lets an automated prompt alter tables, drop schemas, or read sensitive rows. A dedicated read role stops write queries at the database engine level. How amazon q snowflake read only permissions work in practice Amazon Q runs quer
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 amazon q snowflake read only permissions by creating a restricted database role. You then bind that role to the credentials your AI assistant uses during queries. Many teams start by giving the assistant their own admin role for fast testing. That shortcut lets an automated prompt alter tables, drop schemas, or read sensitive rows. A dedicated read role stops write queries at the database engine level.
How amazon q snowflake read only permissions work in practice
Amazon Q runs queries through local developer tools or configured data connectors. It uses the credentials stored in the local profile or service role. When the agent sends a query, the warehouse checks the assigned role permissions. To keep the data safe, admins build a custom role just for reading. This role gets usage rights on the warehouse, database, and specific schemas. It also gets select rights on the permissions tables and views.
You should never grant modify, delete, or drop privileges to this role. The database engine will block any write command the AI tries to run. Next, you create a dedicated service user for the AI tool to log in. You assign the read-only role as the default role for that user. Finally, you put those user credentials into the local agent settings. Now every query from the assistant runs inside that strict read-only boundary.
Why role permissions alone leave a security gap
A read-only role stops the AI from deleting or changing your data. Still, role permissions only check who logs in and which tables they read. They do not inspect what individual statements or requests do in flight. If a table holds customer data, a select permission returns every column by default. The AI assistant pulls raw emails, phone numbers, and card numbers into its context. From there, sensitive values can end up in external model logs.
Static credentials on developer laptops also create a big risk for teams. Engineers must store keys or tokens in plain text files for the agent. If a laptop gets compromised, attackers can use those keys to dump tables. Also, a shared service user hides which person actually ran a specific query. Audit logs only show the shared bot account instead of the real engineer. Teams also struggle to block bad queries that scan huge tables and waste money.
Read-Only Root Filesystem + Snowflake Access Control: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
How to protect data and audit AI queries
To fix this, teams need controls that work on every single query. First, tie every AI session to a real person through your identity provider. This removes static keys from laptops and shows who ran each query. Second, inspect query results in flight before they reach the AI agent. Dynamic data masking rewrites matched fields like emails, phone numbers, and national IDs. The assistant still gets the schema structure it needs to write good code.
You should also set row limits on queries to stop full table dumps. This keeps a bad prompt from pulling millions of rows at once. Good logging records the exact SQL statement along with the user identity. Security teams can review these logs to see how agents use warehouse data. Combining strict database roles with statement-level checks keeps your warehouse safe and fast.
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
Can a read-only role stop Amazon Q from reading sensitive columns?
Standard table select rights allow the role to read every column in that table by default. To hide sensitive fields like card numbers, you must use column-level security or masking.
Should developers share one database user for their AI coding tools?
Sharing one user account makes it impossible to see who ran a query. Give each developer their own identity so audit logs track every single action.
What happens when the AI tries to run a write command?
The warehouse checks the role privileges before it runs the SQL statement. Since the role lacks write rights, the engine blocks the command and returns an error.
Related guides
In this post