Skip to the content.

Authority

The authority gate for AI agents: A acts, B waits for a person, C is refused. Decided in code, recorded in Postgres.

CI npm License: MIT

An agent that can send e-mail, move money or change a price needs a rule that does not depend on how well it was asked. Authority puts a letter on every tool: A tools act and are recorded, B tools park in an approval queue until a person decides, C calls are refused whatever the wording. A tool nobody registered is B. Two tables in your Postgres hold the queue and an append-only record of every decision.

import { createAuthority, sqlStore } from "@solustiq/authority"
import { pgAdapter } from "@solustiq/authority/pg"

const authority = createAuthority({
  store: sqlStore({ db: pgAdapter(pool) }),
  tools: [
    { name: "read_report", level: "A" },
    { name: "update_price", level: "A", confirmLevel: "B" },
    { name: "create_payment_link", level: "B" },
  ],
})

const gate = await authority.check({ tool: "create_payment_link", args: { amount: 120 }, ctx: { agentId: "betty", channel: "chat" } })
// gate.allow === false, gate.level === "B": parked; hand gate.message to the model

await authority.actions.approve(gate.actionId!, "alice@acme.example", (action) => createLink(action.args))

Built and maintained by Solustiq for Skilled Agents deployments. The design is written up in The authority model. Pairs with @solustiq/steady for routines that wait days for an approval.