How to Configure JetBrains AI ClickHouse Sandbox

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a jetbrains ai clickhouse sandbox by creating a limited database user. Then you link that user account to the editor database tool. Many teams start by giving the editor a broad admin account. That shortcut lets AI tools read private tables or run heavy queries. A safe setup needs strict database roles and column rules from day one. How to set up a jetbrains ai clickhouse sandbox First, turn on SQL access control in your ClickHouse server. This step needs a storage folder for acces

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 a jetbrains ai clickhouse sandbox by creating a limited database user. Then you link that user account to the editor database tool. Many teams start by giving the editor a broad admin account. That shortcut lets AI tools read private tables or run heavy queries. A safe setup needs strict database roles and column rules from day one.

How to set up a jetbrains ai clickhouse sandbox

First, turn on SQL access control in your ClickHouse server. This step needs a storage folder for access files on the server. It also needs one base user with access management turned on. Once active, you manage users, roles, row rules, settings profiles, and quotas with SQL.

Next, create a fresh user account just for your editor session. Creating a user requires the right permission on your admin account. Keep in mind that a user can only grant permissions they already hold. When you create the account, pick a login method and set allowed host networks. You can also assign default roles and specific user settings right away.

After the user exists, grant read permissions on safe tables only. You can grant read rights on specific columns instead of the whole table. If you only allow two columns, the user can query just those two. Queries for other columns will fail right away. A full wildcard read query also fails and returns no data at all. It only works if the table holds just those allowed columns. You can also grant rights across tables that share a name prefix.

Why native roles are only half the setup

Native ClickHouse roles and column grants work well to block off limits tables. They control who can log in and which columns a role can read. They also help you group settings profiles and quotas for different teams. This stops an editor tool from reading restricted columns or unknown tables.

Still, static grants do not check what happens inside allowed columns in flight. Once a user has read rights on a column, every row comes back raw by default. If an allowed text column holds emails or phone numbers, the tool gets them. Card numbers and national IDs in those columns also flow back to the editor. Native grants decide login rights, not how data looks in individual query results.

AI Sandbox Environments + ClickHouse Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Database admins also have to maintain column grants across many changing tables. When developers add new columns, someone must update the role grants by hand. If a team uses wildcard table prefixes, new tables inherit those broad read rules. Teams need a way to inspect queries and rewrite sensitive fields on the fly.

Managing query behavior in editor workflows

AI tools in code editors read table schemas to write SQL for developers. They often run test queries to check data shapes or debug slow views. If the database account has wide permissions, the AI can scan huge partitions. Setting user quotas and read rules in ClickHouse helps cap resource spikes.

Still, teams want clear audit logs tied to each person on the team. Shared sandbox accounts make it hard to see who ran which query. Linking every database query to a real user identity fixes this tracking gap. Combine identity tracking with field masking so results rewrite emails and card numbers.

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

What happens if JetBrains AI runs a wildcard select on a restricted table?

ClickHouse blocks the query and returns no data at all. A wildcard query only works if the user has rights on every single column.

Can a sandbox user share their ClickHouse permissions with another account?

A ClickHouse user can only grant permissions that they already hold themselves. They also need explicit permission to create users or assign roles.

How do you limit where the sandbox user can log in from?

When you create the user in ClickHouse, you can define allowed client hosts. This rule restricts logins to specific network addresses or host names.

The query runs. The emails stay hidden.