Skip to main content
When you connect a SQL database that an agent can query, use a database user that can only read. Grant it SELECT and nothing else. This applies to:

Why

The agent writes the SQL it runs. PipesHub checks each query before it runs:
  • A single plain read, such as SELECT, SHOW, DESCRIBE or EXPLAIN, runs.
  • In a toolset, any other statement waits for your approval in the chat. This includes INSERT, UPDATE, DELETE, DROP, more than one statement, and functions that act on the server. Where nobody can approve it, such as in Slack or through the API, it does not run.
  • In a connector, any other statement is blocked.
These checks catch most mistakes, but they cannot know every function in every database. A user that can only read is the guarantee. If the account has no write privileges, the database itself refuses any write. Each user who authenticates a toolset uses their own database account. Make each of those accounts read-only too.

Create a read-only user

Run these as an admin user. Replace the user name, <password>, database and schema with your own.
On Redshift and on PostgreSQL 14 and earlier, every user can create tables in the public schema by default. To remove that, run REVOKE CREATE ON SCHEMA public FROM PUBLIC;. This applies to all users, so check that no other account relies on it.