Try Authority with a scripted agent

Run seven scenarios on your own machine in 10 to 15 minutes, mostly reading: no account, no API key, no database, no LLM. A scripted agent proposes tool calls, a sandbox tool only appends to an in-memory list, and Authority Graph sits between them.

Status: Experimental · V1 under construction. Not independently reviewed or audited. Written against the authority-graph commit 5639710; the source remains authoritative.

Run it

You need git and Node.js 20 or 22. Installing the dependencies (npm ci) needs a network; the demo itself makes no network call. Nothing is published to npm: you clone the repository.

git clone https://github.com/theoadam2506-rgb/authority-graph.git
cd authority-graph
git checkout 56397103c6b0773053ca3039eb6b9a206ad2429e
npm ci
npm run demo:agent

The git checkout line pins the exact commit this page was written against, so that you see what is described here. The output is deterministic (fixed clock and ids), and the script checks every expectation itself: it exits with an error if one fails.

The setup

A human, alice, delegates to procurement-agent the right to create purchase orders: up to 2,000 EUR on its own, up to 5,000 EUR with a human approval, nothing above, until the end of 2026. The demo uses only the public entry point of the experimental SDK (not published to npm) and its typed event builders, the same imports an outside project has.

The seven scenarios

What the agent tries, and what Authority does
ScenarioWhat the agent triesWhat Authority does
1. AuthorizationAn allowed call; a capability that was never delegated; a delegation that is not its own; 9,000 EUR.The first runs once. The others are DENIED with a fixed reason, and the tool never runs.
2. Human approval3,500 EUR, above the automatic limit. Then the agent approves its own request.REQUIRES_APPROVAL: blocked. The self-approval is refused by the engine. Alice's approval of that exact action lets it run once; a second action of the same size is blocked again.
3. Single-use ticketRedeem the same ticket twice.The second redemption is ALREADY_REDEEMED, and guard on the same action runs nothing.
4. Substituted argumentsAfter authorization, change the amount, the recipient, the tool arguments or the action id.ARGUMENTS_MISMATCH or ACTION_ID_MISMATCH: refused. The ticket is not consumed, so the unchanged call still works.
5. RevocationA ticket is issued, then Alice revokes the delegation.Redemption is refused with AUTHORITY_NO_LONGER_VALID and new actions are DENIED. The agent cannot revoke its own delegation.
6. One ticket per action (I32)Ask again for the same action, after redemption and expiry, or with other arguments. Then a deliberate attempt to write a second ticket by hand.The same ticket every time; reuse under other arguments is DENIED; the hand-written second ticket is refused at ingestion (BUSINESS_ID_COLLISION). The journal holds one ticket.
7. Uncertain outcomeThe redemption's acknowledgement is lost. Or the target system receives the call and completes it, and its reply is lost.UNKNOWN_OUTCOME: the tool does not run. Or EFFECT_FAILED: the ticket is consumed, one attempt reached the target with its idempotency key, nothing is retried, and the journal never says EXECUTED.

Four orders are placed and confirmed in total. The fifth call that reached the target, in scenario 7, has no confirmed result and is listed apart.

What EFFECT_FAILED means

EFFECT_FAILED describes the result the experimental SDK observed: no result came back. It is not proof that the external effect did not happen. In the demo it did happen, and neither Authority nor the demo's guard can know. The result is never called a success and the call is never retried. Reconciling with the target system, with the idempotency key, is for whoever holds the key.

Limits of this demo

  • The agent is scripted. The demo shows the guard, not how an agent reasons, and it proves nothing about prompt injection.
  • Memory only: everything is lost when the process ends. The PostgreSQL backend exists and is tested separately; the demo does not use it.
  • Identities are asserted by your code. Authority does not authenticate them: anyone who can call Authority as alice can approve.
  • No guarantee that an external effect runs exactly once. Authority bounds authorization (one successful redemption per ticket) and never performs the action; only your target system can deduplicate or confirm it.
  • Scenario 6 exercises one of the four layers of I32 (ingestion, on the in-memory backend). The other layers are covered by the engine's own test suites, not by this demo. The as never cast used to write the second ticket is a deliberate bypass of the typed builders to test validation, not a pattern to use.
  • The SDK is experimental, not published to npm and not independently reviewed. Nothing here is audited or certified, and no security guarantee is claimed. Do not use it for real payments.

Try it and tell us

If you are a developer, we would like you to try it and say what was unclear, what broke and what is missing. Useful feedback: a scenario you could not follow, a result that surprised you, a case you would add. The way to do it today is to open an issue on the project's GitHub repository; there is no form on this site, and this page collects nothing. To add a scenario, read the contribution guide.

Sources at the pinned commit