How to Configure Continue ClickHouse Read Only Access

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up continue clickhouse read only access by creating a restricted database user. Then you grant select permissions and link that account to your coding assistant. Engineering teams often connect AI tools to analytics databases using shared admin keys. This habit creates huge risks for production data. A bad prompt can trigger an accidental drop or alter statement. Broad permissions also expose every table and column to the assistant context. Setting up strict read permissions stops the as

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 continue clickhouse read only access by creating a restricted database user. Then you grant select permissions and link that account to your coding assistant. Engineering teams often connect AI tools to analytics databases using shared admin keys. This habit creates huge risks for production data. A bad prompt can trigger an accidental drop or alter statement. Broad permissions also expose every table and column to the assistant context. Setting up strict read permissions stops the assistant from changing or deleting data.

How to set up continue clickhouse read only access

ClickHouse manages users, roles, row policies, settings profiles, and quotas as access entities. Database admins create and change these entities using standard SQL statements. First, you must turn on SQL-driven access control on the server. This setup needs a storage directory and an admin account with access management turned on. Once active, that admin can make a new user for the Continue assistant. Creating a user requires the create user privilege on the admin account. You can only grant privileges that your own account already holds.

During user creation, you set the login method and allowed client hosts. You also assign default roles and specific user settings for the assistant. Next, you create a role that only allows reading data. You grant select rights on specific databases or tables to this role. Since version 24.10, a trailing asterisk grants rights by table name prefix. This helps when your team adds new analytics tables with shared prefixes. Finally, you assign the read role to the Continue user account. The coding assistant logs in with these credentials to inspect schemas and run queries.

How column grants restrict table reads

Sometimes a table holds both safe metrics and private user details. You do not want the coding assistant reading every column in that table. ClickHouse lets admins grant select privileges on specific columns instead of whole tables. The assistant can then run queries that ask for those permitted columns only. Any query that asks for an ungranted column will fail right away.

Column grants also change how wildcard queries work for the assistant. A select star query is refused and returns no data at all. It only works if the table contains just the granted columns. This rule forces the assistant to name allowed columns in every query. Teams use this feature to keep sensitive columns out of AI prompts. Still, maintaining column grants across hundreds of tables takes constant manual work. Schema changes can break assistant workflows until an admin updates the role grants.

Auditor Read-Only Access + ClickHouse Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native read roles solve and what remains exposed

Native database roles solve the problem of accidental data writes and deletions. The database engine blocks any insert, update, or drop statement from the assistant. Host restrictions also help by limiting where the assistant login works. Quotas and settings profiles can cap how many resources a query uses. These built-in tools form a strong base for database security.

Still, static database roles only check who logs in at the start. They do not inspect what individual queries return in flight. If an allowed column holds emails, phone numbers, or card numbers, queries return them. The assistant pulls those raw values right into the developer editor and prompt context. Also, placing static database keys on developer laptops creates a key management problem. If a laptop is lost, admins must rotate keys across the whole team. Teams need a way to mask sensitive fields like national IDs in results.

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

Can a ClickHouse user grant read access to another user?

Yes, if that user has access management turned on. A user can only grant the privileges that they already hold themselves.

Why does a wildcard query fail on a read-only ClickHouse account?

When you grant select on specific columns only, ClickHouse refuses select star queries. The query returns no data unless the table holds only the granted columns.

How do I grant read access to groups of ClickHouse tables?

Since version 24.10, you can use a trailing asterisk in your grant statement. This grants select rights to all tables that match the name prefix.

The query runs. The emails stay hidden.