Skip to main content
RootSign is configured with environment variables. Every setting has a default, so a plain pip install rootsign records to local JSONL files with nothing set. This page lists each variable, grouped by what it controls.

How settings are read

Sources. Each variable is read from the environment, then from a .env file in the current working directory, then from its default. An environment variable wins over the same name in .env. The .env file is found from the directory you run the program from, not the directory the script is in. Names are not case-sensitive.
A .env file in your working directory applies to RootSign even if it was written for something else. If a project’s .env sets ROOTSIGN_BACKEND or DATABASE_URL, every RootSign script and command run from that directory uses it.
When they are read. The ROOTSIGN_ settings are read when rootsign.init() runs, and stay fixed for the rest of the process: changing a variable after init() has no effect. Setting one in code before init() works:
Without init(), for example when you build a SessionContext and client yourself, each setting is read when it is used. The database settings are read the first time RootSign connects to PostgreSQL. The CLIs read everything when they start.
Before the release after RootSign 0.3.1, ROOTSIGN_CAPTURE_DECISIONS and ROOTSIGN_REASONING_DEPTH were read when rootsign was imported, so setting them in code after the import was ignored.
Invalid values. A ROOTSIGN_ variable with a value outside its allowed list stops import rootsign with a pydantic ValidationError that names the setting:

Storage backend

jsonl | postgres | cloud
default:"jsonl"
Where records are written.local is a deprecated name for postgres, and prints a FutureWarning. With cloud, RootSign cannot register the agent, because the hosted backend issues agent IDs: pass the ID with rootsign.session(agent_id=...). A session opened without one raises ValueError.
path
default:"~/.rootsign"
The folder for the JSONL backend. Sessions are written to sessions/<session_id>.jsonl inside it, and registered agents to agents.jsonl. It also moves the spool, unless ROOTSIGN_SPOOL_DIR is set.
chain | always | never
default:"chain"
When the JSONL backend forces a write to disk with fsync.

PostgreSQL

These have no ROOTSIGN_ prefix. They apply with ROOTSIGN_BACKEND=postgres, to the rootsign commands that take a session or action ID, and to rootsign-admin.
URL
The database the SDK and the rootsign CLI connect to. Use the postgresql+asyncpg:// form: rootsign[postgres] installs the asyncpg driver. With a plain postgresql:// URL, SQLAlchemy chooses another driver, and the connection fails unless that driver is installed and supports asyncio. The default is the database rootsign-admin start-db creates.
URL
The same database, with the psycopg2 driver. rootsign-admin init and status connect with it. Point it at the same database as DATABASE_URL.
integer
default:"10"
Connections the SDK keeps open to the database.
integer
default:"20"
Extra connections allowed above DB_POOL_SIZE under load.
integer
default:"30"
Seconds to wait for a free connection before failing.
text
default:"development"
Set it to production in a real deployment. RootSign then refuses to use the default database URLs, which point at a local database with the password rootsign, so a deployment that forgot to set DATABASE_URL fails instead of writing to the wrong place. The refusal is a ValidationError raised the first time RootSign reads the database settings: when rootsign-admin starts, or when the SDK first connects.
This is not the agent’s environment, which you pass to rootsign.init(environment=...).

Cloud transport and spool

Preview. The hosted ingest endpoint is not live yet. The spool and rootsign-admin sync --dry-run work today.
URL
default:"https://ingest.getprovidex.com/v1"
The ingest endpoint. Records are posted to <ROOTSIGN_CLOUD_URL>/ingest, so the value ends in /v1, not /v1/ingest.
text
The key sent with each request. Required for rootsign-admin sync to upload anything.
path
default:"$ROOTSIGN_DATA_DIR/spool"
Where records are kept when the endpoint is unreachable. Spooled sessions are ordinary session files, so rootsign verify --local and rootsign export --local read them.
number
default:"10.0"
Timeout for each request.
integer
default:"3"
Attempts per request, including the first. 3 means one send and at most two retries.
warn | fail
default:"warn"
What the cloud transport does when a record can be neither sent nor spooled, for example because the endpoint is down and the disk is full.Approval records never follow this setting: if one cannot be stored, the held tool does not run and HiTLPersistenceError is raised. See Errors.

Decision capture

boolean
default:"false"
Record what the agent decided, and why, before each action. When off, ctx.record_decision() does nothing and returns None, so the same code can run with capture on or off. Off by default because reasoning text is where personal data tends to collect.
minimal | summary | full
default:"summary"
How much of each decision is kept. Ignored when capture is off.

Batching

boolean
default:"false"
Queue records in memory and write them in batches, so tool calls do not wait for each write. Records are still written in order and the chain verifies the same way. The batch is written when the session closes.
number
default:"0.5"
Seconds between background writes of the batch.
integer
default:"100"
Records queued before a write is forced.

Accepted but unused

ROOTSIGN_WAL_PATH, ROOTSIGN_MAX_RETRIES, ROOTSIGN_RETRY_BASE_DELAY and ROOTSIGN_RETRY_MAX_DELAY are still accepted, so an existing .env that sets them keeps loading, but nothing reads them. For retries, use ROOTSIGN_HTTP_MAX_RETRIES.

rootsign-admin

Start the local database, create its tables, and upload the spool.

Errors

Every exception RootSign raises into your code.