How to Configure Windsurf ClickHouse Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up windsurf clickhouse permissions by creating a restricted database user and role. Then you give that login to the coding agent in its shell or tool setup. Teams often give an AI assistant a full admin login to save time during setup. When a role is too broad, the agent can read private rows or drop tables. Note that on June 2, 2026, Cognition renamed Windsurf to Devin Desktop. The desktop app keeps the same features and still runs the Cascade agent. How windsurf clickhouse permission

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 windsurf clickhouse permissions by creating a restricted database user and role. Then you give that login to the coding agent in its shell or tool setup. Teams often give an AI assistant a full admin login to save time during setup. When a role is too broad, the agent can read private rows or drop tables. Note that on June 2, 2026, Cognition renamed Windsurf to Devin Desktop. The desktop app keeps the same features and still runs the Cascade agent.

How windsurf clickhouse permissions work in practice

First, understand how the desktop agent talks to your database. The agent can run terminal commands on its own after a user says yes. It opens a dedicated shell that loads the local shell settings and variables. The legacy Cascade agent also talks to external Model Context Protocol servers. Both paths rely on the database user credentials stored on the developer machine.

ClickHouse manages users, roles, row rules, settings profiles, and quotas through SQL statements. To turn on SQL access control, an admin sets a storage directory on the server. At least one initial user must also have the user management flag turned on. That admin can then create a dedicated database user for the coding agent. A user can only grant the database rights that they already hold themselves.

When you create the user, you set the login method and allowed client hosts. You also attach default roles and user settings to that account. For an AI assistant, you should grant read rights only on needed tables. ClickHouse lets you grant read rights on specific columns inside a table. If a user only has rights on two columns, queries for other columns fail. A wildcard query for all columns also fails and returns no data at all. The wildcard query only works if the table holds just those granted columns. You can also grant rights across tables that share a name prefix.

Why native roles are only the first step

Native roles and column grants solve a big part of the access puzzle. They stop the agent from reading blocked tables or running schema changes. They also limit which client hosts can log in with that user account. This keeps a clear line between human admin accounts and automated tool accounts.

ClickHouse Access Management + AI Agent Permissions: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Still, database roles leave a large operational gap during daily coding work. Static permissions decide who can log in and which objects they can touch. They do not inspect what individual queries do in flight during a session. If a table holds emails, phone numbers, or card numbers, a read grant exposes them. The agent pulls those raw fields into its context window when it runs a query. Also, local shell variables keep long-lived database keys sitting on developer laptops.

Closing the gap for AI database queries

To fix this, teams must look beyond static user grants on the database server. You need controls that check every statement before it reaches the database engine. You also need data masking that rewrites matched fields like national IDs in results. That way, the agent gets valid schema shapes without pulling raw private values. Removing static passwords from local shell configs also cuts the risk of leaked keys.

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 sits inline in the native TCP protocol beside the server as a sidecar for your ClickHouse. For every production query an agent or human sends, hoop.dev decides whether to pass, mask, block, or escalate it for review.

With hoop.dev ClickHouse support, guardrails refuse banned queries before they run or hold risky calls for approval, and data masking rewrites matched string columns in results in memory. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Did Windsurf change its product name?

Yes, on June 2, 2026, Cognition renamed Windsurf to Devin Desktop. It keeps the same editor features, terminal runner, and Cascade agent workflows.

Why does a select all query fail with ClickHouse column grants?

ClickHouse blocks wildcard queries when a user only has grants on specific columns. The user must name the allowed columns in the query to get data back.

How does the desktop agent reach my ClickHouse server?

The agent runs commands in a local shell that loads your shell variables. It can also reach databases through Model Context Protocol servers set up locally.

The query runs. The emails stay hidden.