Skip to main content
Give the agent its own account, with SELECT and nothing else. The agent checks this itself on your machine, every time it starts. If the account can write anywhere in the database, the agent stops with an error and serves nothing.

PostgreSQL

Run as an administrator. Replace app with your database name.
To expose more schemas, repeat the last three lines for each one:
ALTER DEFAULT PRIVILEGES covers tables created later by the role that runs it. If another role creates your tables, add FOR ROLE <that_role> after ALTER DEFAULT PRIVILEGES.
Concatflow only offers the schemas this account can read. A schema without USAGE, or without a single readable table, does not appear.

MariaDB and MySQL

In MariaDB and MySQL, each database is a schema. Grant SELECT on each one you want to expose:
Replace '%' with the address the agent connects from if you want to restrict it.
On MySQL 8, agent 0.1.0 cannot log in with the default caching_sha2_password plugin. See MySQL 8 authentication fails.

What the agent checks

The check covers the whole database, not only the schemas you expose. An account that can write to a table you never expose can still write.
The agent refuses the account if:
  • it is a superuser;
  • it has INSERT, UPDATE, DELETE or TRUNCATE on any table outside the system catalogs;
  • on PostgreSQL 15 and later, it has CREATE on any schema.
PostgreSQL 14 and earlier grant CREATE on public to every role by default, so the agent skips the CREATE check there. Revoke it yourself if you can: REVOKE CREATE ON SCHEMA public FROM PUBLIC;
When the check fails, the agent logs the reason and exits with code 1:
Fix the grants, then start the agent again. It keeps its enrollment, so you do not need a new token.