PostgreSQL

PostgreSQL

Connect a Postgres database for agents to read its tables, run queries and write rows.

Agents work with the database as the user you connect it with, and every request runs in the database live; nothing is copied. Neon, Supabase, Render, Timescale and CockroachDB all speak Postgres and connect the same way.

Connect a database

Make a database user for the connection

Make a user with only the access agents should have, so the database holds the line whatever is ticked in Personal Agent Proxy. For reading, a user that can only read:

CREATE USER agent_reader WITH PASSWORD '…';
GRANT CONNECT ON DATABASE app TO agent_reader;
GRANT USAGE ON SCHEMA public TO agent_reader;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO agent_reader;

Fill in the form

Open Connections and permissions, then Add connection, and Connect a database beside PostgreSQL. Type in the host and port, the database, the user and its password, and choose the encryption: a managed database has a certificate for its host, which is verified; a self-signed one needs "any certificate". Test connection signs in without saving anything.

The database has to be reachable from the internet. Hosted Personal Agent Proxy refuses hosts on private addresses, such as 10.0.0.7 or localhost; a database on one needs Personal Agent Proxy self-hosted beside it, with ALLOW_PRIVATE_HOSTS set.

Review the defaults

A new connection gives every agent Read tables and Run queries. Add rows, Edit rows and Delete rows are off by default. Turn them on for every agent on the connection's page, or only for one agent on the agent's page. The same database can be connected again as another user, such as one that may write.

What agents can do

  • Read tables lists the tables and views the user can read, with their columns, and opens each table's rows, newest first by primary key, 50 to a page, searching for words in any column. A row reads as one column: value line per column; a value that reads empty is NULL.
  • Run queries runs one statement that reads, SELECT, WITH, SHOW, EXPLAIN, TABLE or VALUES, in a read-only transaction with a 30 second limit, and answers up to 200 rows as one JSON object a line. A semicolon anywhere but at the end, even in a string, or a statement that writes, is refused before it reaches the database.
  • Add rows inserts a row into a table, from the column: value lines written; a column left out takes its default.
  • Edit rows changes the columns written differently from how they read, and sets one written empty to NULL. It requires Read tables.
  • Delete rows deletes a row for good. It requires Read tables.

Rows are found again by their primary key, so a table without one is read and never written to. Values are written the way they read: a date as 2026-01-02, a timestamp as 2026-01-02T10:00:00.000Z, JSON as JSON. The database checks each value against its column and turns down what doesn't fit, and its own words come back to the agent.