> For the complete documentation index, see [llms.txt](https://docs.metamynd.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metamynd.ai/core-concepts/mandates-and-delegated-authority.md). Agents can also search and read this documentation through its [MCP server](https://docs.metamynd.ai/~gitbook/mcp).

# Mandates & Delegated Authority

A mandate is the authority an owner grants an agent: one action, its spend limits, approved recipients and expiry, issued as a verifiable credential.

A **mandate** is the bounded, delegated authority an agent holds on behalf of a principal — what it's allowed to do, not merely what it's capable of. Concretely, a mandate is an [ODRL](https://www.w3.org/TR/odrl-model/)-style document, issued as a verifiable credential:

```ts
Mandate = {
  uid?, profile?, target?,
  permission: Permission[],
  prohibition: Prohibition[],
  obligation?,
  validFrom?, validUntil?,
}
```

Each `Permission`/`Prohibition` carries `Constraint[]` — `leftOperand`/`operator`/`rightOperand`/`unit`/`onFail` — which is what actually encodes a spend cap, a jurisdiction list, or an approved-tool set.

Within a mandate, evaluation order is: validity window, then prohibitions, then a matching permission whose constraints all hold. A prohibition that fires outranks any permission.

#### Constraints and the reasons they give

Operators are a fixed set — `eq` · `neq` · `lt` · `lteq` · `gt` · `gteq` · `isAnyOf` · `isNoneOf` · `isPartOf` · `before` · `after` — and an unknown operator fails closed. New scenarios add operands, not operators.

Well-known operands map to stable reason codes, so a denial names its cause:

| Operand                              | Denial reason                                                                                                                  |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| `mm:payAmount`, `mm:cumulativeSpend` | `SPEND_LIMIT_EXCEEDED`                                                                                                         |
| `mm:merchant`                        | `MERCHANT_NOT_ALLOWED`                                                                                                         |
| `mm:route`                           | `ROUTE_NOT_ALLOWED`                                                                                                            |
| `mm:counterparty`                    | `COUNTERPARTY_NOT_ALLOWED`                                                                                                     |
| `mm:jurisdiction`                    | `JURISDICTION_REQUIRED` (the request has no effective jurisdiction) · `JURISDICTION_NOT_ALLOWED` (it has one outside the list) |
| anything else                        | `CONSTRAINT_FAILED:<operand>`                                                                                                  |

#### Settings on a permission

Beyond constraints, each permission can carry settings the owner chooses when the mandate is issued (`POST /policy/mandate`):

* **Currency policy** — a single currency, a list of accepted currencies, or `any`. The spend caps are scoped to exactly the currencies the mandate allows.
* **Non-financial mandates** — amount and currency may be omitted entirely for actions that move no money (sending a message, reading a record). A mandate that carries a spend constraint still requires a real amount.
* **Resource scope** — a constraint over the `resource` operand (`isAnyOf: ["crm.contacts", "ledger.postings"]`) limits which systems and data the agent may reach. `resource` is one of the eight **signed** fields of a request, so a relaying service cannot substitute a different one, and an action that declares no resource is denied under a resource-scoped mandate. In the dashboard, the owner grants resources to an agent in **Resources & Access** and pins the result to the mandate with **Pin to mandate**. A grant can be revoked there too (`POST /resources/grants/{grantId}/revoke`): it leaves the agent's scope at once, but a mandate already pinned keeps its resource list, and the gate keeps enforcing that list, until the owner pins again.
* **Expiry** — an optional `expiresAt` (an ISO 8601 date-time) sets when the mandate lapses; a request after it is refused `MANDATE_EXPIRED`. It is stored on the mandate row and as the signed document's `validUntil`. `POST /policy/mandate` refuses a value that is not a date-time with `400`. Onboarding (`POST /onboarding/agent`, and `POST /onboarding/agents/{ref}/rules` for an existing agent) also requires it to be in the future, refusing it with `400 EXPIRY_INVALID` before anything is created. In the dashboard, **Set mandate** and the Launchpad's Authority step take an optional **Expires on** day; the mandate lapses at the end of that day, in the owner's local time. See *Changing a mandate's expiry* below.
* **`riskTier`** — an owner-set risk floor (`low` · `medium` · `high` · `critical`). The agent may claim a higher risk for an action, never a lower one. See [Context Provenance & Risk Floors](https://docs.metamynd.ai/core-concepts/context-provenance-and-risk-floors).
* **`requirePayloadBinding`** — the gate refuses any request for this action that does not carry a signed digest of its full payload (`PAYLOAD_BINDING_REQUIRED`), and refuses to let an unbound hold be claimed. A new agent can get it from the switch in the Launchpad; for an existing agent the owner can switch it on or off from the agent's **Payload binding** panel in the dashboard. See [Payload Binding](https://docs.metamynd.ai/core-concepts/payload-binding).
* **`allowedJurisdictions`**: an ISO 3166-1 alpha-2 allow-list (`EU` expands to the 27 member states), stored as `{ leftOperand: 'mm:jurisdiction', operator: 'isAnyOf', rightOperand: [...] }`. It is judged on the request's **effective jurisdiction**: the country the owner registered for the payee, otherwise the jurisdiction the agent **signed**. A jurisdiction in the unsigned context is ignored. `GET /policy/mandate/:ref/status` returns it. See [Restrict Jurisdictions](https://docs.metamynd.ai/guides/restrict-jurisdictions).

#### Where a mandate actually lives

There's no separate "mandate" database table — a mandate **is** a `policy` row with mandate-binding columns: `agentIdentityId`, `agentDid`, `principalDid` (the authorizing principal), `expiresAt`, `vcHash` (hash of the issued mandate VC), `mandateDoc` (the cached ODRL document), anchor references (`anchorTopicId`/`anchorTxId`/`anchorRef`), delegation columns (`delegatedFromPolicyId`, `delegationDepth`, `delegatedByAgentDid`), and `supersedesPolicyId` for a mandate that replaced another (see *Reissue carries spend* below).

#### Agent-to-agent delegation

A supervisor agent's active mandate can be narrowed into a child mandate for another agent — `POST /policy/mandate/:policyId/delegate`. This is enforced, not just documented:

* The caller must own the delegating (parent) agent; the delegate agent doesn't need to be owned by the same tenant.
* No self-delegation.
* **The child must be no wider than the parent**, checked at every constraint — a narrowing attempt that tries to widen scope fails with `CONSTRAINT_WIDENED` or `CONSTRAINT_DROPPED` at issuance time, before it ever reaches the authorize gate. Narrowing is asymmetric per operator: a *lower* `lteq` ceiling, a *smaller* `isAnyOf` allow-list, but a *larger* `isNoneOf` deny-list.
* A parent constraint the child omits counts as a widening, not a simplification — a child that drops its parent's spend cap would hold more authority than its parent.
* The child must keep every prohibition the parent carried, must not lower or drop the parent's `riskTier`, and must not drop `requirePayloadBinding`. Constraints the parent did not have may be added freely — they can only remove authority.
* **Allowed jurisdictions:** a child that states no `allowedJurisdictions` inherits the parent's list, and it is stored on the child. A stated list must be a subset of the parent's (`CONSTRAINT_WIDENED` otherwise). A child of an unrestricted parent may add one.
* Delegation depth is bounded at **3**; exceeding it fails `DEPTH_EXCEEDED`.
* A child that doesn't restate its own validity window inherits the parent's — and it can never outlive it.
* **`principalDid` is copied unchanged all the way down the chain.** However many hops of delegation separate an action from the original grant, an accountability walk (`GET /policy/mandate/:policyId/chain`) always resolves back to the one principal that's ultimately accountable.

**In the dashboard.** On an agent's Trust Profile, the **Authority** tab's **Delegation** section has **Delegate to another agent**: pick one of your other agents and, optionally, tighten four terms — the per-transaction cap, the total budget, the approved recipients and the expiry. The form starts from this agent's own mandate and copies everything else unchanged (risk tier, payload binding, jurisdictions, resource scope, prohibitions), so none of it can be dropped; the server's narrowing check still decides, and a refusal (`CONSTRAINT_WIDENED`, `DEPTH_EXCEEDED`, …) is shown as it came back. The same section lists the mandates delegated from this agent, each with **Revoke delegation chain** (`POST /policy/mandate/:policyId/revoke-chain`), which ends that delegation and everything delegated below it. A delegated agent's **Where this authority came from** view offers the same control to the owner.

#### The spend lifecycle of a mandate

For a value-bearing action, a mandate's budget moves through these stages:

1. **Permit** — the gate evaluates the request and returns `allow` or `observe`.
2. **Atomic reservation** — the last gate step reserves the amount against the mandate's cap; a lost race returns `CAP_EXCEEDED`.
3. **Hold** — the reservation is held under an `authorizationId`. A hold nobody claims expires and returns its budget.
4. **Claim** — the executing service claims the hold, exactly once. From here the effect may already have happened, so the budget stays committed.
5. **Capture or void** — the hold settles at the amount actually charged (never more than authorized), or is released if nothing ran.

See [Holds, Claims & Exactly-Once Execution](https://docs.metamynd.ai/core-concepts/holds-claims-and-exactly-once-execution) for the rules at each step.

#### Revocation

Revoking a mandate (`POST /policy/mandate/:ref/revoke`) or an entire chain (`POST /policy/mandate/:policyId/revoke-chain`) cascades to every descendant — a revoked root can't leave orphaned, still-valid child mandates behind. Every mandate the cascade reaches is revoked exactly as the one you named: the same routine, whichever route (or a decommission) started it.

Revocation stops **new** authority immediately, but it does not pretend in-flight actions didn't happen:

* **Unclaimed holds are voided** and their budget is returned — under the named mandate and under every delegated one. A hold like that can no longer be claimed or captured (`409 AUTHORIZATION_VOIDED` / `NOT_HELD`).
* **Claimed holds stay committed.** A service has already taken them up and may be executing, so they remain held until the claimer settles them or they are reconciled. The revoke response reports how many claimed holds were left.

The response counts the whole cascade: `revokedMandates`, `voidedHolds`, `claimedHoldsLeft`, `closedReviews` (`revoke-chain` answers `revoked` — the mandates it deactivated — with the same three counts). Revoking a mandate that is already inactive answers `ALREADY_REVOKED` but still sweeps it, so revoking the root again releases anything under it that is still outstanding. Independently, an unclaimed hold under an inactive mandate is refused `409 MANDATE_REVOKED` on claim and capture; it can still be voided. Every reissue (key rotation, resource pin, payload-binding toggle, limit change, expiry change) supersedes a mandate and **also revokes every mandate delegated from it** (their reviews close `MANDATE_REVOKED`, their unclaimed holds are released): nothing was delegated from the new mandate, so re-delegate if you still want to.

As a second line of defence, a delegated mandate is only usable while every mandate above it is active: authorize, an escalation approval and a claim or capture of an unclaimed hold are refused `MANDATE_REVOKED` if any ancestor is inactive, and `DELEGATION_CHAIN_BROKEN` if the chain can't be walked to its root (a missing parent, a cycle, too deep).

#### Reissue carries spend

A mandate is reissued when something in the signed document changes — a key rotation, pinning a resource scope, switching payload binding on or off, changing its spending limits, changing its expiry. The new mandate records the one it supersedes, and **cumulative spend is carried across the whole lineage**: reissuing a mandate never resets its budget to zero. (Switching payload binding for an existing agent is refused with `409` while the agent has an outstanding hold. Changing its limits or its expiry is refused with `409` only while a gateway has claimed a hold and may be executing it; authorizations no gateway has claimed are released, each recorded as a `MANDATE_SUPERSEDED` evidence event, and the agent asks again under the new terms.)

**Changing a deployed agent's limits.** On the agent's Trust Profile, **Spending limits → Change limits** sets a new per-transaction cap, total budget and list of approved merchants (an empty list lifts the merchant restriction). The API is `GET` / `POST /policy/agents/{ref}/mandate-limits` with `{ perTxnMax?, maxAmount?, merchants? }`; a per-transaction cap above the total budget is refused with `400`, and so is a change to a mandate that moves no money. The currency is not changed here. The agent's starter SOP keeps its own copy of the cap and budget (`SOP_SPEND_CAP`, `SOP_BUDGET_CAP`), so a limit raised above an SOP rule is still capped by that rule: the panel, and `sopLimits` in the response, list each SOP rule that refuses below the mandate (`lowerThanMandate: true`) so you can edit it on the SOPs tab. A reissue also carries the mandate's `allowedJurisdictions`. A jurisdiction constraint that can't be read back as an allow-list (a hand-authored `isNoneOf`, for example) stops that mandate from being reissued, so the restriction is never silently dropped.

**Changing a mandate's expiry.** On the agent's Trust Profile, **Authority → Expiry → Change expiry** sets an earlier end date, a later one, or none (**Remove end date**). The API is `GET` / `POST /policy/agents/{ref}/mandate-expiry` with `{ "expiresAt": "<ISO date-time>" | null }`, for the agent's owner or an admin. `GET` answers the current expiry, `delegatorExpiresAt` (the latest a delegated mandate may run to) and `delegatedChildren`, the live mandates delegated from this one that a change would revoke. The change reissues the mandate as described above: spend carries over, unclaimed holds are voided with evidence, and every mandate delegated **from** it is revoked and listed in `revokedDelegated` — delegate again if you still want to. It is refused, changing nothing:

* `400 EXPIRY_INVALID` — the value is not an ISO date-time, or is not in the future.
* `409` while a gateway has claimed a hold under the mandate, or when the agent has more than one active mandate and their expiries differ.
* `409` with `data.reasonCode: "EXPIRY_EXCEEDS_DELEGATOR"` and `data.delegatorExpiresAt` — the agent's own mandate was delegated to it, and the new date is later than its delegator's, or removes the end date under a delegator that has one. A delegated mandate can never outlast the mandate it came from.

A **delegated** mandate stays delegated when it is reissued — including when the *delegate* rotates its key. The new mandate keeps the same delegator, depth, owner (the delegator's tenant) and root principal, and its own terms with only the change applied; it is re-checked the way `delegate` checks a delegation: every mandate above it must be active, and the changed terms must still be a narrowing of the delegator's **current** terms. If not, nothing is reissued. An owner's change — a resource pin, payload-binding toggle, limit change or expiry change — is then **refused** as a whole: `409` with the code (`DELEGATION_NARROWING_FAILED`, e.g. pinning a resource the delegator never had, switching off payload binding the delegator requires, or raising a limit past the delegator's; `EXPIRY_EXCEEDS_DELEGATOR` for an expiry past the delegator's; `MANDATE_REVOKED` / `DELEGATION_CHAIN_BROKEN` for a dead chain) and `data.refused: [{ policyId, reasonCode, detail }]`. Nothing changes: no mandate is reissued or revoked. A key **rotation** instead **revokes** the delegated mandate (the old DID is gone) and reports it in `mandateReissue.revoked`. So revoking the delegator always reaches the delegate's authority, rotated or not.

#### Mandate evaluation, in the gate

A mandate is evaluated at **step 13 of 16** in the authorize gate, after identity, containment, freshness, and rule-molecule checks have already passed — see [The Authorize Gate: 16 Ordered Checks](https://docs.metamynd.ai/agent-protocol/the-authorize-gate-16-ordered-checks). A successful evaluation resolves to `AUTHORIZED`; constraint failures resolve to the codes above, or to `PROHIBITED` when a prohibition fires — see the [Reason Code Registry](https://docs.metamynd.ai/agent-protocol/reason-code-registry).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.metamynd.ai/core-concepts/mandates-and-delegated-authority.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
