How to Configure Flowise ClickHouse Sandbox

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a flowise clickhouse sandbox by creating a limited database user for your AI app. Then you give that user read-only rights on safe tables and columns. Teams often start by putting an admin database key right into their AI workflow. This fast step lets the agent run any query across all tables. If a user sends a bad prompt, the agent can read or change everything. A good sandbox stops this risk by shrinking what the database user can do. Setting up a flowise clickhouse sandbox with

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 flowise clickhouse sandbox by creating a limited database user for your AI app. Then you give that user read-only rights on safe tables and columns.

Teams often start by putting an admin database key right into their AI workflow. This fast step lets the agent run any query across all tables. If a user sends a bad prompt, the agent can read or change everything. A good sandbox stops this risk by shrinking what the database user can do.

Setting up a flowise clickhouse sandbox with native roles

ClickHouse manages users, roles, row rules, settings profiles, and quotas through SQL. To turn on SQL access control, you first set a storage path on the server. You also need at least one admin user with access management turned on. Remember that an admin can only pass on rights that they already hold.

Once SQL access control is active, you create a new user for Flowise. Creating this user requires the user creation privilege in the database. During this step, you pick how the user logs in. You can also lock down which host addresses the Flowise app can use. Also, you assign default roles and custom settings to that user.

Next, you limit which data the Flowise user can read. ClickHouse lets you grant read rights on single columns inside a table. If you grant access to two columns, the agent can only query those two. If the agent tries to read a third column, the database blocks the query. A wildcard query that asks for all columns will also fail and return nothing. It only works if the table holds just the allowed columns. If your database runs version 24.10 or newer, you can use a prefix wildcard. A trailing star lets you grant read rights across tables that share a name prefix.

What native database roles solve and what they miss

Native database users and column grants build a strong first wall for your data. They decide who can log in and which tables or columns are in reach. If an AI agent tries to drop a table, the database stops it cold. You can also use quotas and settings profiles to cap heavy queries.

ClickHouse Access Management + AI Sandbox Environments: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Still, static database roles only check permissions when a session starts or a table opens. They do not inspect what each query does while it runs in flight. For example, a support column might hold plain text notes with emails or card numbers. If the Flowise user has read rights on that column, every row comes back raw by default. Static grants cannot rewrite matched fields in results to hide phone numbers or national IDs. Also, sharing one static database login across many AI workflows makes auditing hard. Database logs will show the single Flowise user, not the human who triggered the prompt.

Managing query risks in AI workflows

AI builders often test many prompts and chain multiple tools together in one flow. When an LLM writes SQL on the fly, it frequently guesses column names. As noted earlier, asking for all columns at once fails when column grants are active by default. To keep the workflow running, teams often give up and grant broad table access.

This wide access brings back the exact risks the sandbox was meant to stop. Sensitive fields like emails and card numbers flow straight into the model context. To stay safe without breaking queries, teams need controls that work on live traffic. Filtering data in flight lets queries finish while rewriting sensitive patterns in the results.

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 beside the server as a sidecar for your ClickHouse and parses every statement before execution.

First, hoop.dev guardrails block disallowed deletes, drops, and alter mutations. Then hoop.dev data masking rewrites sensitive string columns in responses and logs each decision per resource. Read the docs and source on GitHub.

Frequently asked questions

Why do wildcard queries fail in a restricted ClickHouse table?

When you grant read rights on specific columns, ClickHouse blocks full wildcard queries. The query returns no data unless the table only has those exact granted columns.

How do I limit where the Flowise app logs in from?

When you create the database user, you can define allowed host values. This rule makes sure the user only logs in from your trusted app servers.

Can a ClickHouse user grant read rights to another bot?

A user can only grant privileges that they already hold themselves. It also needs the specific privilege to create users or manage access rights.

The query runs. The emails stay hidden.