# Mandates and policy

How an owner's signed spending rules become one deterministic decision per purchase, in a fixed order, with a reason code an agent can act on.

<ShortProductTruth>**A card number was never a permission.** In Abazi, what an agent may buy lives in a mandate the owner signs with a passkey, and a policy engine with no language model in it applies that mandate to every purchase, the same way every time.</ShortProductTruth>

## What a mandate is [#what-a-mandate-is]

A mandate is a versioned set of spending rules for one agent or a group of agents. The owner writes it in the Console, can try a purchase against the draft (the simulation runs the same engine, reserves nothing and sends nothing), and signs it with a passkey. Mandates are issued in AP2 v0.2 format: the rules are serialized as canonical JSON, and the signature slot holds the owner's WebAuthn passkey assertion over that payload. Abazi builds and verifies these mandates itself.

A mandate says, among other things:

| Field | What it limits |
| --- | --- |
| Per-purchase hard cap | The most any single purchase may cost. Above it, the answer is always DENY. |
| Auto-approve limit | Up to this amount the agent buys alone. Above it, a person approves. |
| Rails, networks and assets | Which ways of paying are allowed: stablecoins over x402, direct USDT, virtual cards, and on which networks. |
| Categories | Which kinds of services the agent may buy. |
| Merchant tiers | Whether the agent may pay unknown merchants at all. |
| Expiry | When the rules stop working. A new version must be signed. |

The agent never holds the mandate and cannot edit it. It holds only an Abazi agent credential, which identifies it; the credential carries no spending power on its own.

## How a decision is made [#how-a-decision-is-made]

Before any money moves, Abazi gathers the facts about one purchase (the agent and its mandate, the rail, network, asset, category, the merchant's tier, the price quoted from the Catalog, Shield's checks, the budgets left and whether a network has funds) and passes them to the policy engine. The engine is a pure function: the same input always gives the same decision, with no clock, no network call and no model.

It checks its rules in a fixed order. **The first step that hits decides.**

<EvaluationOrder />

- Steps 0 to 4b can only deny. Steps 5 to 7 can only ask a person. Step 8 allows.
- If anything unexpected happens, step 9 fails closed: the purchase is denied with <ReasonCode code="POLICY_UNKNOWN_CASE" />.
- Every decision is stored with its reason code and a trace: one line per step, marked pass, hit or skip.

Try it with your own inputs. The explorer runs the same order with the example mandate's limits:

<PolicyExplorer />

## Thresholds and limits are different things [#thresholds-and-limits-are-different-things]

**Turn autonomy up. Never turn limits off.** The auto-approve limit is a threshold: the owner can raise it to let the agent do more alone. The hard cap and the budgets are limits: no approval can lift them.

When a person approves a purchase, the engine runs again with the approval attached. The three "ask a person" steps (Shield review rules, the unknown-merchant limit and the auto-approve limit) then pass as approved by the owner, but every deny step still runs. An approval cannot turn a DENY into a payment.

**The lower limit wins.** An organization can also set default limits. At the hard cap step and the auto-approve step, the engine uses the lower of the mandate's value and the organization default, and the trace records which one applied.

**No model decides.** Shield's prompt-injection classifier scores the purchase text and feeds steps 3 and 5 as an input. The decision itself is plain code.

## Example [#example]

The example mandate uses these limits: hard cap <Limit name="hardCap" />, auto-approve <Limit name="autoThreshold" />, unknown-merchant limit <Limit name="unknownMerchantLimit" />.

| Purchase | First step that hits | Decision |
| --- | --- | --- |
| A verified merchant's service, below the auto-approve limit | none | ALLOW <ReasonCode code="WITHIN_POLICY" /> |
| The same service, above the auto-approve limit and below the hard cap | 7 | REQUIRE APPROVAL <ReasonCode code="ABOVE_AUTO_THRESHOLD" /> |
| An unknown merchant, above the unknown-merchant limit | 6 | REQUIRE APPROVAL <ReasonCode code="UNKNOWN_MERCHANT_LIMIT" /> |
| Any purchase above the hard cap | 4 | DENY <ReasonCode code="HARD_CAP_EXCEEDED" /> |
| The merchant's 402 asks to be paid at a different address than its Catalog listing | 2 | DENY <ReasonCode code="PAYTO_MISMATCH" /> |
| Text in the purchase looks like an injected instruction | 3 | DENY <ReasonCode code="INJECTION_FLAG" /> |

<Screenshot id="console-payment-detail" />

## Failure cases [#failure-cases]

| Situation | What happens |
| --- | --- |
| The mandate expired or was revoked | DENY <ReasonCode code="MANDATE_EXPIRED" /> or <ReasonCode code="MANDATE_REVOKED" />. The agent should stop. |
| The budget left is too small | DENY <ReasonCode code="BUDGET_EXCEEDED" />. The agent can check its spending status. |
| The owner paused all payments | DENY <ReasonCode code="KILL_SWITCH_ACTIVE" />. Nothing is signed until payments resume. |
| A person approves a purchase that later hits a deny step | The purchase is still denied. Approvals only clear steps 5 to 7. |

Every code, with what the owner sees and what the agent should do, is in the [reason code reference](/docs/api/errors-and-reason-codes).

## Next steps [#next-steps]

<Cards>
  <Card title="Write a mandate" href="/docs/guides/write-a-mandate" description="Set limits, try a purchase against the draft and sign it with a passkey." />
  <Card title="Approvals" href="/docs/concepts/approvals" description="What happens between REQUIRE APPROVAL and payment, and why an approval cannot lift a limit." />
  <Card title="Reason codes" href="/docs/api/errors-and-reason-codes" description="Look up any code an agent or an owner receives." />
</Cards>

