# Authority and mandates

An agent that can call the checkout is not thereby allowed to commit the buyer. SACP separates capability from authority. Authority is a signed mandate, checked by the shop or the payment side before it commits.

A mandate may be presented during [agentic shopping](https://agenthandelstandard.se/phases/) so the agent only sees in-scope items. The shop must not treat that presentation as a commit. Authority is checked at agentic checkout.

## Capability is not authority

**Capability** is technical: the agent holds a key or token and can call `/checkout/prepare`. **Authority** is organizational: someone entitled to bind the buyer has allowed this agent to commit this kind of purchase, up to this amount, at these merchants, for this time. A checkout handoff confirms payment. Enterprise purchasing also needs approval rules, delegated authority, execution that follows policy, and proof afterwards.

A shop must never treat a valid API key, OAuth token or session as authority. Added in `1.1.0-draft`. The fields are optional and a shop advertises support in discovery as `authority.mandate`.

## The mandate

A mandate is a JSON object, signed as a JWS. Schema: [`/schemas/mandate.schema.json`](https://agenthandelstandard.se/schemas/mandate.schema.json).

| Field | Meaning |
|---|---|
| `mandate_id`, `level` | Identifier, and `consumer` or `enterprise`. |
| `issuer` | Who signed it: `id`, `kid` and optional `jwks_uri`. |
| `principal` | The buyer that is bound: a person or an organization. |
| `delegated_by`, `delegation_chain[]` | Who delegated to whom, from the principal down to the agent. |
| `agent` | The agent `id` and the thumbprint (RFC 7638) of the key it signs with. |
| `scope` | Allowed `categories`, `merchants`, `countries` and `currencies`. A missing list means nothing is allowed for that dimension, not everything. |
| `limits` | `per_transaction`, `per_period[]` (day, week, month, quarter, year), `max_transactions_per_period` and an optional `counter_uri`. |
| `approval_policy` | A reference (`ref` and `sha256`) to the approval matrix, and the `thresholds[]` that escalate to named approvers. |
| `revocation` | `status_uri` and `max_check_age_seconds` (default 300). |
| `validity` | `not_before` and `not_after`. |

## Delegation

Each link in `delegation_chain` may only narrow what it received. A delegate cannot grant a higher limit, a wider scope or a longer validity than its delegator holds. The suggested maximum depth is 5. A chain that widens anything is `delegation_invalid`.

## Scope and limits

The shop checks the category of every item, the merchant, the shipping country and the currency against `scope`. The total of the terms is checked against `per_transaction` and against the period limits. A period limit that spans several merchants needs one party to hold the counter. The mandate names it in `limits.counter_uri`. The verifier reserves the amount there before the commit and confirms or releases it afterwards. Without a `counter_uri` the verifier counts only its own spend, and the mandate is then limited per merchant.

## Approval matrix and approval evidence

The approval matrix belongs to the buyer's organization. SACP does not define it. The mandate points to it with `approval_policy.ref` and a hash, and lists `thresholds[]`. Above a threshold a named human approver, or more than one, must approve these exact terms.

An approval is a signed object. It is bound to one `terms_hash` and one `mandate_id`, so it cannot be reused for other terms. If the shop's re-quote changes the hash, the approval is void. Schema: [`/schemas/approval.schema.json`](https://agenthandelstandard.se/schemas/approval.schema.json).

```json
{
  "sacp_approval_version": "1.1",
  "approval_id": "apr_2026_12_9917",
  "mandate_id": "mnd_2026_12_0042",
  "terms_hash": "sha256:8042bb8bd734bf15b1437a5630335263b0f6494700f4d92ef461049c1235f1fb",
  "decision": "approved",
  "approver": {
    "id": "person:budget-owner-3",
    "role": "budget-owner"
  },
  "decided_at": "2026-12-04T09:06:12Z",
  "authentication": {
    "method": "bankid",
    "assurance": "high"
  },
  "policy_ref": "https://authority.example.org/policies/purchasing-2026-q4",
  "signature": "<detached JWS over approval_id, mandate_id, terms_hash, decision and decided_at>"
}
```

The approver identifies with the identity handoff the shop or the authority provider offers, for example BankID. That is identity, not a payment. The approver must not be the agent. At enterprise level the approver must also not be the person who asked the agent to buy (separation of duties).

## Policy-bound execution

The shop or the payment side verifies the mandate at two points: when it issues the handoff (`/checkout/prepare`), and at the commit point, which is when an order is created or a payment is authorized. The second check uses fresh status and fresh counters.

| Check | Consumer | Enterprise |
|---|---|---|
| Signature valid, issuer trusted | Required | Required, issuer on the shop's trusted list |
| Validity window | Required | Required |
| Agent key matches `agent.key_thumbprint` | Required | Required |
| Delegation chain only narrows | Not used | Required |
| Scope | Merchant and currency | Categories, merchants, countries, currencies |
| Per-transaction limit | Required | Required |
| Period limits and count | Optional | Required |
| Approval | The person confirms at the handoff | Matrix thresholds, signed approvals bound to `terms_hash` |
| Separation of duties | Not used | Required |
| Revocation status | Should check | Required, no older than `max_check_age_seconds` |
| Audit record | Should keep | Required, append-only, with evidence export |

Intent binding applies at both levels. The mandate is checked against the exact terms, so the total checked is the total in the bound snapshot.

| Outcome | HTTP | Body |
|---|---|---|
| Covered | 200 | Handoff, plus `authority_check.status: "covered"` and an `audit_event_id`. |
| Approval needed | 428 | `approval_required` with the approvers needed, an `approval_request_uri` and `expires_at`. |
| Not covered | 403 | `authority_denied` with `reasons[]`, for example `limit_per_transaction`, `scope_merchant`, `mandate_expired`, `mandate_revoked`. |
| Terms changed | 409 | `terms_changed`, see [approved terms](https://agenthandelstandard.se/intent-binding/#requote). |

```json
{
  "code": "approval_required",
  "terms_hash": "sha256:8042bb8bd734bf15b1437a5630335263b0f6494700f4d92ef461049c1235f1fb",
  "mandate_id": "mnd_2026_12_0042",
  "threshold": {
    "above": "1000.00",
    "currency": "SEK"
  },
  "required": {
    "approvals": 1,
    "approver_roles": [
      "budget-owner"
    ]
  },
  "approval_request_uri": "https://authority.example.org/approvals/requests/ar_7731",
  "expires_at": "2026-12-04T09:15:00Z"
}
```

## Revocation

The principal, or anyone higher in the delegation chain, can revoke or suspend a mandate at any time. The issuer or authority provider serves its status at `revocation.status_uri` as `active`, `suspended` or `revoked`, with `as_of` (schema: `$defs/MandateStatus` in [`mandate.schema.json`](https://agenthandelstandard.se/schemas/mandate.schema.json)). Revocation applies at once to every new commit. If the status cannot be read or is older than `max_check_age_seconds`, the verifier refuses with `status_unavailable`. Revoking does not undo a purchase already committed.

## Audit trail and evidence

Every authority decision, covered or not, is written to an append-only record. Each record points to the hash of the one before it, so a gap or an edit can be seen.

```json
{
  "event_id": "evt_0001873",
  "time": "2026-12-04T09:07:40Z",
  "verifier": "shop.example.se",
  "mandate_id": "mnd_2026_12_0042",
  "terms_hash": "sha256:8042bb8bd734bf15b1437a5630335263b0f6494700f4d92ef461049c1235f1fb",
  "agent_id": "agent:buyer-agent-7",
  "decision": "covered",
  "reasons": [],
  "approval_ids": [
    "apr_2026_12_9917"
  ],
  "policy_ref": "https://authority.example.org/policies/purchasing-2026-q4",
  "status_checked_at": "2026-12-04T09:07:39Z",
  "prev_event_hash": "sha256:<hash of the previous record>"
}
```

On a lawful request the shop can export an evidence package for a terms hash: the snapshot, the mandate as presented, the status checks, the approvals, the decision and the timestamps. A shop may serve it at `GET /authority/evidence/{terms_hash}`, behind its own access control. Records are kept for at least the period that applicable law requires.

## Conformance levels

| Level | Meaning |
|---|---|
| No authority layer | Capability only. The human confirms at the handoff, as in 1.0.0. The shop advertises nothing. |
| `consumer` | One person is the principal. The mandate carries a per-transaction limit, scope for merchant and currency, and a validity window. The person confirms the exact terms at the handoff. Revocation and audit are recommended. |
| `enterprise` | Everything in the table above is required: a delegation chain, full scope, period limits, an approval matrix with named approvers, signed approval evidence bound to the terms hash, a fresh revocation check, separation of duties and an append-only audit with evidence export. |

## External authority and governance providers

SACP defines the claims in a mandate, the signature format and the result of a check. It does not define who issues mandates or how an approval matrix is kept. An organization may run its own authority service, or use any external authority or governance provider, as long as the shop trusts the issuer. The mandate may also be carried inside another credential format, for example a signed token or a verifiable credential, if the SACP claims map one to one. A verifier may check locally, from the issuer's published keys, or ask the provider to verify. No vendor is a dependency of this standard.

Discovery advertises the trusted issuers:

```json
{
  "capabilities": [
    "terms.binding",
    "authority.mandate"
  ],
  "extensions": {
    "terms_binding": {
      "hash": "sha256",
      "canonicalization": "jcs-rfc8785",
      "max_validity_seconds": 900,
      "signed_quotes": false
    },
    "authority": {
      "levels": [
        "consumer",
        "enterprise"
      ],
      "mandate_formats": [
        "jws"
      ],
      "trusted_issuers": [
        "https://authority.example.org"
      ]
    }
  }
}
```

## Example mandate

Payload of the signed JWS (media type `application/sacp-mandate+jwt` in this draft):

```json
{
  "sacp_mandate_version": "1.1",
  "mandate_id": "mnd_2026_12_0042",
  "level": "enterprise",
  "issuer": {
    "id": "https://authority.example.org",
    "kid": "2026-12-a"
  },
  "principal": {
    "type": "organization",
    "id": "org:example-buyer-ab",
    "name": "Example Buyer AB"
  },
  "delegated_by": {
    "id": "person:procurement-lead",
    "role": "procurement-lead"
  },
  "delegation_chain": [
    {
      "delegator": "org:example-buyer-ab",
      "delegate": "person:procurement-lead",
      "max_per_transaction": {
        "amount": "50000.00",
        "currency": "SEK"
      }
    },
    {
      "delegator": "person:procurement-lead",
      "delegate": "agent:buyer-agent-7",
      "max_per_transaction": {
        "amount": "10000.00",
        "currency": "SEK"
      }
    }
  ],
  "agent": {
    "id": "agent:buyer-agent-7",
    "key_thumbprint": "NzbLsXh8uDCcd-6MNwXF4W_7noWXFZAfHkxZsRGC9Xs"
  },
  "scope": {
    "categories": [
      "office-supplies",
      "it-accessories"
    ],
    "merchants": [
      "shop.example.se"
    ],
    "countries": [
      "SE"
    ],
    "currencies": [
      "SEK"
    ]
  },
  "limits": {
    "per_transaction": {
      "amount": "10000.00",
      "currency": "SEK"
    },
    "per_period": [
      {
        "period": "month",
        "amount": "50000.00",
        "currency": "SEK"
      }
    ],
    "max_transactions_per_period": 40,
    "counter_uri": "https://authority.example.org/mandates/mnd_2026_12_0042/spend"
  },
  "approval_policy": {
    "ref": "https://authority.example.org/policies/purchasing-2026-q4",
    "sha256": "4a7c7df5b8488acc7c0443ca4eb74251b558cf041adf575e177f6db4c9b1459e",
    "thresholds": [
      {
        "above": "1000.00",
        "currency": "SEK",
        "require": {
          "approvals": 1,
          "approver_roles": [
            "budget-owner"
          ]
        }
      },
      {
        "above": "7500.00",
        "currency": "SEK",
        "require": {
          "approvals": 2,
          "approver_roles": [
            "budget-owner",
            "finance-controller"
          ]
        }
      }
    ]
  },
  "revocation": {
    "status_uri": "https://authority.example.org/mandates/mnd_2026_12_0042/status",
    "max_check_age_seconds": 300
  },
  "validity": {
    "not_before": "2026-12-01T00:00:00Z",
    "not_after": "2026-12-31T23:59:59Z"
  }
}
```

Request to `POST /checkout/prepare` carries the mandate and the approvals beside `approved_terms`, as in [the example](https://agenthandelstandard.se/intent-binding/#example). A covered answer:

```json
{
  "handoff": {
    "type": "swish",
    "url": "https://shop.example.se/pay/h_41c9"
  },
  "terms_check": {
    "status": "match",
    "terms_hash": "sha256:8042bb8bd734bf15b1437a5630335263b0f6494700f4d92ef461049c1235f1fb"
  },
  "authority_check": {
    "status": "covered",
    "mandate_id": "mnd_2026_12_0042",
    "level": "enterprise",
    "approvals_verified": [
      "apr_2026_12_9917"
    ],
    "audit_event_id": "evt_0001873"
  }
}
```

## Conformance

- A shop that advertises `authority.mandate` must verify the mandate against the exact bound terms before it issues a handoff and again at the commit point, and must never treat capability as authority.
- It must answer 403 or 428 with the bodies above, and write an audit record for every decision.
- An agent must present its own mandate, never another agent's, and must not widen it.

## Questions

### How does SACP separate an agent's ability to pay from its authority to commit?

Capability is that the agent can call the shop API. Authority is a signed mandate that names the principal, who delegated, the categories and merchants allowed, the spend limits and the validity. The shop or payment side verifies that the mandate covers the exact transaction before it commits. A valid API key alone is never authority.

### What is a mandate in SACP?

A mandate is a signed object that states the principal, the delegation chain, the agent, scope, per-transaction and period limits, an approval policy reference, a status address for revocation, and a validity window. It is the only thing SACP accepts as authority to commit the buyer.

### What happens when a purchase is above an approval threshold?

The shop answers 428 approval_required and names the approvers needed. Named human approvers sign an approval bound to the terms hash. Without enough valid approvals no handoff is issued.

### Can SACP work with an external authority or governance provider?

Yes. SACP defines only the claims, the signature format and the check result. Any provider can issue mandates, hold the approval matrix and run the policy engine, as long as the shop trusts the issuer. No vendor is a dependency.

### How is a mandate revoked?

The mandate carries a status address. Revocation applies at once to every new commit. The verifier must read a status no older than max_check_age_seconds, and refuses when the status cannot be read.

### What are the SACP authority levels?

Consumer level: one person, a signed limit and validity, and approval at the handoff. Enterprise level: a delegation chain, scope, period limits, an approval matrix with named approvers, signed approval evidence, a fresh revocation check and an append-only audit trail. A shop that advertises neither behaves as in 1.0.0.
