How to Configure Semantic Kernel Snowflake Prevent Delete
To set up semantic kernel snowflake prevent delete rules, assign a read-only database role. You must also add strict query filters inside your AI agent plugins. Many teams start by giving their AI app a standard developer role. When permissions are too broad, a bad prompt can wipe out production tables. A safe setup pairs strict database permissions with app-level checks. How to set up semantic kernel snowflake prevent delete rules First, you need to set up a dedicated role inside your data w
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 semantic kernel snowflake prevent delete rules, assign a read-only database role. You must also add strict query filters inside your AI agent plugins. Many teams start by giving their AI app a standard developer role. When permissions are too broad, a bad prompt can wipe out production tables. A safe setup pairs strict database permissions with app-level checks.
How to set up semantic kernel snowflake prevent delete rules
First, you need to set up a dedicated role inside your data warehouse. Configure Snowflake permissions so this role can only read tables and views. Do not grant delete, drop, or truncate rights to this specific role. Create a dedicated user account for your AI agent and assign the role.
Next, build the plugin inside your Semantic Kernel app to run queries. Your app uses the new database user account to log in each session. Within the plugin, add a validation step before the app sends any SQL. This step checks the text generated by the language model for blocked words. If the query contains a delete command, the plugin stops the run right away. You can also use Semantic Kernel filters to check every function call before execution. These filters act as an extra check inside your app code.
Why native roles and app filters fall short
Native roles in Snowflake work well when an agent only needs to read data. They block destructive commands at the database engine level every single time. Still, many AI agents need to write new rows or update existing records. Once you grant write permissions to a table, coarse role checks become risky. A role that allows updates might also allow broad changes across many rows.
App filters inside Semantic Kernel also have clear limits in production. Text filters that look for specific words are hard to maintain over time. Language models can write complex queries or call stored procedures that hide destructive actions. Native setup rules decide who logs in, not what individual statements do in flight. Also, storing static database keys inside your app creates a security risk. If those keys leak, an attacker gains the exact same rights as your agent.
Snowflake Access Control + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Adding query checks and data masking for AI agents
When AI agents query production tables, preventing deletes is only half the battle. You also need to protect sensitive user data from entering the model prompt. Static database roles apply to the whole table and lack per-query context. A strong security setup inspects each statement right before the database runs it. It can block an unsafe delete statement even if the role allows write actions.
At the same time, dynamic data masking protects privacy during read queries. Masking rewrites matched fields in results, such as emails, phone numbers, and card numbers. It also rewrites national IDs before the payload returns to the Semantic Kernel plugin. This keeps sensitive records out of external model logs while allowing safe data analysis.
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 Semantic Kernel block delete queries on its own?
Semantic Kernel provides function filters that let your code inspect prompts and SQL text. Still, text matching in app code can miss complex SQL syntax or stored procedures. You should always pair app filters with strict database role permissions.
How do I let an AI agent insert rows without allowing deletes?
In your Snowflake role setup, grant select and insert privileges on the specific table. Do not grant delete or truncate privileges to that role. This lets the agent add new records while the database blocks row removal.
What happens when an agent needs to run a safe delete?
If an agent must delete specific rows, do not grant broad table delete rights. Instead, route the request through an approval workflow so a human can review it. You can also restrict the agent to calling a safe, pre-written stored procedure.
Related guides
In this post