How to Configure Cline ClickHouse Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up cline clickhouse approval by pairing local agent prompts with SQL user grants. This ensures the coding agent asks before running queries and uses limited database roles. Many teams start by giving their coding agent a shared admin login for speed. That broad role lets a single bad prompt drop tables or read private records. A safe setup separates local prompt checks from server permissions. How native cline clickhouse approval works in practice A coding agent runs on the user machi

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 cline clickhouse approval by pairing local agent prompts with SQL user grants. This ensures the coding agent asks before running queries and uses limited database roles. Many teams start by giving their coding agent a shared admin login for speed. That broad role lets a single bad prompt drop tables or read private records. A safe setup separates local prompt checks from server permissions.

How native cline clickhouse approval works in practice

A coding agent runs on the user machine and reaches external databases through local tools. In its default flow, Cline asks the user to approve terminal commands or tool calls. When the agent wants to check a table, it drafts a query first. The user reads the proposed command in the editor and clicks approve or reject. Once approved, the local tool sends the query to the database server.

On the database side, ClickHouse manages users, roles, row policies, and quotas with SQL. To turn on SQL access control, admins set a server storage directory for access entities. They also enable access management on at least one admin user account. That admin can then create a dedicated user account for the coding agent. The user creation statement sets the login method, allowed client hosts, and default roles. A user can only grant privileges that they hold themselves.

Admins can restrict the agent further with column-level select grants. You can grant select rights on specific columns of a table to the agent user. The agent can then query those exact columns, while requests for other columns fail. Wildcard queries that ask for all columns also fail and return no data. The only exception is when the table holds just the granted columns. Admins can also grant select rights across tables that share a name prefix.

What native controls solve and what keeps the session active

Native database roles and local agent prompts solve the first layer of risk. Database accounts decide who can log in and which hosts they can come from. Column grants block the agent from reading excluded columns in a table. Local prompts let the developer stop an obvious mistake before the command runs.

Still, a large operational gap keeps the session active during daily work. Developers often get tired of clicking approve on every minor read query. Many users turn on auto-approve in their agent so they can work faster. Once auto-approve is active, local prompts no longer stop bad or broad queries. Even when a developer reads every prompt, human review is easy to bypass. A complex query can hide a heavy join or pull millions of rows at once.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Static database roles also have clear limits in live sessions. A role decides what tables a user can read at login time. It does not inspect what individual statements do in flight. If an agent needs to fix data in production, it needs write privileges. Granting that role on the database gives the agent standing rights for every session. A single approved command can still alter the wrong rows or expose sensitive fields. Without per-statement peer review, teams lack a clear audit log of who approved each query. You also cannot rewrite matched fields like emails, phone numbers, card numbers, or national IDs.

Why teams separate login rights from query review

Relying only on the developer sitting at the keyboard mixes creation with review. The person asking the agent to run a script is the same person approving it. For production data, teams need a second person to check risky commands before they run. They also need a way to inspect each SQL statement in flight. Moving approval out of the local editor keeps the workflow fast and safe. Read queries can run right away with data masking applied to sensitive fields. High-risk queries can pause and wait for a teammate to approve them in chat.

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 sits inline in the native TCP protocol beside the server as a sidecar for your ClickHouse. For every production query an agent or human sends, hoop.dev decides whether to pass, mask, block, or escalate it for review.

With hoop.dev ClickHouse support, guardrails refuse banned queries before they run or hold risky calls for approval, and data masking rewrites matched string columns in results in memory. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Can ClickHouse restrict an agent to specific columns?

Yes, admins can grant select rights on chosen columns to a specific database user. Queries for other columns or full wildcard selects will fail unless all columns are granted.

Why are local agent prompts not enough for production databases?

Local prompts only ask the developer who is running the agent for permission. Developers often turn on auto-approve, which skips human checks for risky queries.

How do you create a restricted ClickHouse user for an AI agent?

Turn on SQL access control and use an account that has access management rights. Run a create user statement that sets the login method, allowed hosts, and default roles.

The query runs. The emails stay hidden.