How to Configure Semantic Kernel ClickHouse Prevent Delete
You set up semantic kernel clickhouse prevent delete rules by creating a restricted database user. You grant only read rights to the account that your AI agent uses. Many teams connect AI plugins to analytics stores using a shared admin account. That broad role lets a bad prompt drop tables or erase rows by mistake. Scoping the database account stops the agent from running destructive delete mutations. How to set up semantic kernel clickhouse prevent delete rules Semantic Kernel uses plugins
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 clickhouse prevent delete rules by creating a restricted database user. You grant only read rights to the account that your AI agent uses. Many teams connect AI plugins to analytics stores using a shared admin account. That broad role lets a bad prompt drop tables or erase rows by mistake. Scoping the database account stops the agent from running destructive delete mutations.
How to set up semantic kernel clickhouse prevent delete rules
Semantic Kernel uses plugins and functions to let language models talk to external data. When an agent needs analytics data, it calls a function that runs a query. The database plugin logs in with the user credentials you give to the app. If that database user has delete rights, the model can erase production records.
ClickHouse manages users, roles, row policies, settings profiles, and quotas through SQL access control. To turn this on, an admin sets a storage directory in the server settings. At least one admin account needs access management and named collection control turned on. That admin can then create a dedicated user for the Semantic Kernel app. Note that a user can only grant the privileges that they already hold.
Creating a new user requires the user creation privilege in ClickHouse. The admin sets the login method, allowed client hosts, default roles, and user settings. To prevent deletes, you grant only read privileges on specific tables to this role. You never grant mutation, alter, or delete rights to the agent account.
You can also limit read rights to specific columns on a table. When you grant select on chosen columns, the agent can read only those fields. Queries that ask for other columns will fail right away. A wildcard select query also fails unless the table holds only the allowed columns. Starting in version 24.10, a trailing asterisk grants rights by table name prefix.
What native database roles solve and what they leave open
Native roles and column grants stop an AI plugin from running delete statements. Even if a user tricks the model, the database blocks the delete command. Host checks also make sure logins only come from your app servers.
ClickHouse Access Management + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Still, database roles only check who logs in at the start of a session. They do not inspect what individual queries do in flight within the allowed columns. A read query can still pull millions of rows and slow down the cluster. Also, native grants return raw text from every allowed column without rewriting sensitive fields. If an allowed column holds emails, phone numbers, card numbers, or national IDs, results show them. Teams also lack a clear audit log that ties each query to a user.
Managing mixed agent workloads safely
Some AI workflows need more than plain read rights to do their job. An agent might need to write summary rows while still blocking delete commands. Managing many separate database users for each small task takes a lot of work. Each new agent plugin needs its own credentials stored in your app config.
When a plugin does need write or delete rights for a rare task, static grants fail. If you grant delete rights to the role, that power stays active all day. You cannot require a human check for just one risky statement using static roles. Teams need controls that inspect each statement and mask sensitive fields in real time.
Check ClickHouse queries and result columns on the wire
ClickHouse users and row policies decide who connects. They do not check each statement on the wire or redact sensitive string columns in query results. With hoop.dev, you run an open-source proxy, a sidecar for your ClickHouse. It reads ClickHouse's native TCP protocol before queries run while ClickHouse stays in charge of login and grants.
Multi-statement queries and table mutations are split and checked by hoop.dev guardrails. Banned actions are refused with a native ClickHouse error. On returned rows, hoop.dev data masking rewrites String and FixedString columns that match your rules. The audit trail logs each query, table, and verdict. See the MIT-licensed source on GitHub.
Frequently asked questions
How do I stop a Semantic Kernel plugin from deleting ClickHouse data?
Create a dedicated ClickHouse user for the plugin and grant only select rights. Do not give the account alter or delete privileges on any target tables.
What happens if the AI agent runs a wildcard query on restricted columns?
ClickHouse blocks the wildcard query and returns no data at all. It only works if the table contains solely the columns granted to that user.
Can ClickHouse grants hide sensitive fields like emails or card numbers inside a column?
Column grants block access to whole columns, not specific text patterns inside a column. To rewrite emails, phone numbers, card numbers, or national IDs in results, use data masking.
Related guides
In this post