How to Configure Semantic Kernel ClickHouse Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up semantic kernel clickhouse approval, add human checks before AI plugins run queries. You also need strict database roles to limit what the AI agent can read. Many teams connect AI agents to analytical databases with shared admin keys. When an agent holds broad rights, one bad prompt can expose private records or drop tables. How semantic kernel clickhouse approval works with native roles A strong setup starts inside the database itself. ClickHouse manages users, roles, row policies,

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 clickhouse approval, add human checks before AI plugins run queries. You also need strict database roles to limit what the AI agent can read. Many teams connect AI agents to analytical databases with shared admin keys. When an agent holds broad rights, one bad prompt can expose private records or drop tables.

How semantic kernel clickhouse approval works with native roles

A strong setup starts inside the database itself. ClickHouse manages users, roles, row policies, settings profiles, and quotas as SQL access items. To turn on SQL access control, admins set a server storage path. They also give at least one user access management rights. In ClickHouse, a user can only grant rights that they already hold.

Creating a new user for your AI app requires the create user right. That setup step sets the login method, allowed hosts, default roles, and user settings. Instead of giving full table access, teams should grant read rights on specific columns. When a user only has rights on two columns, queries for other columns fail.

A broad select-all query also fails unless the table holds only those granted columns. Since version 24.10, admins can also grant rights by table name prefix. On the app side, developers use Semantic Kernel filters to pause function calls. The app sends the planned query to a human reviewer and waits for a reply.

What native controls solve and what they leave open

Database roles and column grants stop an AI agent from reading off-limits tables. They set a hard wall around which user account can log in. They also lock down which columns that account can touch at rest. App filters add a basic check inside your code before a plugin runs.

Still, static database grants cannot review a single query in flight. Once a role has read rights on a column, every query for that column runs. Native grants do not pause risky statements for a team lead to check. They also do not mask sensitive strings like emails or phone numbers in query results.

Building approval steps inside Semantic Kernel code creates extra work for every app team. Developers must write custom pause logic for each new agent they ship. If another script uses the same database key outside the app, it skips those checks. Teams need a central way to review queries and rewrite matched fields in results.

Approval Chains & Escalation + ClickHouse Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Best practices for AI database reviews

Start by giving your Semantic Kernel app its own ClickHouse user account. Never share human admin keys with an automated agent. Limit that user to specific source hosts and grant read rights on safe columns only. Keep write and drop rights off the agent role unless a specific task needs them.

Next, define clear rules for which actions need a human sign-off. Simple summary queries on public tables can run right away. Queries that touch customer tables or change data should pause for a peer check. Reviewers need to see the exact SQL text before they click approve or deny.

Finally, pair query approvals with data masking on the way back. Even an approved query might pull rows that hold card numbers or national IDs. Rewriting those fields in the result set keeps sensitive data out of AI prompts. Keep a full log of every prompt, query check, and reviewer decision for audits.

Add runtime guardrails and masking beside ClickHouse

Database grants and network rules control who can reach ClickHouse. Even so, an allowed client or agent can send an alter mutation that deletes rows or read raw personal data. In practice, hoop.dev runs beside the server as a sidecar for your ClickHouse and checks native TCP queries with no change to your drivers.

With hoop.dev ClickHouse support, guardrails refuse banned queries before they run, and data masking rewrites matched string columns in results. The audit trail logs which entity types were masked and how many without storing raw values. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Can ClickHouse restrict an AI agent to specific columns?

Yes, admins can grant read rights on named columns only. If the AI runs a select-all query on wider tables, the database refuses it.

Why are Semantic Kernel code filters not enough for approvals?

Code filters only protect the single app where developers wrote them. Any tool or user with the raw database key can bypass those app checks.

What happens to sensitive fields during an approved AI query?

With data masking active, the system rewrites matched fields like emails or card numbers. The AI model receives masked text in the results instead of raw strings.

The query runs. The emails stay hidden.