How to Configure Goose ClickHouse Prevent Delete
You set up a goose clickhouse prevent delete workflow by giving the AI agent a restricted database role. This role allows read queries or safe inserts while leaving out delete permissions. Teams often connect AI agents to analytics databases with broad admin accounts to move fast. Those wide accounts let a bad prompt wipe out whole tables in seconds. Scoping down the database user stops the agent from running destructive statements. How to set up goose clickhouse prevent delete in the database
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 a goose clickhouse prevent delete workflow by giving the AI agent a restricted database role. This role allows read queries or safe inserts while leaving out delete permissions. Teams often connect AI agents to analytics databases with broad admin accounts to move fast. Those wide accounts let a bad prompt wipe out whole tables in seconds. Scoping down the database user stops the agent from running destructive statements.
How to set up goose clickhouse prevent delete in the database
ClickHouse manages users, roles, row policies, settings profiles, and quotas as access entities through SQL. To turn on SQL access control, an admin sets a storage directory on the server. At least one admin account needs access management rights turned on first. That admin can only grant privileges that they already hold themselves.
To lock down the agent, the admin creates a dedicated user and role for Goose. Making a new user requires the create user privilege in the database. During user creation, the admin sets the login method, allowed client hosts, and default roles. The admin can also attach user settings profiles right to that account.
Next, the admin grants read permissions and leaves out delete and drop privileges. You can even grant read rights on specific columns in a table. When a user only has column grants, the database blocks full table wildcard reads. Full wildcard queries return no data unless the table holds only those allowed columns. Admins can also use a trailing asterisk to grant rights by table name prefix.
Why native roles are only half the fix
Static database roles work well when an agent only needs to read public tables. They block destructive commands at the database engine level before data is lost. Still, static roles create friction when Goose needs to run maintenance or mixed tasks. Teams often end up sharing one database login across many developers and local agents.
Database roles decide who can log in and which tables they can touch. They do not inspect what individual statements do in flight based on runtime context. If an agent holds write access to fix one row, it can alter every row. Also, column grants fail completely when an agent runs a broad wildcard query. If a table holds emails, phone numbers, card numbers, or national IDs, static roles block the query instead of rewriting matched fields in results.
ClickHouse Access Management + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Managing agent queries and data exposure in flight
Modern engineering teams need more than static user accounts for AI tools. You need to tie every agent query back to the human running the session. Instead of putting static database passwords on developer laptops, teams should remove local secrets.
Runtime controls let you check each SQL statement before it hits the database engine. You can block delete mutations on the fly or require a quick human approval. At the same time, data masking rewrites matched fields in results so emails and card numbers stay safe.
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. It reads ClickHouse's native TCP protocol before queries run while ClickHouse stays in charge of login and grants.
Multi-statement queries and table mutations are split and checked by hoop.dev guardrails. Banned actions are refused with a native ClickHouse error. On returned rows, hoop.dev data masking rewrites String and FixedString columns that match your rules. The audit trail logs each query, table, and verdict. See the MIT-licensed source on GitHub.
Frequently asked questions
How does ClickHouse handle read grants on specific columns?
Admins can grant read access to named columns on a specific database table. The user can then query only those exact columns. The database refuses wildcard queries unless the table contains only the granted columns.
What is needed to manage ClickHouse users with SQL?
You must configure the access control storage directory on the database server. You also need an initial user account with access management rights enabled. Remember that a user can only grant privileges that they already hold.
Why do AI agents like Goose need extra database guardrails?
AI agents generate and run SQL queries on their own based on text prompts. If a prompt is unclear, the agent might build a delete statement by mistake. Removing delete rights and checking queries in flight keeps production tables safe.
Related guides
In this post