Skip to main content
The default JSONL backend writes each session to a file on the machine that ran it. The PostgreSQL backend keeps every session in one database: agents on several machines record to the same place, rootsign approve can answer a held call from another terminal, and sessions are verified and exported by ID. RootSign needs PostgreSQL 16 with the TimescaleDB extension. Your instrumentation code does not change.

When to switch

Set it up

1

Install the PostgreSQL extra

2

Start a database

start-db runs PostgreSQL 16 with TimescaleDB in Docker, in a container named rootsign-timescaledb:
The data lives in a Docker volume named rootsign_pgdata, so it survives rootsign-admin stop-db --remove. The database is for a laptop: its user and password are both rootsign. To use a database you already run, skip this step and see Use your own database.
3

Create the tables

Run it again after each RootSign upgrade. It brings the tables up to date and leaves an up-to-date database as it is.
4

Switch the backend

Or put ROOTSIGN_BACKEND=postgres in a .env file in the directory you run from. Configuration explains where settings come from.
5

Run your agent

Run the same script as before. The quickstart’s agent.py, unchanged:
The first session registers the agent in the agents table. Later runs with the same agent name and environment reuse it.
6

Verify the session by ID

rootsign export <session_id> builds an evidence bundle from the database the same way.
7

Check what is stored

rootsign-admin status counts the rows in each table:

Use your own database

Point RootSign at any PostgreSQL 16 server with TimescaleDB 2 installed. It reads two connection URLs, one per driver, and both should name the same database:
init turns the TimescaleDB extension on if it is installed but not enabled. On a server without TimescaleDB, init stops with this error and exits 1; the extension is what is missing, even though the hint mentions the server:
In a real deployment, also set ENVIRONMENT=production. RootSign then refuses to start with the default URLs, which point at the laptop database, instead of writing records there. Configuration has this and the connection pool settings.

What changes and what stays

  • Your code stays the same. init(), session(), @rootsign.trace() and wrap_tools() work as they do on JSONL.
  • Commands take a session ID. rootsign verify <session_id> and rootsign export <session_id> read from the database, without --local.
  • Existing JSONL sessions stay in their files. Switching backends does not move them. Verify them with rootsign verify --local <path> as before.
  • Verdicts are the same. Both backends use the same hash formula, so a session verifies the same way in a file or in the database.

If the database cannot be used

  • The tables do not exist. If rootsign-admin init was never run against the database, rootsign.session() raises RecordPersistenceError and the session body does not run. The message names the missing table:
  • The database is down when a session opens. session() raises RecordPersistenceError the same way, chained from the connection error. See Errors.
  • The database fails during a session. A tool call whose record cannot be written still runs and returns its result; RootSign logs a warning. Calls held for approval are the exception: they do not run without a record.
  • The CLI cannot reach it. rootsign verify exits 3 with a one-line error, so an outage never reads as TAMPERED. The CLI reference lists the messages.

rootsign-admin

Every option of start-db, stop-db, init and status.

Require human approval

Hold a tool call until someone approves it from another terminal.