# Write a mandate

Draft an agent's spending rules, try purchases against the draft without spending anything, sign the version with a passkey, and change or revoke it later.

<ShortProductTruth>**A card number was never a permission.** A mandate is the owner's signed statement of what an agent may buy. The agent cannot read it into a prompt and talk its way past it: the policy engine applies it to every purchase.</ShortProductTruth>

## What you end up with [#what-you-end-up-with]

An active, signed mandate version for one agent: what it may buy alone, what needs a person, what it may never buy, on which rails and networks, until a set date. Every later purchase by that agent carries the mandate id and version in its decision trace and in its receipt.

## Steps [#steps]

<Steps>
<Step>

### Start a draft [#start-a-draft]

In the Console, open Mandates and create a draft for the agent. A draft does nothing until it is signed.

<Screenshot id="console-mandates" />

</Step>
<Step>

### Set the limits [#set-the-limits]

| Field | Example mandate | Rule |
| --- | --- | --- |
| Auto-approve limit | <Limit name="autoThreshold" /> | Up to this amount the agent buys alone. |
| Hard cap per purchase | <Limit name="hardCap" /> | Above it, always DENY. Must be at least the auto-approve limit. |
| Unknown-merchant limit | <Limit name="unknownMerchantLimit" /> | Above it, an unknown merchant needs a person. |
| Plan hard cap | <Limit name="planHardCap" /> | The most a whole installment plan may cost. |
| Card hard cap and auto-approve | <Limit name="cardHardCap" />, <Limit name="cardAutoThreshold" /> | The same two limits for virtual cards, in US dollars. |

The hard cap cannot be higher than the agent's budget (<Limit name="agentBudget" /> in the example mandate). Budgets themselves are set separately, at organization, team and agent level.

</Step>
<Step>

### Say what is allowed [#say-what-is-allowed]

Choose the rails (x402 USDC, direct USDT, virtual card), the networks, the assets, the categories of service and the merchant tiers the agent may pay. You can also set the order in which networks are tried and an expiry date. Anything not listed is denied at step 1b of the policy.

</Step>
<Step>

### Try purchases against the draft [#try-purchases-against-the-draft]

Before signing, simulate a purchase: pick a service or a URL, an amount, a rail and a network. The simulation runs the same policy engine as a real purchase, reserves nothing and calls no network. It returns the decision, the reason code and the step-by-step trace.

<PolicyExplorer />

</Step>
<Step>

### Sign with a passkey [#sign-with-a-passkey]

Signing asks for your passkey. The version's rules are serialized as canonical JSON and hashed; your passkey signs a challenge bound to that hash. The mandate is issued in AP2 v0.2 format, with your WebAuthn assertion in the signature slot; Abazi builds and verifies it itself. The version becomes active, and the version it replaces becomes superseded.

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

</Step>
</Steps>

## Changing and revoking [#changing-and-revoking]

Versions are never edited after signing. To change a rule, create a new version (it starts from the current one), try it, and sign it. Abazi can show what changed between any two versions.

Revoking takes a fresh passkey and acts at once:

- the active version becomes revoked;
- pending or approved approvals for the agent are invalidated;
- purchases that are reserved or waiting for approval are denied with <ReasonCode code="MANDATE_REVOKED" />;
- a revocation receipt is issued, so the revocation itself is on the record.

Even a purchase that was already reserved is caught: the signer rechecks the mandate before it signs.

## Failure cases [#failure-cases]

| Situation | Result |
| --- | --- |
| No signed version yet | Every purchase is denied with <ReasonCode code="MANDATE_MISSING" />. |
| The expiry date passed | Denied with <ReasonCode code="MANDATE_EXPIRED" />; sign a new version. |
| A rail, network, category or tier is not listed | Denied with <ReasonCode code="RAIL_NOT_ALLOWED" />, <ReasonCode code="CHAIN_NOT_ALLOWED" />, <ReasonCode code="CATEGORY_NOT_ALLOWED" /> or <ReasonCode code="MERCHANT_TIER_NOT_ALLOWED" />. |
| A limit is set higher than the hard cap or the agent budget allows | The draft is refused before it can be signed. |

## Next steps [#next-steps]

<Cards>
  <Card title="Mandates and policy" href="/docs/concepts/mandates-and-policy" description="Read the full evaluation order and how the lower of two limits wins." />
  <Card title="Approve on a phone" href="/docs/guides/approve-on-a-phone" description="See what happens when a purchase crosses the auto-approve limit." />
  <Card title="Budgets and reservations" href="/docs/concepts/budgets-and-reservations" description="Set the budgets the hard cap must fit inside." />
</Cards>

