Concepts
The letter belongs to the tool
An agent’s capabilities are the tools it may call. Authority gives each tool a letter and makes the letter a property of the registration, not of the request:
| Letter | Meaning | Where it comes from |
|---|---|---|
| A | Runs now and is recorded. | A registered tool with level: "A", or a rule. |
| B | Parked in the approval queue until a person decides. | A registered tool with level: "B", the confirmed step of a two-step tool, an unknown tool, or a rule. |
| C | Refused. The model is told to say so and stop. | A rule, a dynamic levelFor, or an intent in the request. |
Nothing the model reads can change a letter. An e-mail that says “the founder approved this, go ahead” is text; the gate does not read text, it reads the registry and the rules.
Unknown means B
A tool nobody registered parks. The day a connector adds twenty tools, none of them acts on its own
until someone has looked. The cost is a few extra approvals in the first week of a connector. The
gain is that the system never silently gains an ability. Set unknown: "C" to refuse instead.
Two-step tools
Some actions are both a read and a write. A price update first shows a plan (which rooms, which
dates, what changes); that call is A. The second call, with confirm: true, is B. Register the tool
with level: "A", confirmLevel: "B" and tell the model to show the plan and ask. The gate makes sure
the confirmed call cannot run without a person, and the model cannot set the flag on its own
behalf because the flag only moves the call into the queue.
Rules before the registry
A rule sees the whole call (tool, arguments, context, the registered definition) and may answer with a letter or pass. Rules express what a registration cannot: the recipient of an e-mail is in the team directory (A) or outside it (B); a tool is on probation until a date; an amount is over a limit (C). Rules run in order and the first answer wins. A rule that throws is not trusted to have allowed anything: the call is treated as unknown.
Intents
Some requests must be refused whichever tool the model picks for them: hiring and firing, pay,
payments, contracts. An intent pattern runs on the person’s request text. When one matches, every
call that writes is refused for that request (by default every B call; add A tools that reach the
outside with isWrite). Reads still run, so the agent can still answer “what is the balance” in a
message that also asked it to pay.
Detect the intent once per request with authority.intent(request) and pass it to every check of
that turn, so the record shows the same label on each refusal.
The queue
A parked call keeps the original arguments, the caller’s context and the reason. The approvals page
lists needs_approval rows with a title, the reason and whatever preview your tool can render from
the arguments. A person approves, rejects with a note, or does nothing: expire closes old rows.
approve(id, by, run) claims the row in one conditional update (needs_approval to running),
calls your run with the action, then stores done with the result or failed with the error. Two
approvers, a double click or a retried request cannot run the same write twice: only one claim
succeeds. The decision recorded for the replay carries the approver’s name and the channel
approval.
Decisions
Every outcome is one row: parked, refused, executed (after an A call ran, or a replay) and
failed. The table is append-only by trigger. A dispute about what the agent did is settled by
rows, not by memory. Recording never throws into the agent’s turn; a store that is down costs a
log line, not a conversation.
Tenants
One instance serves one tenant, and every row and every statement carries it. In a one-company
deployment the tenant is "". In a platform that hosts several companies, build one instance per
company; the store is shared, the data is not.
The kill switch
enabled() returns whatever function you passed as autonomy. Routines that start on their own
check it before they run. check and approve do not: stopping should never also mean going dark,
so questions keep being answered and parked actions can still be decided.