How to Configure Flowise ClickHouse Guardrails

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up flowise clickhouse guardrails by creating strict database roles and column grants. Then you pair those database rules with prompt checks inside your AI app. Many teams start by giving their AI workflow a shared admin login. That broad role lets a bad prompt read private tables or run heavy queries. A safe setup limits what the app user can read from the very start. How to set up flowise clickhouse guardrails in the database Your first step happens inside the ClickHouse server itsel

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 flowise clickhouse guardrails by creating strict database roles and column grants. Then you pair those database rules with prompt checks inside your AI app. Many teams start by giving their AI workflow a shared admin login. That broad role lets a bad prompt read private tables or run heavy queries. A safe setup limits what the app user can read from the very start.

How to set up flowise clickhouse guardrails in the database

Your first step happens inside the ClickHouse server itself. ClickHouse manages users, roles, row policies, settings profiles, and quotas through SQL commands. To turn on SQL access control, you set a storage directory on the server. You also need an admin user who holds the right to manage access. In ClickHouse, a user can only grant privileges that they already hold themselves.

Creating a new user for Flowise requires the create user privilege. During user creation, you set how the account logs in. You can also limit which hosts the Flowise server can connect from. Next, you assign default roles and specific settings to that new account.

Instead of giving full table access, you should grant read rights on safe columns. When you grant select rights on specific columns, the user can only query them. If Flowise tries to select an unapproved column, the database blocks the query. A wildcard select across all columns will also fail and return no data. It only works if the table holds just the columns you allowed. In newer releases, you can also grant read rights across table name prefixes.

Adding workflow checks inside Flowise

Once the database account is locked down, you build the Flowise workflow. Flowise lets you link language models to data sources through visual nodes. To keep queries safe, teams place a check node before the database node. This first node checks the user input for bad intent or prompt tricks.

You should also tell the SQL generator node which tables and columns exist. Give the model a short list of allowed columns in its system prompt. If the model does not know about secret columns, it will not ask for them. If it guesses a restricted column anyway, the ClickHouse column grant stops the query. You can also add a final node to check the answer before sending it.

ClickHouse Access Management + AI Guardrails: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native roles solve and what they miss

Native database roles and column grants stop unauthorized table reads at the source. Host limits also make sure only your Flowise server can use that login. Row policies and quotas help stop a single bad query from reading every row. These native tools decide who can log in and which columns they can touch.

Still, static database grants cannot inspect what happens inside allowed columns in flight. A column might hold support notes that mix plain text with customer emails. If Flowise has read access to that column, the model gets those emails. Static database users also force you to store a long-lived password in Flowise. Also, the database cannot pause a valid query to ask a human for approval. It also does not rewrite sensitive fields like phone numbers or card numbers dynamically.

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

What happens if Flowise runs a select all query on a restricted table?

ClickHouse refuses a wildcard select query if the user lacks rights to every column by default. The query fails and returns no data unless the user holds grants for all columns.

How do I stop Flowise from connecting from an unknown server?

When you run the create user command in ClickHouse, specify the allowed client hosts. The database will reject login attempts from any IP address or host outside that list.

Can a ClickHouse user grant extra permissions to the Flowise account?

A database user can only grant privileges that they already have on their own account. They also need explicit access management rights enabled to change roles or user permissions.

The query runs. The emails stay hidden.