How to Configure JetBrains AI ClickHouse Connect
To set up jetbrains ai clickhouse connect, pair your coding assistant with a restricted database user. Create a specific SQL role in your cluster and assign it to the Python driver. Many teams start by giving their local tool an admin account to save time. This shortcut creates risk when an assistant generates broad queries or reads private tables. How jetbrains ai clickhouse connect works with native roles The Python driver links your code editor and assistant to your analytical database. Wh
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 connect, pair your coding assistant with a restricted database user. Create a specific SQL role in your cluster and assign it to the Python driver. Many teams start by giving their local tool an admin account to save time. This shortcut creates risk when an assistant generates broad queries or reads private tables.
How jetbrains ai clickhouse connect works with native roles
The Python driver links your code editor and assistant to your analytical database. When the assistant writes or runs code, it uses the login details on your laptop. You should control what those login details can do inside the database engine. ClickHouse manages users, roles, row policies, settings profiles, and quotas as SQL entities.
Before you create a user with SQL, you must turn on SQL-driven access control. This setup needs a storage directory set in the server access control path parameter. It also requires at least one user with access management and named collection control set to one. Once active, an admin with the create user privilege can add a new account.
A user can only grant the privileges that they hold on their own account. When you create the account, you can set the login method and allowed hosts. You can also assign default roles and specific settings for that single user. This keeps the assistant tied to a known host and a strict role.
Using column grants to limit data exposure
Database admins can restrict which columns the assistant and driver can read. You can grant read rights on specific columns instead of the whole table. For example, a user granted only two columns can run queries on those two columns. If the assistant tries to read a third column, the database blocks the query.
A full wildcard query also fails and returns no data at all. A wildcard query only works if the table holds just the granted columns. Since version 24.10, a trailing asterisk lets you grant rights by table name prefix. This helps when your team creates many tables that share a common naming pattern.
ClickHouse Access Management + AI Agent Security: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native roles solve and what they leave open
Native roles and column grants stop an assistant from reading forbidden tables or columns. They also let you limit which hosts can log in with a given account. This solves the basic problem of who can log in to the cluster. Still, static grants do not check what an allowed query does in flight.
If an engineer needs to read a customer table, column grants are very rigid. If you grant access to an email column, every row returns raw text by default. Static database roles do not mask emails, phone numbers, card numbers, or national IDs in results. Also, storing long-lived keys in local project files leaves credentials sitting on developer laptops.
Teams often share one role across many local tools and scripts. When an assistant runs a heavy query, the database log only shows that shared user. You cannot tie a specific prompt or editor action to the resulting database query. You also cannot require a quick human check before a sensitive command runs.
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
Why did my wildcard query fail when using a restricted ClickHouse user?
When a user only has grants on specific columns, wildcard queries are refused. The database returns no data unless the table holds only the granted columns. Ask the assistant to list the exact allowed column names in every query.
How do I turn on SQL user creation in ClickHouse?
You must configure a storage directory using the server access control path setting. You also need an initial account with access management and named collection control set to one. After that, an admin with the create user privilege can manage accounts with SQL.
Can I grant read access to a group of tables at once?
Yes, since version 24.10, you can use a trailing asterisk on table names. This grants read rights to all tables that match that exact name prefix. It saves time when your app writes to daily or prefixed tables.
Related guides
In this post