How to Configure GitHub Copilot ClickHouse Sandbox
You set up a github copilot clickhouse sandbox by creating a limited database user. Then you give that user read-only rights on safe tables and columns. Teams often pair their coding assistant with a local tool or database connection. When teams skip strict role setup, the assistant uses an admin account. That broad account lets automated queries read or change any table in the cluster. How a github copilot clickhouse sandbox works A coding agent runs queries through local tools or external s
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 github copilot clickhouse sandbox by creating a limited database user. Then you give that user read-only rights on safe tables and columns. Teams often pair their coding assistant with a local tool or database connection. When teams skip strict role setup, the assistant uses an admin account. That broad account lets automated queries read or change any table in the cluster.
How a github copilot clickhouse sandbox works
A coding agent runs queries through local tools or external server integrations. It uses the database credentials that you store on your developer machine. To wall off the database, you build a dedicated user inside ClickHouse. ClickHouse manages users, roles, row policies, settings profiles, and quotas through SQL. Before you make a user, you must turn on SQL access control. This step needs a storage folder on the server and an admin account. A user can only hand out rights that they already hold themselves.
Once SQL control is active, you create an account for the assistant. The user creation step sets the login method and allowed source hosts. It also sets default roles and user settings for that specific account. Next, you grant read rights on specific tables or single columns. When you grant select rights on two columns, the agent reads only those. If the agent runs a query for other columns, the database blocks it. A wildcard select query also fails unless the table holds only granted columns. Starting in version 24.10, a trailing star grants rights by table name prefix.
What native database roles solve and what they miss
Native ClickHouse users and column grants solve the initial login boundary problem. They stop the coding assistant from dropping tables or reading forbidden schemas. Host rules also make sure the account only logs in from approved networks. Quotas and settings profiles help cap how much memory a single user consumes. These controls give your team a solid starting baseline for test databases.
Still, native setup only checks who logs in and which columns they request. It does not inspect what individual queries do while they run in flight. First, a developer must keep a static database password or key on disk. Any local script or agent tool on that machine can read that secret. Second, column grants are an all-or-nothing choice for each column. If an allowed column holds emails or card numbers, queries return them raw. The database does not rewrite matched fields in results for that same column. Third, native database logs tie every action to one shared sandbox user name. When five developers share one sandbox credential, you lose clear user audit trails. You cannot tell which person or prompt triggered a heavy query in flight.
ClickHouse Access Management + GitHub Actions Security: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Managing column rules and local credentials
Maintaining strict column grants across many tables takes steady manual work from engineers. Every time a table schema changes, someone must update the sandbox role grants. Because wildcard queries fail on partial column grants, agents hit frequent query errors. Developers often get tired of fixing broken queries during their daily coding tasks. They end up granting full table read rights just to make the tool work.
Once full table rights are back, sensitive rows flow straight into the editor. Emails, phone numbers, and national IDs enter the prompt context without any filter. A safe setup needs controls that work at the query level in real time. That way, agents can run normal queries while sensitive fields get masked in results.
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
Can I restrict the coding agent to specific ClickHouse columns?
Yes, ClickHouse lets you grant select rights on individual columns in a table. Note that full wildcard queries will fail unless all table columns are granted.
What happens if the agent runs a wildcard query on restricted columns?
ClickHouse refuses the wildcard query and returns no data at all to the client. The agent must name only the allowed columns in its select statement.
Why is a read-only database user not enough for AI coding tools?
A read-only user still leaves static credentials on the developer laptop for tools. It also returns raw emails, phone numbers, and card numbers from allowed columns.
Related guides
In this post