How to Configure JetBrains AI ClickHouse Permissions
You set up jetbrains ai clickhouse permissions by making a dedicated SQL role. Then you attach this restricted role to your IDE database user. Many teams connect their coding tools using a shared admin login. This fast setup gives the AI assistant full read and write power. Broad roles create big risks when an assistant runs a bad query. A single mistake can drop tables or read secret customer columns. You need tight rules before you link an assistant to live data. How to set up jetbrains ai
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 jetbrains ai clickhouse permissions by making a dedicated SQL role. Then you attach this restricted role to your IDE database user.
Many teams connect their coding tools using a shared admin login. This fast setup gives the AI assistant full read and write power. Broad roles create big risks when an assistant runs a bad query. A single mistake can drop tables or read secret customer columns. You need tight rules before you link an assistant to live data.
How to set up jetbrains ai clickhouse permissions with SQL
ClickHouse manages users, roles, row policies, settings profiles, and quotas through SQL. Before you start, your server needs a storage path for access files. You also need an admin user who holds access management rights. Remember that a user can only grant rights they already hold.
First, make a new user for your IDE session. This step requires the right to create users on the server. When you make the user, you pick a login method. You can also limit which hosts the user can log in from. Next, assign a default role and custom settings to that user.
For an AI tool, you should grant read rights on safe columns. ClickHouse lets you grant select rights on specific columns in a table. If a user has rights on two columns, they can read them. Any query that asks for a third column will fail right away. A full table query with an asterisk will also fail and return nothing. It only works if the user has rights on every column by default.
You can also group tables by name when you grant read rights. Since version 24.10, a trailing asterisk grants rights by table name prefix. This rule helps you share safe summary tables while hiding raw tables.
AI Agent Permissions + ClickHouse Access Management: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native roles solve and what they miss
Native database roles decide who can log in from a given host. They also define which tables and columns that account can read. This setup stops your IDE assistant from altering tables or reading blocked columns. It gives your team a solid first line of defense.
Still, static roles do not inspect what individual queries do in flight. Once a user has read rights on a column, every row comes back raw by default. The database cannot rewrite emails, phone numbers, card numbers, or national IDs on the fly. If an engineer needs to check a table with emails, they get raw text. The AI assistant in their IDE can then send those emails to an external model.
Static roles also stay active twenty-four hours a day. You must update SQL grants by hand each time a task changes. Plus, column grants break common exploration queries that use a wildcard selector. Developers often ask for broader roles just to make their tools work. Teams need a way to inspect queries and mask fields during the session.
Check ClickHouse queries and results before execution
Access control in ClickHouse is essential setup. Setup alone does not check single queries for risk or rewrite sensitive strings in returned rows. By design, hoop.dev sits beside the server as a sidecar for your ClickHouse and parses every statement before execution.
First, hoop.dev guardrails block disallowed deletes, drops, and alter mutations. Then hoop.dev data masking rewrites sensitive string columns in responses and logs each decision per resource. Read the docs and source on GitHub.
Frequently asked questions
Why do wildcard queries fail when using column grants?
ClickHouse blocks wildcard select queries when a user lacks rights to every column by default. The query returns no data unless the user can read all columns in that table.
Can any admin create a new user for an IDE tool?
No, an admin must hold the create user privilege to add accounts. Also, a ClickHouse user can only grant rights that they already hold themselves.
How do I grant read access to a group of matching tables?
Since version 24.10, you can put a trailing asterisk on a table name. This rule grants read rights to all tables that share that name prefix.
Related guides
In this post