How to Configure Haystack Snowflake Read Only Permissions
You set up haystack snowflake read only permissions by creating a restricted database role. You then link that role to the service user in your pipeline. Engineering teams often use admin roles when they first test a new AI app. That shortcut lets an automated pipeline change or delete tables by mistake. A strict read role stops the app from writing data during a query run. How haystack snowflake read only permissions work in practice Snowflake manages data rules through a system based on rol
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 haystack snowflake read only permissions by creating a restricted database role. You then link that role to the service user in your pipeline. Engineering teams often use admin roles when they first test a new AI app. That shortcut lets an automated pipeline change or delete tables by mistake. A strict read role stops the app from writing data during a query run.
How haystack snowflake read only permissions work in practice
Snowflake manages data rules through a system based on roles. An admin creates a custom role made just for the Haystack app. This role needs usage rights on the compute warehouse, database, and schema. Next, the admin grants select rights on the specific tables or views. You should also add future grants so new tables get the same rules.
After you set up the role, you assign it to a service user. Your Haystack pipeline then logs in as this dedicated user. You should use key pair login instead of a basic password for this user. The pipeline passes the user details and role name when starting a session. Every SQL query that the pipeline runs will now follow these strict rules. If the language model tries to drop a table, the database blocks the query.
What native database roles solve and what they miss
Native database roles are great at stopping unwanted writes and schema changes. They make sure a broken prompt cannot wipe out your core business records. They also help your team separate AI compute costs from human analyst work. By giving the app its own small warehouse, you cap its spend.
Still, a static role only checks who logs in at the start. It does not check what each query does while the session runs. A valid select query can still pull millions of rows of private data. If a table holds customer emails, phone numbers, or card numbers, the model gets them. Static roles also require you to store user keys on the app server. If someone steals those keys, they can read every table in that schema.
Read-Only Root Filesystem + Snowflake Access Control: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Why query-level controls matter for AI pipelines
AI pipelines build queries based on user input, which makes them hard to predict. Two users can ask the same app very different questions. Both questions will run under the exact same database role and user session. The database logs will only show that the shared service user ran a query. Your security team will not know which person or prompt triggered the data read.
Teams also struggle to mask private fields across dozens of tables in a warehouse. Setting up native masking policies for every column takes a lot of time. Without row limits or field masking, a single read query can leak sensitive records. Data masking rewrites matched fields like national IDs in results before the app processes them. Good pipeline safety needs both strict database roles and checks on live queries.
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 a read role still run up high compute bills?
Yes, a bad select query can scan huge tables and keep a warehouse running. You should pair your read role with a small warehouse and a strict timeout rule.
How do we handle new tables added to the schema later?
You can set up future grants on the schema for your custom role. This rule gives the role select rights on new tables when your team creates them.
Should the AI pipeline share a user account with BI tools?
No, you should always make a separate user and role just for the AI app. This keeps your audit logs clean and lets you cut off the app fast.
Related guides
In this post