How to Configure Windsurf ClickHouse Audit Log

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up a windsurf clickhouse audit log, give the agent a dedicated database user. Then read its query records from native ClickHouse system tables. Teams often let AI coding agents share personal database logins during local testing. When permissions are too broad, an agent can read private rows or change live tables. You also lose track of which query came from the human versus the agent. How a windsurf clickhouse audit log works with native roles Cognition renamed Windsurf to Devin Deskt

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.

To set up a windsurf clickhouse audit log, give the agent a dedicated database user. Then read its query records from native ClickHouse system tables. Teams often let AI coding agents share personal database logins during local testing. When permissions are too broad, an agent can read private rows or change live tables. You also lose track of which query came from the human versus the agent.

How a windsurf clickhouse audit log works with native roles

Cognition renamed Windsurf to Devin Desktop in June 2026. The app keeps the same IDE and features under the new name. Its Cascade agent can run terminal commands on its own after the user gives permission. It uses a dedicated terminal that loads the user shell setup. Because of this, local shell aliases and environment variables are open to the agent. The Cascade agent also reaches outside databases through configured Model Context Protocol servers.

ClickHouse manages users, roles, row policies, settings profiles, and quotas as SQL access entities. Turning on SQL access control needs a storage folder on the database server. It also requires at least one user with access management rights turned on. A user can only grant the database privileges that they already hold themselves. Creating a new user account requires the create user privilege in ClickHouse. That setup step sets the login method, allowed client hosts, default roles, and settings.

To keep the log clean, make a separate ClickHouse user just for the agent. You can also limit what the agent reads by granting select rights on specific columns. If a user only has rights on two columns, queries for other columns fail. Select all queries also fail and return no data unless all table columns are allowed. ClickHouse records these queries in its system tables so teams can check past activity.

What native database roles solve and what they miss

Dedicated ClickHouse users and column grants solve the basic problem of who can log in. They separate agent traffic from human traffic inside your database query logs. They also block the agent from reading columns that were not granted to its role. Row policies and quotas help limit how much data the role can pull at once.

Still, native database setup leaves a big operational gap during live sessions. The agent runs inside a local shell that loads the developer's own environment variables. If a developer stores strong database keys in that shell, the agent can use them. Native roles also check permissions at login and table level, not per live statement. If an allowed column holds emails, phone numbers, card numbers, or national IDs, queries return them. Standard database logs record the event after it runs, rather than rewriting results in flight.

Audit Log Integrity + ClickHouse Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Steps to tighten agent database sessions

Start by removing shared admin database keys from local shell files on developer machines. Give each AI agent session its own ClickHouse user with strict host limits. Grant select permissions only on the exact columns needed for the coding task. Review your ClickHouse system query logs each week to spot failed or wide queries.

When tables hold sensitive fields, column grants alone might break valid test queries. Teams often need data masking that rewrites matched fields in results before the agent reads them. They also need statement rules that pause risky commands for human approval before execution.

Check ClickHouse queries and result columns on the wire

ClickHouse users and row policies decide who connects. They do not check each statement on the wire or redact sensitive string columns in query results. With hoop.dev, you run an open-source proxy, a sidecar for your ClickHouse, inline in ClickHouse's native TCP protocol. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Multi-statement queries and table mutations are split and checked by hoop.dev guardrails, which refuse banned actions with a native ClickHouse error or hold risky ones for approval. On returned rows, hoop.dev data masking rewrites String and FixedString columns in memory, and the audit trail logs each query and verdict. See the MIT-licensed 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 app keeps the same IDE and Cascade agent features, and old docs links redirect.

How does the Windsurf agent reach a ClickHouse database?

The agent runs commands in a dedicated local shell that loads user variables. It can also use configured Model Context Protocol servers to reach external tools and databases.

What happens if the agent runs a select all query on restricted columns?

ClickHouse refuses a select all query if the user lacks rights on every column by default. The query returns no data at all unless every column in the table is granted.

The query runs. The emails stay hidden.