Skip to main content

SQL Access

SQL Access lets you decide, per project role, what agents may do in the SQL databases your project is connected to (Oracle, Microsoft SQL Server, PostgreSQL, MySQL, Snowflake, Databricks, Hadoop/Hive and generic connections). Rules are independent of the database account's own privileges: the connection can keep one service account, while each user's agent turns are limited to what their role allows.

For every table you choose which of these operations a role may perform:

OperationWhat it allows
ReadSELECT from the table. Can be limited to specific columns.
InsertINSERT rows. Can be limited to specific columns.
UpdateUPDATE rows. Can be limited to specific columns.
DeleteDELETE rows (always the whole row).
AlterCREATE, ALTER, DROP and TRUNCATE on the table, including the add/modify/drop column tools.

You can also allow a role to execute specific stored procedures and functions. Anything not ticked is denied.

Who the rules apply to​

Rules follow the person an agent is working for, wherever the agent runs: chat, the public API, workflows, scheduled runs, Interface dashboards, sub-agents and tool approval cards.

CallerRules applied
Signed-in user, user API key, MCP clientThe user's role in the project.
Project owner, built-in Admin role, platform administratorsFull access (not restricted).
Project API key bound to a roleThat role.
Slack sender linked to an EKB accountThe linked user's role.
Workflow runThe user who started it; scheduled and webhook runs use the workflow's creator.
Anonymous widget visitors, unlinked Slack senders, Teams and Google Chat senders, A2A clients, project API keys without a roleThe connection's default rule.

Members who reach the project only through team sharing hold no project role and also get the default rule.

Turning access control on​

  1. Navigate to Settings → SQL Access. You can also open a SQL connection from Knowledge Base → Connections and select the shield icon.
  2. Pick the Connection.
  3. Choose what Roles without a rule get: No access or Read-only on all tables.
  4. Switch Access control on.

Until access control is switched on, nothing changes: agents can run anything the database account allows. You can prepare role rules first and switch control on when they are ready.

Giving a role a rule​

  1. Select Add role rule and pick the role. The Admin role is not listed because it always has full access.
  2. Tick the operations the role may perform on each table. Read-only on all tables and Clear all set every table at once.
  3. To limit reads or writes to some columns, expand the table, tick Limit … to specific columns, then untick the columns the role must not use.
  4. Under Stored procedures and functions, tick the routines the role may execute.
  5. Select Save rule.

The editor reads the tables, columns and routines from the database. If the schema changes, select Refresh schema.

How statements are checked​

Every statement an agent sends is parsed before it reaches the database, and it is refused unless every part of it is allowed:

  • A column that is read anywhere (the select list, WHERE, JOIN, GROUP BY, ORDER BY, RETURNING or the right-hand side of SET) needs Read on that column. A role that may update EMAIL but not read SALARY cannot run UPDATE employees SET email = '…' WHERE salary > 1000.
  • SELECT * is refused on a table with restricted columns; the agent is told which columns it may name.
  • An INSERT without a column list counts as writing every column.
  • MERGE needs the matching insert, update and delete permissions.
  • Calling a procedure (CALL, EXEC) or a user-defined function inside a query needs Execute on that routine. A function the platform cannot confirm as a database built-in is treated as user-defined, including one in another schema on the search path.
  • Always refused on an access-controlled connection: statements that cannot be parsed, anonymous PL/SQL or T-SQL blocks, dynamic SQL (EXECUTE IMMEDIATE, sp_executesql), system catalogs (information_schema, ALL_…/DBA_… views, pg_catalog, sys.), GRANT/REVOKE, and session changes such as ALTER SESSION or USE.

Agents also see only what the role allows: hidden tables are left out of the table list, hidden columns are left out of table schemas and sample rows, and the agent's instructions describe the role's access. Tools the role could never use (for example Delete Rows for a read-only role) are not offered to the agent at all.

To call stored procedures safely, enable the Execute Procedure / Function tool in the agent's Database toolkit. It passes values as bound parameters and returns OUT parameters, function return values and result sets.

Testing a query​

Use Test a query at the bottom of the page to check a statement as any role, or as the connection default. Nothing is executed; you see whether it would be allowed and, if not, why.

Logs​

Every refused statement is recorded in the project's access logs with the user, role, connection and statement. Changes to SQL access settings and rules are recorded in Settings → Logs.

Permissions​

Viewing SQL Access requires the Roles → View permission. Changing settings or rules requires Roles → Edit.

Interface dashboards​

Chart and number widgets that query an access-controlled connection run with the viewing user's rules. A viewer whose role cannot read the queried columns sees an access-restricted message instead of the data. Published interfaces viewed anonymously use the connection's default rule.