Give the AI a database user that can only read, keep GateRook's default tool modes, and let every change wait for your approval.
- Create a database user that can only read, limited to the databases or schemas the task needs. GateRook's rules add to the database's permissions; they don't replace them.
- In GateRook, open Connections, select Add connection and choose your database. Enter the host, port, user and password, select Load databases, and tick only the databases your AI may use. Check the connection's environment, and for a remote server choose verified TLS, such as
verify-full. - Select Continue to test the connection, then save it on an endpoint with the default modes:
sql_queryand the other read tools in Read only,sql_executein Approval. - Connect your AI app to that endpoint in AI apps, ask a read question first, and check the call in Activity.
Reads are protected too: on PostgreSQL, MySQL and Oracle they run in read-only transactions and end with a rollback, and the environment caps them at 1,000 rows on dev and stage and 100 on prod.
Two limits remain. Allowed results reach your AI app and may reach its model provider, and an approved change really runs: approval is not rollback, so keep backups. See the PostgreSQL and MySQL guides.