Query guardrails
Each connection’s Query Protection setting controls when TableAI asks you to approve SQL before execution. It covers queries you run and changes you apply from the data grid. Database permissions determine what the connected account is allowed to do.
Set the protection mode
Section titled “Set the protection mode”Choose Query Protection when you create or edit a connection. In an open connection, use the toolbar’s Query Protection control to change the mode. Toolbar changes take effect immediately and are saved for that connection.
| Mode | Before SQL runs |
|---|---|
| No Protection | No query approval prompt. Schema changes made through app controls still require confirmation. |
| Safe Mode | SQL recognized as read-only runs immediately. SQL that changes data or schema, and SQL with unknown effects, requires approval. |
| Confirm All | Every query requires approval, including reads. |
| Password Required | Every query requires the connection’s database password, including reads. |

What requires confirmation
Section titled “What requires confirmation”Safe Mode uses rules for the connected database to check the SQL. Statements such as INSERT, UPDATE, DELETE, ALTER, DROP, and TRUNCATE require approval. SQL that TableAI cannot classify also requires approval.
For a script with several statements, TableAI checks the complete script. A SELECT followed by a DELETE requires approval in Safe Mode.
Schema changes made through app controls always require at least confirmation. This includes creating objects, applying table structure changes, renaming objects, and saving object code. Password Required keeps its password requirement for these actions.
With No Protection, schema SQL that you run directly in the query editor executes without a guardrail prompt.
Review SQL before execution
Section titled “Review SQL before execution”Grid edits, inserted rows, and deletions stay local until you click Apply. Use Preview SQL to inspect them first; the connection’s protection mode applies when you submit them. See edit data safely for staging and discarding edits.
When Query Approval Required appears:
- Check that you are using the intended connection and database.
- Review every SQL statement, including target tables and conditions on updates or deletions.
- Click Execute to approve the operation, or Cancel to stop it before execution.

Approve with a password
Section titled “Approve with a password”In the Password Required prompt, expand View Query to review the SQL. Enter the database password for this connection, then click Execute.
TableAI checks the entered password against the connection’s available password. For Ask Every Time connections, it uses the password held for the current session. An incorrect password or an unavailable password prevents execution.
A connection with no password, such as a password-free SQLite connection, has nothing to verify against. Choose Confirm All if you want approval for every query without a password check. For verification errors, see query blocked by guardrails.
AI queries and consent
Section titled “AI queries and consent”The database agent runs read-only SQL to investigate your question. Its read-only restrictions apply even when the connection uses No Protection. Writes, schema changes, and administrative SQL come back as proposed SQL for you to review. When you run that SQL, the connection’s query protection applies.
Consent for automatic AI previews is a separate setting. Query approval controls execution; preview consent controls automatic reads that can send results to your provider. See what AI sees for those controls.
For account permissions and connection setup, read production databases. To run reviewed SQL, follow write and run SQL.