How to Configure JetBrains AI ClickHouse Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up jetbrains ai clickhouse approval, you must restrict the database user role and review generated queries before execution. Native database controls check user login rights, while editor reviews require manual human checks. Engineering teams often connect their code editor to analytics clusters to speed up query writing. The AI assistant reads schema details and writes analytical statements for the developer. Most teams start by sharing a single database account across the local develop

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 jetbrains ai clickhouse approval, you must restrict the database user role and review generated queries before execution. Native database controls check user login rights, while editor reviews require manual human checks.

Engineering teams often connect their code editor to analytics clusters to speed up query writing. The AI assistant reads schema details and writes analytical statements for the developer. Most teams start by sharing a single database account across the local development tool. When permissions on that account are too broad, a bad query can drop tables or read private records. A strong setup limits what the database account can do and adds a review step for high-risk actions.

How native permissions work for jetbrains ai clickhouse approval

ClickHouse manages users, roles, row policies, settings profiles, and quotas as SQL access entities. To turn on SQL access control, an admin sets a storage directory on the server. At least one admin account needs access management and named collection control turned on. That admin can then create new users and grant only the privileges they hold themselves.

When you create a user for an editor session, you set the login method and allowed hosts. You also assign default roles and specific user settings for that account. For safer AI queries, admins grant read privileges on specific columns instead of full tables. If a user only has rights to two columns, queries for other columns will fail. Running a wildcard select on that table also fails and returns no data at all. It only works if the table holds just the allowed columns. Recent database versions also let admins grant read rights by table name prefix using a trailing asterisk.

What native database roles solve and what they miss

Native SQL access control is great at deciding who can log in and which columns they can read. It stops an editor account from touching restricted tables or running admin commands without permission. Row policies and quotas also help cap resource usage for basic read workloads.

Still, static roles do not provide a true per-query approval flow. Once a user has permission to run a statement, the database runs every matching query right away. The database cannot pause a risky query in flight and ask a team lead for sign-off. If a developer needs temporary write rights to fix data, an admin must manually grant and revoke roles. Native grants also return raw values for allowed columns. They do not dynamically rewrite sensitive fields like emails, phone numbers, card numbers, or national IDs in query results.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Managing query reviews and sensitive data in flight

Relying on manual copy and paste in the code editor leaves room for human error. A developer might approve a complex query from the AI assistant without spotting a heavy join or mutation. Teams need a way to inspect every statement between the editor and the database cluster.

A strong approval workflow checks the exact SQL command before the database ever runs it. Routine read queries on safe tables can run right away. Statements that change data or scan restricted tables can pause until a reviewer approves them. At the same time, result filtering can rewrite emails and card numbers in the output stream. This keeps sensitive data safe during debugging while letting developers use their favorite editor tools.

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

Does ClickHouse have a built-in approval queue for AI queries?

No, ClickHouse evaluates static roles and grants at the moment a query arrives. If the user role has the required privilege, the server runs the statement right away without waiting for human sign-off.

How do column grants affect wildcard queries from JetBrains AI?

If an AI assistant writes a select-all query on a partially restricted table, ClickHouse refuses the query. The database returns no data unless the user has read rights on every column in that table.

Can database admins restrict which hosts an editor account logs in from?

Yes, the SQL user creation command lets admins define the exact hosts a user may use to log in. This helps restrict where shared or automated editor accounts can start a database session.

Short role checks help teams work fast. Simple rules make each review clear. Good logs keep every team safe. Scoped keys stop bad changes early.

The query runs. The emails stay hidden.