How to Configure Semantic Kernel Snowflake Read Only Permissions
You set up semantic kernel snowflake read only permissions by creating a custom database role. Then you assign only select rights to the service account your AI plugin uses. Many engineering teams start by giving their AI agents broad admin roles during testing. This shortcut lets a language model run destructive queries that can delete production tables. A strict role stops the model from writing or dropping data in the warehouse. Setting up semantic kernel snowflake read only permissions Fi
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 semantic kernel snowflake read only permissions by creating a custom database role. Then you assign only select rights to the service account your AI plugin uses. Many engineering teams start by giving their AI agents broad admin roles during testing. This shortcut lets a language model run destructive queries that can delete production tables. A strict role stops the model from writing or dropping data in the warehouse.
Setting up semantic kernel snowflake read only permissions
First, an admin creates a dedicated role inside the cloud data warehouse for the app. This role needs usage rights on the virtual warehouse, the database, and the schema. Next, you grant select privileges on the specific tables or views the agent needs. Do not grant insert, update, delete, or drop privileges to this new role.
After you build the role, you create a dedicated service user for the agent. You assign the new read-only role as the default role for this user account. Teams often use key-pair credentials instead of simple passwords for this service account. Your app loads these credentials from a secure secret store when it starts up.
Inside Semantic Kernel, you build a native plugin that wraps your database driver. When the AI model needs data, it calls this plugin with a query. The plugin opens a database session using the restricted service user and role. If the model tries to change a table, the warehouse blocks the statement.
Why native database roles leave a security gap
Native roles work well to stop an AI agent from changing or deleting tables. They check who logs in and block write commands at the table level. Still, a read-only role does not inspect what individual queries do in flight. Once the session starts, the agent can read every row and column allowed.
This creates a major risk when tables hold sensitive customer details. A read-only query can still pull emails, phone numbers, card numbers, or national IDs. The plugin sends those raw results straight into the language model prompt context. Data masking rewrites matched fields in results before they reach the model.
Read-Only Root Filesystem + Snowflake Access Control: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Also, shared service accounts make it hard to track which user triggered a query. The warehouse audit log only shows the single service account name for every run. A prompt bug can also cause the agent to run huge table scans. Native roles cannot pause a risky query for human review before it runs.
Best practices for AI database plugins
Avoid giving your AI plugin a general SQL execution tool whenever you can. Instead, create small plugin functions that run fixed queries with safe parameters. This design shrinks the chance of prompt injection turning into a full table dump.
You should also set up curated views that only expose safe columns and rows. Grant the read-only role rights to these views rather than the base tables. Set strict query timeouts on the virtual warehouse used by the AI service account. A short timeout stops bad agent queries from burning through your compute budget.
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 a read-only role stop an AI agent from reading sensitive columns?
A standard table grant lets the role read every column in that table by default. To hide emails or card numbers, you need restricted views or dynamic data masking.
How should Semantic Kernel store credentials for the data warehouse?
Never hardcode database keys or passwords in your plugin code or prompt files. Load the private key or secret from a managed vault at app startup.
What happens if a prompt injection tricks the model into running a drop statement?
The database engine checks the active role permissions before it runs the command. Because the role only has select rights, the engine rejects the drop statement right away.
Related guides
In this post