How to Configure Windsurf ClickHouse Guardrails

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up windsurf clickhouse guardrails by creating limited database roles and column grants. Then you connect the editor agent using those restricted credentials. Teams often give their AI coding tools broad database accounts to move fast. When an agent holds full permissions, one bad query can drop tables or expose private rows. How windsurf clickhouse guardrails work in native setups Cognition renamed Windsurf to Devin Desktop in June 2026. It keeps the same editor features and uses the

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 guardrails by creating limited database roles and column grants. Then you connect the editor agent using those restricted credentials. Teams often give their AI coding tools broad database accounts to move fast. When an agent holds full permissions, one bad query can drop tables or expose private rows.

How windsurf clickhouse guardrails work in native setups

Cognition renamed Windsurf to Devin Desktop in June 2026. It keeps the same editor features and uses the Cascade agent. This agent can run terminal commands on its own after the user approves them. It opens a dedicated shell that loads the local user shell files. That means local aliases and saved variables are ready for the agent to use. The Cascade agent also talks to external tools through Model Context Protocol servers.

To limit what the agent does in ClickHouse, teams use SQL access control. ClickHouse manages users, roles, row policies, settings profiles, and quotas as access items. An admin turns on SQL access control by setting a server storage folder. At least one admin account needs access management rights enabled. A user can only hand out privileges that they already hold themselves. When creating an agent user, the admin sets the login method and allowed hosts. The admin also sets default roles and user settings.

Admins can also limit read permissions down to single columns. You can grant read rights on just two specific columns in a table. The agent can then query those two columns, but cannot read other columns. A full wildcard read fails and returns no data unless all columns are allowed. Since version 24.10, a trailing star lets admins grant rights by table name prefix.

What native controls solve and what they miss

Native ClickHouse roles and column grants solve the first layer of risk. They decide which account can log in and which tables or columns it can read. If the agent tries to read a forbidden column, the database blocks the query.

ClickHouse Access Management + AI Guardrails: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Still, static database roles leave big operational gaps open during daily work. First, the agent runs in a shell that loads all local shell variables. If a developer stores an admin database key in their shell profile, the agent can use it. Second, column grants are rigid. If a table holds emails, phone numbers, card numbers, or national IDs, blocking the column breaks queries. If you allow the column so queries work, raw data flows right into the model prompt. Native setup decides who logs in, not what individual statements do in flight. It cannot rewrite matched fields in results or ask a human before a risky command runs.

Best practices for safer agent database sessions

Start by creating a separate ClickHouse user just for your editor agent. Never let the agent share the personal database login of the developer. Keep database keys out of shell startup files so the agent terminal cannot read them. Grant read rights only on the exact tables and columns needed for the task. Use quotas and settings profiles to stop heavy queries from slowing down the cluster. Review the commands that the Cascade agent asks to run before approving them.

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

Why did Windsurf documentation move to Devin Desktop?

On June 2, 2026, Cognition renamed Windsurf to Devin Desktop. The editor and its Cascade agent keep the same features under the new name.

Why does a wildcard query fail when using ClickHouse column grants?

When a user only has rights on specific columns, ClickHouse refuses full wildcard queries. It returns no data at all unless the user holds rights on every column in that table.

How can the Windsurf agent reach my ClickHouse database?

The agent can run database client commands inside its built-in terminal with user approval. It can also reach databases through configured Model Context Protocol servers.

The query runs. The emails stay hidden.