How to Configure Windsurf ClickHouse Sandbox
You set up a windsurf clickhouse sandbox by creating a limited database user and pairing it with agent terminal rules. Then you give the editor agent only read rights on specific test tables. Teams often start by handing their coding agent full local database keys. That shortcut lets the agent run any command in the shell. If a prompt goes wrong, broad roles let the agent drop tables or read secret rows. How to set up a windsurf clickhouse sandbox with SQL roles First, note that Cognition ren
ClickHouse Access Management + AI Sandbox Environments: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
You set up a windsurf clickhouse sandbox by creating a limited database user and pairing it with agent terminal rules. Then you give the editor agent only read rights on specific test tables. Teams often start by handing their coding agent full local database keys. That shortcut lets the agent run any command in the shell. If a prompt goes wrong, broad roles let the agent drop tables or read secret rows.
How to set up a windsurf clickhouse sandbox with SQL roles
First, note that Cognition renamed Windsurf to Devin Desktop in June 2026. The app keeps the same features and uses the Cascade agent to run tasks. This agent runs terminal commands on its own once a user gives permission. It opens a dedicated shell on macOS or Linux and loads your local profile. That means your shell aliases and local variables are ready for the agent to use. The agent can also talk to external tools through Model Context Protocol servers.
To lock down the database side, you use SQL access control inside ClickHouse. First, enable the access control path on the server and set up an admin account. Only a user with access management rights can create new users or roles. Also, a user can only grant rights that they already hold themselves. You then create a dedicated sandbox user for the agent with its own login method. You can also limit which hosts this user can log in from. Along with login rules, you can attach default roles, settings profiles, and usage quotas.
Next, you restrict what data the sandbox user can read. ClickHouse lets you grant read rights on single columns rather than whole tables. If you grant read access on two columns, the agent can query only those two fields. A query that asks for all columns at once will fail and return zero rows. Only tables that hold just the allowed columns will let a full table read pass. Since version 24.10, you can also grant read rights across tables that share a name prefix. This helps you group sandbox tables under one prefix for the agent.
What native database roles solve and what they miss
Native database users and column grants solve the first layer of risk. They decide who can log in and which tables or columns stay off limits. If the coding agent tries to read a forbidden column, the database blocks the query. Quotas and settings profiles also stop a single bad query from eating all server memory. This setup works well when you have clean test tables with fake data.
Still, static grants do not check what happens inside allowed queries while they run. Once the agent logs in, the database trusts every valid query on the allowed columns. If an allowed column holds emails, phone numbers, card numbers, or national IDs, raw values flow back to the agent. Static roles also require you to store database keys in local files or shell variables. Because the agent loads your shell profile, any tool in that shell can read those stored keys. Native setup controls who logs in, not what each statement does in flight.
ClickHouse Access Management + AI Sandbox Environments: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Why local agent shells complicate database safety
When an agent runs inside your local shell, it shares the permissions of that terminal session. Developers often keep several database profiles in their shell config for daily work. Even if you make a restricted ClickHouse account, an agent might pick up a stronger key from the shell. Separating human admin keys from agent sandbox tasks takes constant manual work across every laptop.
Teams also lack a clear log that ties a specific agent prompt to a specific database query. ClickHouse logs show that the sandbox user ran a statement, not which developer or agent turn triggered it. When you want to mask emails or card numbers in query results, column grants alone are too blunt. Blocking a whole column often breaks the query logic that the developer wants the agent to test.
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 name to Devin Desktop?
Yes, Cognition renamed Windsurf to Devin Desktop on June 2, 2026. The editor keeps the same features and still uses the Cascade agent for terminal commands and tool calls.
What happens if the agent runs SELECT * on a table with column grants?
ClickHouse refuses the query and returns no data at all. The query only works if the agent names the allowed columns, or if the table holds only allowed columns.
How does the Windsurf agent reach a ClickHouse database?
The agent can run CLI queries in its dedicated terminal with user permission, or it can use a configured MCP server. Because the terminal loads your shell profile, it can use any database aliases or keys stored there.
Related guides
In this post