Skip to main content
On Team and Ultimate, a project can connect PostgreSQL databases for its agents to read: logs, metrics, product data. Hookie runs every query read-only, inside limits, and keeps an audit of each one.

Make a login for Hookie

Create a PostgreSQL login that can only read, and grant it SELECT on the schemas agents should see:
Hookie refuses a login that can write: a superuser, a role that can create roles or databases, or one with INSERT, UPDATE, DELETE, TRUNCATE or CREATE on anything it can see. The database must be reachable on a public host over TLS.

Connect a database

  1. Open the project and choose Sources, then Databases.
  2. Choose Connect a database.
  3. Give it a name, paste the connection string (postgres://user:password@host:5432/db), and choose the schemas agents may read and the columns to mask.
  4. Choose Connect.
Hookie checks the login, stores the connection string encrypted and never shows it again. Workspace owners and admins and the project’s project admins connect databases; connected agents cannot.

How a query runs

Each query is checked and run in layers, and any one of them refuses it on its own:
  1. The login must be read-only, checked when you connect and before every query.
  2. The query runs in a READ ONLY transaction with a statement timeout.
  3. Only one statement is allowed, and only SELECT, WITH, TABLE, VALUES, EXPLAIN (without ANALYZE) and SHOW. Row locks and functions that reach outside the tables are refused.
  4. Rows and bytes stop at the plan’s caps, and the answer says when it was cut.
  5. Masked columns come back as [masked].
Every query, including refused ones, is recorded in the database’s Query audit: who ran it, the agent, the statement, the outcome and how long it took. Workspace owners and admins set how long the audit is kept under Policies.

For agents

Developers and above may describe and query. Values come from your database: agents are told to treat them as data, never as instructions.