Skip to the content.

Security

Authority decides what an agent may do and keeps the record. This page lists the threats it is designed against, the control for each, and what remains your responsibility. To report a vulnerability, follow SECURITY.md.

Threat model

Threat Control
The model talks its way into a write Letters are in the registry and rules; the gate never reads the model’s text for permission
A message the model reads carries an instruction Intents refuse writing calls for the request; the gate decides in code
A new tool acts before anyone looked at it Unknown tools are B
Two approvers run the same write twice approve claims with one conditional update; only one claim succeeds
A parked call is replayed with changed arguments The queue stores the original arguments; run receives them unchanged
The record of what happened is rewritten The decisions table refuses UPDATE and DELETE by trigger
One company sees another’s queue Every statement filters on the tenant; one instance per tenant
SQL injection through tool names or arguments Every value is a bound parameter; identifiers are constants; a static test checks it
A store outage lets a call through A store failure is a failed decision and a refusal message, never an allow
A rule throws and allows by accident A throwing rule is treated as “unknown”: the call parks

What stays yours

Parameterised SQL

All values are bound parameters; identifiers are constants in the source. JSON is sent as text and cast in SQL. A static test fails the build if a SQL template interpolates anything but the two constant column lists, or if a statement does not filter on the tenant.

Append-only decisions

sql/authority.sql installs a trigger that raises on UPDATE and DELETE of authority_decisions. A correction is a new row. If you need retention limits, partition or archive by created_at with a role that bypasses the trigger; the library never does.

Supply chain

The package has no runtime dependencies. Drivers (pg, postgres, @neondatabase/serverless) are optional peers you install yourself. CI runs typecheck, lint, build and the tests on Node 20 and 22 against Postgres 16.