How to Configure Windsurf ClickHouse Read Only Access
You set up windsurf clickhouse read only access by creating a limited database user. Then you give that user select rights and pass those keys to the agent. Many teams skip this step and share admin keys with their coding tools. Broad roles let an AI agent change tables or read private user rows. A strict setup stops the agent from altering data while it writes code. How windsurf clickhouse read only access works in practice Cognition renamed Windsurf to Devin Desktop in June 2026. The app ke
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 read only access by creating a limited database user. Then you give that user select rights and pass those keys to the agent. Many teams skip this step and share admin keys with their coding tools. Broad roles let an AI agent change tables or read private user rows. A strict setup stops the agent from altering data while it writes code.
How windsurf clickhouse read only access works in practice
Cognition renamed Windsurf to Devin Desktop in June 2026. The app keeps the same features and still uses the Cascade agent. This agent can run terminal commands on its own after a user agrees. It opens a dedicated shell that loads the local shell profile on the machine. It runs zsh on macOS and bash on Linux.
Because the shell loads local settings, the agent can read local variables and aliases. The agent also talks to external tools through Model Context Protocol servers. Whether the agent uses a shell tool or an MCP server, it needs database keys. You control what the agent can do by setting rules inside ClickHouse first.
ClickHouse manages users, roles, row policies, settings profiles, and quotas as SQL items. To use SQL access control, the server needs a storage path set up. At least one admin user must have access management rights turned on. That admin can then create a new user for the coding agent. A user can only grant rights that they already hold themselves.
When you create the user, you set the login method and allowed hosts. You can also assign default roles and user settings in that same step. To keep the agent safe, you only grant select rights on specific tables. ClickHouse even lets you grant select rights on single columns in a table. If you grant select on two columns, the user can only query those two.
A query for all columns with an asterisk will fail and return no data. That query only works if the table holds just the granted columns. Since version 24.10, you can also grant rights by table name prefix. You do this by placing a trailing asterisk at the end of the name.
What native read rules solve and what they miss
Native SQL grants do a great job of blocking table drops and data edits. If the Cascade agent tries to delete rows, the database rejects the command. Column grants also stop the agent from querying columns that you did not allow. Prefix grants make it easy to share groups of tables with one role.
Auditor Read-Only Access + ClickHouse Access Management: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Still, database roles only check who logs in and which tables they touch. Once a column is open, the database sends every value in that column back. If an allowed column holds emails or phone numbers, the agent gets them all. Those raw values then flow into the agent context and external model prompts.
Static keys stored in a shell profile also create a lasting risk for teams. Any script or terminal command in that shell can read those stored keys. Native roles also do not pause a bad query for a human to check. And local shell logs rarely tie a database query back to a user identity.
Why column grants alone do not stop data leaks
Developers often ask the coding agent to inspect real tables to fix a bug. The agent needs to see the table shape and sample rows to write queries. If you block every column that might hold private text, the agent breaks. If you open those columns, card numbers and national IDs enter the chat log.
Teams also struggle to manage database users for every developer and coding agent. Creating separate host rules and column grants for each person takes constant manual work. Most teams end up sharing one read account across the whole engineering group. When everyone shares one login, the database audit log shows the same user name. You cannot tell which developer or agent session ran a heavy query.
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 inline in the protocol beside the server as a sidecar for your ClickHouse. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human approval.
First, hoop.dev guardrails block disallowed deletes, drops, and alter mutations or hold them for review. Then hoop.dev data masking rewrites sensitive string columns in responses in memory and logs each decision per resource. Read the docs and source on GitHub.
Frequently asked questions
How does the Windsurf agent run ClickHouse queries?
Windsurf, now called Devin Desktop, runs commands in a dedicated zsh or bash shell. It can also reach databases through configured Model Context Protocol servers.
What happens if an agent runs SELECT * with column grants?
ClickHouse refuses the query and returns no data at all. SELECT * only works when the user has rights on every column in the table by default.
Can a ClickHouse user grant read rights to another agent account?
A user can only grant privileges that they hold themselves, and creating users requires the create user privilege.
Related guides
In this post