How to Configure OpenHands Snowflake Read Only Permissions
You set up openhands snowflake read only permissions by building a custom database role. Then you grant that role select rights on specific tables and schemas. Engineering teams often give coding agents broad credentials to move fast during testing. Overly broad roles let an autonomous agent change production tables or delete key records. Scoping permissions down to read actions stops agents from running destructive write commands. How openhands snowflake read only permissions work OpenHands
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 openhands snowflake read only permissions by building a custom database role. Then you grant that role select rights on specific tables and schemas. Engineering teams often give coding agents broad credentials to move fast during testing. Overly broad roles let an autonomous agent change production tables or delete key records. Scoping permissions down to read actions stops agents from running destructive write commands.
How openhands snowflake read only permissions work
OpenHands runs as an autonomous coding agent inside its own workspace. The agent writes scripts and runs queries to solve software tasks for your team. When the agent queries Snowflake, it logs in with a dedicated service user. Database admins create a custom role in Snowflake just for this service user. That role needs usage rights on a warehouse, a database, and specific schemas. Next, the admin grants select privileges on the tables or views needed. The admin assigns this read role as the default for the agent user. The agent loads the account details and credentials from its workspace variables. Every query the agent runs inside that session inherits the read role rules. If the agent tries to drop a table, the database rejects the command. This native role design follows standard privilege practices for automated tools and scripts.
What native roles solve and what they miss
Native database roles are great at stopping accidental data changes or table drops. A select role makes sure the coding agent can only read rows. Still, database roles only check who logs in and which objects they touch. They do not inspect what individual queries do in flight during a session. A read role still allows an agent to pull millions of customer rows. Those rows often hold sensitive data like emails, phone numbers, or card numbers. When the agent runs a query, those raw values enter the agent workspace. From there, sensitive values can flow straight into external language model prompts. Also, a bad query from an agent can scan huge tables by mistake. That uses up warehouse compute credits and slows down other team jobs. Static credentials sitting inside the agent workspace also create a key management risk. If a developer shares the workspace log, those static keys might leak out.
Managing query behavior and sensitive data in flight
Securing an autonomous agent takes more than a static database role. Teams must check queries before they run and clean results before they return. Dynamic data masking rewrites matched fields like national IDs or emails in results. This step happens in flight so raw values do not enter model prompts. Teams also need clear audit logs that link every query to a user. Reviewing high-risk queries before execution stops runaway scans on large warehouse tables. Combining strict database roles with runtime controls keeps both data and compute safe.
Read-Only Root Filesystem + Snowflake Access Control: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
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 runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Can OpenHands still create temporary tables with a read role?
No, a strict read role blocks all table creation in the schema. If the agent needs temporary tables, you must grant that specific schema privilege.
How do we stop the agent from reading sensitive columns?
You can create secure views in Snowflake that leave out sensitive columns. You can also apply masking rules that rewrite emails and phone numbers.
Should the coding agent share a Snowflake user with human engineers?
No, you should always make a separate service user for the agent. Separate users make it easy to track agent queries and rotate keys.
Related guides
In this post