How to Configure Windsurf ClickHouse Prevent Delete
To set up a windsurf clickhouse prevent delete rule, create a read-only database role. Then make your coding agent log in with that scoped user account. Many teams give their AI coding tools full database admin keys to move fast. When an agent shares a broad role, one bad prompt can drop live data. A dedicated user role stops the agent from running destructive table mutations. How to set up a windsurf clickhouse prevent delete role First, note that Cognition renamed Windsurf to Devin Desktop
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 prevent delete rule, create a read-only database role. Then make your coding agent log in with that scoped user account. Many teams give their AI coding tools full database admin keys to move fast. When an agent shares a broad role, one bad prompt can drop live data. A dedicated user role stops the agent from running destructive table mutations.
How to set up a windsurf clickhouse prevent delete role
First, note that Cognition renamed Windsurf to Devin Desktop in June 2026. The desktop app keeps the same features and uses the Cascade agent. This agent can run terminal commands on its own after you give permission. It opens a dedicated shell on macOS or Linux and loads your shell variables. It can also reach external tools through Model Context Protocol servers.
Because the shell loads local keys, the agent inherits your database login. To block data removal, you must set up SQL-driven access control in ClickHouse. This setup needs a storage folder on the server and an admin user. Once turned on, you can manage users, roles, and settings profiles with SQL. A database user can only grant rights that they already hold themselves.
You can create a new user account just for your coding agent. When you make the user, you set the login method and allowed host. You also attach default roles and specific user settings to that account. To prevent delete actions, grant only read privileges on the target tables. You can even grant read rights on specific columns rather than full tables. If a user only has rights on two columns, full table queries fail. You can also use a trailing asterisk to grant read rights by table prefix.
What native database roles solve and what stays exposed
Native ClickHouse roles work well to block table drops and row deletes at login. If the agent tries to remove data, the database rejects the command right away. Column grants also keep the agent away from columns it does not need. This gives your team a strong baseline for daily coding tasks.
Still, static database roles only check who logs in at the start. They do not inspect what individual statements do while a session runs. First, the agent still needs a static key stored on the local machine. Anyone or any script on that laptop can read the shell variables. Second, an engineer might need temporary write rights to fix a bug. Switching between a read-only agent key and a write key takes manual work. Most devs end up leaving the broad key in their shell profile.
ClickHouse Access Management + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Third, column grants are all-or-nothing and cannot mask sensitive text inside allowed columns. If the agent reads a customer table, raw emails or phone numbers enter the prompt. Native roles cannot rewrite card numbers or national IDs in query results on the fly. Finally, native roles do not pause a single risky command for human approval.
Why terminal agents need command-level checks
AI coding agents work fast and run many shell commands in a row. While the desktop app asks for user permission, humans get tired of clicking approve. It is easy to miss a destructive query buried inside a long script. When you pair native roles with runtime checks, you close this operational gap. You can inspect each query, mask sensitive fields, and block deletes without changing keys.
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 Cascade agent reach my ClickHouse database?
The agent runs commands in a dedicated shell that loads your local profile. It can use your saved database keys or talk to a configured MCP server.
Can ClickHouse block deletes while allowing reads on specific columns?
Yes, you can grant read rights on named columns only and leave out delete rights. Note that queries asking for all columns will fail unless all columns are granted.
Why are static read-only users not enough for AI coding agents?
Static users still leave plain keys on disk and cannot rewrite sensitive fields in results. They also force developers to swap keys whenever a task needs a safe write.
Related guides
In this post