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:
| Operation | What it allows |
|---|---|
| Read | SELECT from the table. Can be limited to specific columns. |
| Insert | INSERT rows. Can be limited to specific columns. |
| Update | UPDATE rows. Can be limited to specific columns. |
| Delete | DELETE rows (always the whole row). |
| Alter | CREATE, 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.
| Caller | Rules applied |
|---|---|
| Signed-in user, user API key, MCP client | The user's role in the project. |
| Project owner, built-in Admin role, platform administrators | Full access (not restricted). |
| Project API key bound to a role | That role. |
| Slack sender linked to an EKB account | The linked user's role. |
| Workflow run | The 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 role | The 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
- Navigate to Settings → SQL Access. You can also open a SQL connection from Knowledge Base → Connections and select the shield icon.
- Pick the Connection.
- Choose what Roles without a rule get: No access or Read-only on all tables.
- 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
- Select Add role rule and pick the role. The Admin role is not listed because it always has full access.
- Tick the operations the role may perform on each table. Read-only on all tables and Clear all set every table at once.
- 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.
- Under Stored procedures and functions, tick the routines the role may execute.
- 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,RETURNINGor the right-hand side ofSET) needs Read on that column. A role that may updateEMAILbut not readSALARYcannot runUPDATE 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
INSERTwithout a column list counts as writing every column. MERGEneeds 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 asALTER SESSIONorUSE.
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.