How to Configure Gemini CLI ClickHouse Approval
You set up gemini cli clickhouse approval by pairing local prompt rules with database privileges. The agent pauses before it runs a command, while ClickHouse checks the user role. Many teams start by giving the local agent a shared admin database login. That shortcut creates risk when the agent runs a broad query or alters tables. A safer plan restricts both the terminal tool and the database user. How to set up gemini cli clickhouse approval Setting up this workflow takes steps in two places
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 gemini cli clickhouse approval by pairing local prompt rules with database privileges. The agent pauses before it runs a command, while ClickHouse checks the user role. Many teams start by giving the local agent a shared admin database login. That shortcut creates risk when the agent runs a broad query or alters tables. A safer plan restricts both the terminal tool and the database user.
How to set up gemini cli clickhouse approval
Setting up this workflow takes steps in two places. First, you adjust the local terminal agent so it asks before running shell tasks or database tools. When the model wants to inspect a table, it shows the command in your terminal. You read the command and approve or reject it on the spot.
Second, you lock down the ClickHouse user that the agent uses to log in. ClickHouse manages users, roles, row policies, settings profiles, and quotas through SQL. An admin with user creation rights sets up a dedicated account for the agent. You can bind this user to specific client hosts and assign default roles. Remember that a ClickHouse user can only grant privileges that they already hold.
You can also limit which columns the agent can read. ClickHouse lets you grant select rights on specific columns of a table. If the agent tries to read all columns with a wildcard, ClickHouse refuses the query. The database returns no data unless the user has rights on every column in that table. You can also grant select rights across tables that share a name prefix.
Why local prompts and static roles fall short
Local confirmation prompts and ClickHouse roles solve the first layer of risk. They decide who can log in and which tables they can read. They also stop the agent from running a shell command without a human click. Still, this native setup leaves big gaps during daily work.
Approval Chains & Escalation + ClickHouse Access Management: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Terminal prompts ask the developer who started the session to approve their own agent. Under tight deadlines, people click yes on long SQL queries without reading every line. A local prompt does not ask a team lead or security reviewer for sign-off. It also keeps database secrets on the developer machine so the CLI can read them.
Static column grants also have limits when tables hold sensitive fields. Suppose an analytics table stores emails, phone numbers, card numbers, or national IDs. If the agent needs that column to join records, a static grant exposes the raw values. ClickHouse roles decide if a user can read a column at all. They do not rewrite matched fields in query results on the fly. They also do not require a fresh peer review when a query changes from a small check to a bulk export.
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 a ClickHouse user run a wildcard query with column grants?
No, unless that user has select rights on every column in the table. If any column is restricted, ClickHouse blocks the wildcard query and returns no data.
Who can create a new ClickHouse role or user for an AI agent?
Only an account with access management and user creation privileges can add users. In ClickHouse, a user can only grant privileges that they already hold themselves.
Why is a local CLI prompt not enough for production database safety?
A local prompt only asks the person running the terminal to approve the action. It does not bring in a second reviewer, hide local keys, or mask emails and card numbers in results.
Related guides
In this post