How to Configure OpenHands Snowflake Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up openhands snowflake approval by pausing agent tasks before they run database queries. You also pair those agent pauses with strict warehouse roles for every session. Many engineering teams start by giving their coding agent a shared warehouse key. When that role has broad permissions, the agent can drop tables or read private rows. How openhands snowflake approval works in native setups OpenHands runs as an autonomous coding agent inside its own workspace. The agent writes code, ru

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 approval by pausing agent tasks before they run database queries. You also pair those agent pauses with strict warehouse roles for every session. Many engineering teams start by giving their coding agent a shared warehouse key. When that role has broad permissions, the agent can drop tables or read private rows.

How openhands snowflake approval works in native setups

OpenHands runs as an autonomous coding agent inside its own workspace. The agent writes code, runs shell scripts, and sends queries to your data warehouse. In a standard setup, you tell the agent to pause before running shell actions. This confirmation mode waits for a human to check the next step.

On the warehouse side, you create a dedicated role for the agent session. You grant this role read permissions on specific schemas and tables. You also remove write permissions on production tables so the agent cannot alter live data. The agent uses a key pair or password to log in its warehouse session.

When the agent needs data, it drafts a query script in its workspace. If you turn on confirmation mode, the agent stops and shows the script. A team member reads the script and clicks approve to let it run. Then the warehouse checks the assigned role and runs the query.

What native permissions solve and what they miss

Native warehouse roles do a great job of blocking unauthorized logins. They stop the agent from touching databases outside its assigned role. They also let your security team group table permissions by job function. This setup decides who logs in and which schemas they can see.

Still, static roles do not check what individual queries do in flight. Once a session starts, the warehouse trusts every command that matches the role. If an agent has write permissions for a staging table, it can still delete every row by default. A static role cannot tell a safe update from a bad table drop.

Agent confirmation mode also leaves a big gap during daily work. OpenHands often runs dozens of small shell steps to finish one ticket. When humans must approve every single step, they get tired and click yes fast. Worse, the agent might hide a bad SQL query inside a Python file. The human only sees the file name, not the raw query text.

Approval Chains & Escalation + Snowflake Access Control: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Why teams separate query checks from agent workspaces

Relying on the agent to pause itself is risky for production data. If a team member turns off confirmation mode to save time, all checks vanish. The agent also holds the raw database credentials inside its own workspace. A bad prompt or bug could cause the agent to print those keys in logs.

To fix this, teams move query checks outside the agent workspace. They keep database keys out of the sandbox where the agent writes code. They also check each SQL command right before the database runs it. If a query asks for emails, phone numbers, or card numbers, masking rewrites matched fields in results.

This split lets the agent run code fast while keeping strict rules on data. Humans only need to review high-risk queries instead of every shell command. Security teams get a clear log of every query without blocking down daily engineering work.

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 run queries without human review?

Yes, OpenHands can run queries on its own if you turn off confirmation mode. You should limit its warehouse role to safe test schemas when running it this way.

How do we stop an agent from reading customer data?

You can restrict the warehouse role so it only sees safe views. You can also use data masking to rewrite emails, phone numbers, and national IDs in results.

Should the coding agent use a personal warehouse account?

No, you should never give an agent a personal user account. Always create a separate service account with a strict role and minimal table permissions.

The query runs. The emails stay hidden.