How to Configure Goose Snowflake Prevent Delete
To set up a goose snowflake prevent delete rule, assign a custom database role. This role removes row drop permissions before the agent starts its session. Engineering teams often give AI agents broad developer roles during setup. A single bad prompt can then wipe out whole tables in seconds. Scoping down role permissions stops the agent from running destructive statements. How to set up a goose snowflake prevent delete workflow Goose runs on your machine and runs tasks using local tools. Whe
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.
To set up a goose snowflake prevent delete rule, assign a custom database role. This role removes row drop permissions before the agent starts its session. Engineering teams often give AI agents broad developer roles during setup. A single bad prompt can then wipe out whole tables in seconds. Scoping down role permissions stops the agent from running destructive statements.
How to set up a goose snowflake prevent delete workflow
Goose runs on your machine and runs tasks using local tools. When it queries Snowflake, it uses the credentials from your local setup. The agent inherits every permission attached to that specific database role. If the user role can delete rows, the agent can too.
You can stop this by creating a dedicated role in Snowflake. Admins grant this role permission to read tables and insert new rows. They leave out the privileges that allow deleting rows or dropping tables. You then set up the agent session to use this restricted role.
Next, you map the service user to this restricted role as its default. You also block the user from switching to higher roles during a session. When the agent tries to remove rows, the warehouse rejects the statement. The database returns a permission error, and your data stays safe.
What native roles solve and what they miss
Native warehouse roles are great for blocking destructive commands across whole schemas. They stop an agent from dropping tables or wiping out records by mistake. This setup works well when an agent only needs to read data. It sets a clear boundary at the start of every session.
Still, static roles only decide who logs in and which tables they touch. They do not check what single statements do while they run in flight. Sometimes an agent needs write permissions to clean up staging tables. If you grant delete rights for one task, the role stays wide open.
Snowflake Access Control + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Static roles also do not rewrite sensitive fields in query results by default. Unless you build masking policies for every column, queries return raw emails and card numbers. Managing dozens of micro-roles and column rules for every agent task gets messy fast. Teams end up choosing between broken agent workflows and risky permissions.
Why statement checks matter for AI agents
AI agents do not act like standard backend apps with fixed queries. They write new SQL on the fly based on user prompts. An agent might try to fix a duplicate row issue by deleting data. Without statement-level checks, the warehouse just sees a valid user role.
Checking each query before it runs gives teams much finer control. You can block delete commands while still allowing safe updates in the same session. You can also require a human to approve risky statements in real time. Data masking can rewrite phone numbers and national IDs in results on the fly.
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 I block delete statements in Snowflake using a read-only role?
Yes, a read-only role stops all delete, update, and drop statements right away. It is the safest choice when your agent only needs to run reports.
What happens when the agent needs to update rows but not delete them?
You can grant select and update rights to the Snowflake role without delete privileges. This lets the agent change existing records while blocking row removal.
Does blocking delete statements also stop table drops and truncates?
No, dropping and truncating tables use different permissions than deleting single rows. You must also revoke ownership and truncate privileges from the agent role.
Related guides
In this post