# Delegate to subagents

Delegate a narrower grant to each subagent, with its own purpose, so one subagent can only spend what its task needs and every spend still counts against the person's limits.

Use this when an orchestrator agent starts subagents. Each subagent gets its own child grant, delegated from the person's grant: narrower limits, its own agent session, and a purpose that says what it's working on. If one subagent is misled, it can only spend what its own grant allows, and every spend still counts against each level above it.

**Before you begin:** the person has granted your orchestrator a grant (see [grants](https://provenanceauth.com/docs/mandate/concepts/grants.md)), ideally with a `purpose`.

## 1. Give the person's grant a purpose

The purpose is one line of plain text the person sees with the limits, and it's repeated on every approval a subagent asks for. Export the sandbox account key first:

**curl**

```bash
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5

curl -s $PROVENANCE_API/v1/mandate/grants \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Restock printer paper for the office",
    "constraints": {
      "max_amount": 80, "budget_amount": 200, "budget_window": "month",
      "allowed_action_types": ["quote", "purchase"],
      "allowed_counterparties": ["paper.example", "office.example"],
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' | tee parent.json
export PARENT_ID=$(jq -r .id parent.json)
```

```json
{
  "object": "grant",
  "status": "active",
  "purpose": "Restock printer paper for the office"
}
```

Pass `max_depth` (0 to 4) to limit how many levels of subagents may sit below it. The default is 4.

## 2. Delegate to a subagent

[`POST /v1/mandate/grants/{id}/delegate`](https://provenanceauth.com/docs/api/grants.md#post-v1-mandate-grants-id-delegate) mints the child. Send the subagent's session, a `purpose`, and only the limits you want to tighten; every field you leave out inherits the parent's value.

**curl**

```bash
curl -s $PROVENANCE_API/v1/mandate/grants/$PARENT_ID/delegate \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_session_id": "sess_paperfinder_1",
    "purpose": "Find A4 paper prices at three stores",
    "purpose_tags": ["quote"],
    "constraints": { "max_amount": 40, "budget_amount": 60, "allowed_action_types": ["quote"] }
  }' | tee child.json
export CHILD_TOKEN=$(jq -r .mandate_token child.json)
```

**Node**

```ts
const child = await prov.mandate.grants.delegate(parentId, {
  agentSessionId: "sess_paperfinder_1",
  purpose: "Find A4 paper prices at three stores",
  purposeTags: ["quote"],
  constraints: { maxAmount: 40, budgetAmount: 60, allowedActionTypes: ["quote"] },
});
```

**Python**

```python
child = prov.mandate.grants.delegate(
    parent_id,
    agent_session_id="sess_paperfinder_1",
    purpose="Find A4 paper prices at three stores",
    purpose_tags=["quote"],
    constraints={"max_amount": 40, "budget_amount": 60, "allowed_action_types": ["quote"]},
)
```

```json
{
  "object": "grant",
  "status": "active",
  "depth": 1,
  "purpose": "Find A4 paper prices at three stores",
  "approval_context": null
}
```

No passkey is needed: the person already approved the parent, and the child can only be narrower. The rules, checked when the child is minted:

| Field | A child may |
| --- | --- |
| `max_amount`, `budget_amount` | Be lower than the parent's, or anything when the parent has no cap. A parent cap means the child needs a cap too. |
| `budget_window` | Be the same as the parent's or shorter (`day` < `week` < `month`). |
| `allowed_action_types`, `allowed_counterparties` | Be a subset of the parent's. Empty or null inherits them. |
| `expires_at` | Be the same as the parent's or earlier. |
| `currency` | Never change. A child inherits the parent's. |
| `max_uses`, `max_purchases` | Be lower than the parent's. Left out, the child inherits the parent's count. |
| `purchase_window` | Be the same as the parent's or shorter (`day` < `week` < `month` < `lifetime`). |
| `allowed_mcc`, `allowed_countries` | Sit inside the parent's. Left out, the child inherits them. |
| `blocked_mcc`, `blocked_counterparties`, `blocked_countries` | Add to the parent's. The child's list is stored with the parent's, so it can't remove a block. |
| `schedule`, check-ins | Never be set. A child follows its parent's. |

`purpose_tags` (up to 10) name the action types or counterparties the task is about, each from the parent's lists. A chain goes at most 4 levels below the person's grant, and a grant has at most 50 active children.

Pass `agent_id` with a [registered agent](https://provenanceauth.com/help/personal/concepts/your-agents) to name the subagent. Its name then appears in the chain, on approvals, and in what other agents see when they [check its authority](https://provenanceauth.com/docs/mandate/guides/check-another-agents-authority.md).

## Delegate with the agent's own grant

The agent that holds a grant can delegate from it without your account key. This is holder proof: the agent sends the grant's own token and signs the request with its own key, so only the agent the person trusted can hand on what it holds.

1. Name the agent when the person grants the grant: `agent_id` on [`POST /v1/mandate/grants`](https://provenanceauth.com/docs/api/grants.md#post-v1-mandate-grants), the **Held by** field on a new grant in the console, or a registered agent's `id` in a [`<provenance-grant>`](https://provenanceauth.com/docs/mandate/concepts/grants.md) draft.
2. Register the agent's Ed25519 public key with [`POST /v1/identify/agents/{id}/signing_keys`](https://provenanceauth.com/docs/api/signed-agents.md#post-v1-identify-agents-id-signing-keys). The response's `directory_url` is where the API finds it.
3. Delegate with the token in `parent_token` and the request signed with that key. The signature covers the method, the path and a `Content-Digest` of the body, and each signed request is used once.

```ts
const prov = new Provenance({}); // no account key
const child = await prov.mandate.grants.delegateAsHolder(
  parentId,
  { agentSessionId: "sess_paperfinder_1", purpose: "Find A4 paper prices at three stores", parentToken: parentMandateToken },
  { key: agentPrivateJwk, directoryUrl: signingKey.directoryUrl },
);
child.delegatedBy; // "holder"
```

Python has the same call, `prov.mandate.grants.delegate_as_holder(parent_id, parent_token=..., private_jwk=..., directory_url=..., agent_session_id=..., purpose=...)`. A child minted this way can hand on again with its own token, signed by the agent it names. Every child is still only narrower than its parent.

Each child records how it was minted in `delegated_by`:

| `delegated_by` | Minted by |
| --- | --- |
| `holder` | The agent that holds the parent, with its own grant |
| `account_key` | An account key |
| `console` | A person in the console |
| `proposal` | A [proposal](#proposals) the person approved |

**Require it.** With `require_holder_proof` on ([`PUT /v1/mandate/settings/delegation`](https://provenanceauth.com/docs/api/grants.md#put-v1-mandate-settings-delegation), or **Settings › Agent teams › Handing on** in the console), an account key can't delegate; the agent delegates with its own grant, or a person delegates in the console. It is on for new accounts. Accounts created before holder proof keep it off until you turn it on.

## Proposals

Your orchestrator often knows the plan before the person does: a trip needs flights, a hotel and a car. It can propose the whole structure, and nothing exists until the person approves it with their passkey. The person can approve it as it is, change it first, or decline it.

1. Propose the children under the grant your agent holds, with [`POST /v1/mandate/grants/{id}/delegation_proposals`](https://provenanceauth.com/docs/api/grants.md#post-v1-mandate-grants-id-delegation-proposals): for each, a registered agent of your account, a purpose, its limits, its `budget` settings and its over-limit settings. Send it with your account key or as the holder (`parent_token` and the agent's signature, as above).
2. Every child is checked as a delegation would be, with the reserved budgets added up across the proposal. A child wider than the grant is refused, naming it (`param: "children[1].constraints.budget_amount"`).
3. The person is told by text and email, as for an approval. The response's `approve_url` is the plan page, if you'd rather send it yourself (`notify: false`), and `short_url` the same page as a short text link (`null` when short links are off).
4. On the plan page, or in the console under **Approvals › Plans**, the person sees one helper per row. They can change a helper's limit, share, what happens at the limit, per-purchase limit, kinds of merchant or merchants, remove a helper, add one for any of your agents, give a helper to another agent, and raise the grant's own budget or margin. Each change is checked against the grant as they go. A helper's purpose stays the one your agent wrote. The plan page opens in your page theme like your other approval pages: dark unless you choose light in Settings › Branding, and the person can switch it unless you turn that off.
5. Approving signs that exact plan with the passkey of the person's own grant. Every helper is minted at once, or none of them is. Each child records `delegated_by: "proposal"`, the `proposal_id` and the fields the person changed (`edited_fields`).

```ts
const plan = await prov.mandate.grants.propose(tripId, {
  children: [
    { agentId: flightsAgentId, purpose: "Book the flights", budget: { allocation: "shared", atLimit: "continue" }, constraints: { budgetAmount: 900 } },
    { agentId: staysAgentId, purpose: "Book the stay", budget: { allocation: "reserved", atLimit: "stop" }, constraints: { budgetAmount: 1100 } },
  ],
});
plan.status; // "pending"
plan.approveUrl; // the plan page
```

Python: `prov.mandate.grants.propose(trip_id, children=[...])`, or `propose_as_holder(...)` with the agent's own grant.

**What you get back.** The webhook `mandate.delegation_proposal.decided` says what the person decided: `status`, `edited`, each change in `edits` (`{ child, field, from, to }`, a removed or added child), the minted children and, when the person raised the grant, `parent_change`. Read the children's tokens with [`GET /v1/mandate/delegation_proposals/{id}`](https://provenanceauth.com/docs/api/grants.md#get-v1-mandate-delegation-proposals-id) and your account key. The proposal keeps your agent's structure as sent in `proposed`, beside the one the person signed in `approved`.

The webhook and your account's reads carry how the person decided, in [`approval_context`](https://provenanceauth.com/docs/concepts/approval-context.md). It's null while the proposal waits.

**States.** `pending` until the person decides, for 24 hours by default (`expires_in`, never past the grant's own expiry). `approved` or `declined` once they do. A new proposal with `supersedes` replaces a pending one (`superseded`). If the grant changed after the proposal (it was revoked or expired, or its limits moved) and the plan doesn't fit it any more, nothing is minted and the proposal is `stale`: send a new one.

## Share the parent's budget

A child's `budget_amount` is its limit. Its `budget` has two settings, `allocation` and `at_limit` ([budgets](https://provenanceauth.com/docs/mandate/concepts/grants.md#budgets)):

| `allocation` | What other children see |
| --- | --- |
| `shared` (default) | It draws from the parent's free budget, first come, first served |
| `reserved` | Its budget is held out of the parent's, so they can't spend it |

| `at_limit` | Past its limit |
| --- | --- |
| `ask` (default) | A person is asked up to `ask_up_to` past it (20% by default), then refused |
| `stop` | Refused |
| `continue` | Allowed with no ask while the parent's budget, and every one above it, has room |

`continue` suits a trip with a budget of 1,000 USD and three helpers with 333 each: one helper's purchase of 400 goes through with no ask while the others have spent 400, because the trip budget still has room. Its `max_amount` still caps each purchase.

`reserved` suits a budget that must be there when the helper needs it, like the hotel's. A reserved helper set to `continue` counts against the parent as the larger of its reserved amount and what it spent.

A reserved or continuing budget needs a `budget_amount` and the grant's `currency`. A reserved budget is held in the parent's own budget window, so the child's `budget_window` is the parent's, and the parent's live reserved budgets together fit in its budget:

**curl**

```bash
curl -s $PROVENANCE_API/v1/mandate/grants \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book the Lisbon trip",
    "constraints": {
      "budget_amount": 2400, "budget_window": "month", "currency": "USD",
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }' | tee trip.json
export TRIP_ID=$(jq -r .id trip.json)

curl -s $PROVENANCE_API/v1/mandate/grants/$TRIP_ID/delegate \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_session_id": "sess_stays_1",
    "purpose": "Book the hotel, 12 to 16 March",
    "budget": { "allocation": "reserved", "at_limit": "ask", "ask_up_to": { "percent": 10 } },
    "constraints": { "budget_amount": 1100, "max_amount": 1100 }
  }'
```

**Node**

```ts
const stays = await prov.mandate.grants.delegate(tripId, {
  agentSessionId: "sess_stays_1",
  purpose: "Book the hotel, 12 to 16 March",
  budget: { allocation: "reserved", atLimit: "ask", askUpTo: { percent: 10 } },
  constraints: { budgetAmount: 1100, maxAmount: 1100 },
});
```

**Python**

```python
stays = prov.mandate.grants.delegate(
    trip_id,
    agent_session_id="sess_stays_1",
    purpose="Book the hotel, 12 to 16 March",
    budget={"allocation": "reserved", "at_limit": "ask", "ask_up_to": {"percent": 10}},
    constraints={"budget_amount": 1100, "max_amount": 1100},
)
```

```json
{
  "object": "grant",
  "budget": { "allocation": "reserved", "at_limit": "ask", "ask_up_to": { "percent": 10 } },
  "reserved_amount": 1100
}
```

A reserved budget past what is left is a `delegation_exceeds_parent` with `param: "budget.allocation"`, and `error.details.available_to_reserve` says how much of the parent's budget is left to reserve. Flexible shares have no such rule: their sum may be more than the parent's budget, which still caps every purchase.

While a reserved budget is held, every other spend through the parent sees the parent's budget less what the reserved child hasn't spent yet, the parent's own purchases included. Revoking the reserved child releases what it hadn't spent, and the decision ledger records it (`kind: "revoke"`, with `released`). An expired child holds nothing.

## Kinds of merchant and countries

A grant can limit where money goes by the kind of store, by blocking stores, and by country. Each list is optional, stays on the server (the token carries none of them), and works the same on any grant: a trip, an office supply budget or a subscription.

| Field | What it holds |
| --- | --- |
| `allowed_mcc` | Kinds of store by merchant category code (MCC): a group by name (`{ "group": "lodging" }`) or a range (`{ "from": "3000", "to": "3299" }`). |
| `blocked_mcc` | Kinds of store refused, in the same form. |
| `blocked_counterparties` | Stores refused, matched as `allowed_counterparties` is. |
| `allowed_countries`, `blocked_countries` | Countries, as `PT` or `620`. |

| Group | MCC |
| --- | --- |
| `airlines` | 3000–3299, 4511 |
| `lodging` | 3501–3999, 7011 |
| `car_rental` | 3351–3500, 7512 |
| `rail` | 4112 |
| `grocery` | 5411, 5499 |
| `office_supplies` | 5111, 5943 |
| `software` | 5734, 5817, 5818 |
| `gambling` | 7995 |
| `cash_like` | 6051 |
| `money_transfer` | 4829 |

A group is stored as its MCC ranges with its name, so a later change to the groups never changes a grant.

The store states its MCC and country with the cart, as a 3-D Secure authentication request carries them: `merchant: { "mcc": "7011", "country": "620" }` (four digits; the ISO 3166-1 numeric code). They are inside the cart's hash, so the token, the approval page and the receipt carry what the store stated, and everywhere they show they read as declared. At verify, send `context.mcc` and `context.merchant_country`. A store's merchant list matches the cart's `merchant_id` or its `origin`.

**curl**

```bash
curl -s $PROVENANCE_API/v1/mandate/grants \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "device_id": "dev_00000000000000000000000000000001",
    "purpose": "Book the Lisbon trip",
    "constraints": {
      "budget_amount": 2400, "budget_window": "month", "currency": "USD",
      "allowed_mcc": [{ "group": "airlines" }, { "group": "lodging" }, { "group": "car_rental" }],
      "blocked_mcc": [{ "group": "gambling" }],
      "allowed_countries": ["PT", "ES"],
      "expires_at": "2027-12-31T23:59:59Z"
    }
  }'
```

**Node**

```ts
const trip = await prov.mandate.grants.create({
  deviceId: "dev_00000000000000000000000000000001",
  purpose: "Book the Lisbon trip",
  constraints: {
    budgetAmount: 2400,
    budgetWindow: "month",
    currency: "USD",
    allowedMcc: [{ group: "airlines" }, { group: "lodging" }, { group: "car_rental" }],
    blockedMcc: [{ group: "gambling" }],
    allowedCountries: ["PT", "ES"],
    expiresAt: "2027-12-31T23:59:59Z",
  },
});
```

**Python**

```python
trip = prov.mandate.grants.create(
    device_id="dev_00000000000000000000000000000001",
    purpose="Book the Lisbon trip",
    constraints={
        "budget_amount": 2400, "budget_window": "month", "currency": "USD",
        "allowed_mcc": [{"group": "airlines"}, {"group": "lodging"}, {"group": "car_rental"}],
        "blocked_mcc": [{"group": "gambling"}],
        "allowed_countries": ["PT", "ES"],
        "expires_at": "2027-12-31T23:59:59Z",
    },
)
```

How each list is checked, at every grant in the chain:

| The cart | Reason | By default |
| --- | --- | --- |
| On a block list (a store, a kind of store, a country) | `grant_counterparty_blocked`, `grant_category_blocked`, `grant_country_blocked` | Refused. A block wins over every allow list. |
| A kind of store outside `allowed_mcc` | `grant_category_not_allowed` | Challenged |
| A country outside `allowed_countries` | `grant_country_not_allowed` | Challenged |
| No MCC, or no country, under a list that needs one | `grant_category_not_allowed`, `grant_country_not_allowed` | Challenged: the store can't show it is allowed, or that it isn't blocked |

Each of these locks takes the same [over-limit settings](#over-the-limit) as the others: set the `block` lock to `ask` and a person may say yes to one purchase. Verify refuses each miss with `grant_constraint_violated` and a `grant_detail` that says which list.

Each purchase's spend entry records the MCC and the country the store declared (`declared_mcc`, `declared_country`). When a payment integration later reports another MCC or country for the charge, the entry records it and your account hears `mandate.grant.mcc_mismatched`.

## Service dates

`service_window` limits the dates of what is bought: hotel nights, a flight, a rental. It is separate from `expires_at`, which limits when the agent may act, so an agent may book until 10 March for stays from 12 to 16 March. It holds two calendar dates, both included, such as `"service_window": { "from": "2027-03-12", "to": "2027-03-16" }`. For lodging, `to` is the check-out date.

The store states each line's dates with the cart: `items[].service_period: { "start": "2027-03-12", "end": "2027-03-16" }`, each a date or a date-time with an offset (`2027-03-12T15:00:00+00:00`), in the place's own local time. The dates are inside the cart's hash, so the token, the approval page and the receipt carry what the store stated. At verify, send `context.service_start` and `context.service_end`.

Every line that states dates must sit inside the window. Dates are compared as calendar dates: a date-time is read as its date in its own offset, with no time-zone conversion.

| The cart | Reason | By default |
| --- | --- | --- |
| A line's dates outside the window | `grant_service_dates_outside` | Challenged |
| No dates under a window | `grant_service_dates_outside` | Challenged: the store can't show the dates |

A child's window sits inside its parent's; a child that leaves it out keeps its parent's. A wider window is a `delegation_exceeds_parent` with `param: "constraints.service_window"`. The window stays on the server: the token never carries it. The `dates` lock takes the same [over-limit settings](#over-the-limit) as the others; set it to `refuse` to reject without asking. Verify refuses a miss with `grant_constraint_violated` and a `grant_detail` that names the window.

## 3. Authorize under the child grant

The subagent authorizes with its own session and the child's token, the same way as under any grant:

**curl**

```bash
curl -s $PROVENANCE_API/v1/mandate/intents \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d "{
    \"action_description\": \"Request a quote for 10 reams of A4 from paper.example\",
    \"agent_session_id\": \"sess_paperfinder_1\",
    \"device_id\": \"dev_00000000000000000000000000000001\",
    \"mandate_token\": \"$CHILD_TOKEN\"
  }"
```

```json
{
  "object": "intent_authorization"
}
```

The intent token carries `mandate_chain` (the grant ids from the person's down) and `purpose_chain_hash` (sha256 of the chain's purposes) after its usual claims. Tokens minted outside a delegation keep their exact claims.

## 4. Know what verify checks

Each verify under a child grant:

1. Checks every grant in the chain. A revoked or expired grant above it, or a suspended agent holding one, stops it with the matching reason (for example `grant_revoked`), and `stopped_by` names that grant.
2. Checks the child's own limits, then your policy. A limit the action goes past follows its setting, as at a store: one that asks returns `approval_pending`, and one that refuses answers as below. See [Over the limit at verify](#over-the-limit-at-verify).
3. Debits the spend from the child's budget window and every ancestor's, in one step. When any level would go over, nothing is debited and verify returns `grant_budget_exceeded` with `budget_grant_id` naming the level that ran out. Two subagents spending at once can't take the person's grant past its budget.
4. Counts one purchase at every level that has `max_uses` or `max_purchases`, in the same step. A full count returns `grant_uses_exhausted` or `grant_purchase_limit_reached`, with `count_grant_id` naming the level. A single-use parent makes its whole subtree single use.

A store on Authorize runs the same checks when a subagent shows its child grant at checkout: every grant in the chain must be live and every agent unsuspended, and a cart that goes through is debited from the child's window and every ancestor's. When a level can't take the cart, its lock's setting decides: the store asks a person, or refuses. See [Over the limit](#over-the-limit).

## 5. See what each subagent spent

Every debit writes a spend entry at the grant that spent. List a grant's entries, its subagents' included, with [`GET /v1/mandate/grants/{id}/spend`](https://provenanceauth.com/docs/api/grants.md#get-v1-mandate-grants-id-spend):

**curl**

```bash
curl -s "$PROVENANCE_API/v1/mandate/grants/$PARENT_ID/spend?include_descendants=true" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
const page = await prov.mandate.grants.spend(parentId, { includeDescendants: true });
```

**Python**

```python
page = prov.mandate.grants.spend(parent_id, include_descendants=True)
```

```json
{
  "object": "list",
  "data": [],
  "has_more": false,
  "next_cursor": null
}
```

Each entry names the grant that spent, why it spent (`kind` is `verify` or `checkout`) and what caused it: the decision, the checkout assessment or the token. A purchase that took a budget set to keep going past its amount reads `continued_over_limit`.

In a [run](https://provenanceauth.com/docs/mandate/guides/halt-a-run.md), each member's grant also shows `spent` this window, `share` (its own budget) and `available`, what its chain lets it spend now. Other children's reservations don't count as available. A child also shows its share mode and reserved amount.

## 6. Stop a subagent or a whole branch

Revoke a child with [`POST /v1/mandate/grants/{id}/revoke`](https://provenanceauth.com/docs/api/grants.md#post-v1-mandate-grants-id-revoke). Revoking any grant revokes everything delegated below it, effective on the next verify. A revoked branch can't be restored: delegate a new child instead.

The decision ledger gets one row for each grant below it that the revoke stops: `kind: "revoke"`, the grant's own parent in `parent_mandate_id`, and `stopped_by`, the grant you revoked. A reserved child's row also says how much it `released`. A grant that was already revoked gets no second row. List them with [`GET /v1/mandate/assessments`](https://provenanceauth.com/docs/api/decisions.md#get-v1-mandate-assessments).

Identify's hosted check walks the same chain. A sub-agent's grant in `Provenance-Mandate`, or an intent token authorized under it, reads `token_revoked` once a grant above it is revoked or expired, or an agent holding one is suspended.

## Over the limit

When a purchase goes past one of a grant's limits, at a store or at verify, that limit's setting decides what happens. Each lock has its own:

| Lock | What it limits | Default |
| --- | --- | --- |
| `amount` | One purchase (`max_amount`) | Ask up to 20% over, refuse past that |
| `budget` | The window's budget, at this level and every level above | Ask up to 20% over, refuse past that |
| `counterparty` | The merchant list | Refuse |
| `currency` | The grant's currency | Ask at a store; refuse at verify |
| `uses` | `max_uses` | Refuse |
| `purchases` | `max_purchases` | Ask |
| `category`, `country` | The kinds of store and the countries | Ask |
| `block` | The block lists | Refuse |
| `dates` | The service window | Ask |

The margin is a percentage of the limit, so it scales with the amount: at 20%, a limit of 1,100 asks up to 1,320. Past the margin, the store rejects the cart without asking. The assessment's `reason` names the lock (see [reason codes](https://provenanceauth.com/docs/platform/reason-codes.md)).

Under **Advanced**, the margin can be a fixed amount instead, in the grant's currency: `refuse_over: { amount: 300 }` asks up to the limit plus 300. Give one of `percent` or `amount`. On a grant, a fixed amount needs its `currency`.

Set the account's defaults in **Settings → Agents → Agent teams → Over the limit**, or with [`PUT /v1/mandate/settings/delegation`](https://provenanceauth.com/docs/api/grants.md#put-v1-mandate-settings-delegation) (an admin key); set `constraints.over_limit` on one grant to override them. A child's settings can only be stricter than its parent's: `refuse` instead of `ask`, or a smaller margin.

A percentage and a fixed amount compare at the child's own limit for that lock. With no limit of its own, the child states its margin the way its parent does.

### Read what a grant does past its limits

[`GET /v1/mandate/grants/{id}`](https://provenanceauth.com/docs/api/grants.md#get-v1-mandate-grants-id) returns `over_limit_rows`: one row per lock the grant has, with the setting resolved the way a decision resolves it (the grant's own, the nearest level above, the agent's margin, your account's, then the default). Up to `allow_up_to` is allowed; past it, up to `ask_up_to`, a person is asked; past `refuse_past`, it is refused.

```json
"over_limit_rows": [
  { "lock": "amount", "action": "ask", "limit": 1100, "allow_up_to": 1100, "ask_up_to": 1320, "refuse_past": 1320, "currency": "USD" },
  { "lock": "budget", "action": "refuse", "limit": 1100, "allow_up_to": 1100, "ask_up_to": null, "refuse_past": 1100, "currency": "USD", "window": "month" },
  { "lock": "counterparty", "action": "refuse", "limit": null, "allow_up_to": null, "ask_up_to": null, "refuse_past": null }
]
```

`ask_up_to: null` with `refuse_past` set means nothing is asked: past the limit is refused. Both null means a person is asked at any amount over. A child set to `continue` has a budget row with `soft: true` and no thresholds: its own budget doesn't cap, the budgets above it do.

When the agent's `ask_above` line sits under the grant's own per-purchase limit, the `amount` row's `allow_up_to` is that line and `source` is `agent_default`. A purchase under a subagent also meets each level above's own rows; read them on that grant. The list of grants doesn't carry the rows.

When the store asks, the cart approval knows the limit. The person sees the agent's limit beside the order's total and, when a level above would go over its budget, by how much. The store's read of the approval carries `mandate` and `over_limit`.

A yes is spent from the chain as one entry with `kind: "approved_over_limit"`:

- The child's counter reads over its cap. Its next purchase sees no room.
- A budget above it may go over by at most its own margin. The entry's `lifted` names each one and how far over it is. Other children's reservations count as spent here, so a yes never takes a reservation.
- A cart in another currency changes no budget and still counts one purchase.
- The token the yes mints carries the grant. The store's retry with it, and its verify, spend nothing again.

If the chain can't take the cart by the time the person says yes, the approval is declined with `decline_reason: "approval_blocked"`, and `over_limit.budget_grant_id` names the level. Nothing is spent.

The entry's `approver_link` says who said yes: `same_person` when the passkey is the one the person used for the top grant, otherwise `unlinked`. Both count. Set `require_same_person: true` to accept only `same_person`; another passkey gets `approver_not_linked` and the approval stays open. Your account hears `mandate.grant.over_limit_approved` for each yes.

### Over the limit at verify

Verify reads the same settings. When the action goes past a limit that asks, and stays within its margin, verify returns `approval_pending` with `step_up_reason: "delegation_over_limit"` and `over_limit`:

```json
{
  "object": "mandate_assessment",
  "valid": false,
  "reason": "approval_pending",
  "approval_id": "appr_01JX4F7M2T8Q",
  "policy": { "id": "pol_3F9A1C7E52B04D8E6A1F27C9B4", "version": null, "rule": { "id": "delegation_over_limit", "name": null, "phase": "assess", "action": "challenge", "conditions": [] } },
  "step_up_reason": "delegation_over_limit",
  "over_limit": {
    "kind": "budget",
    "grant_id": "grt_valet",
    "limit": 400,
    "amount": 100,
    "currency": "USD",
    "lifts": [{ "grant_id": "grt_valet", "limit": 400, "over": 20 }]
  }
}
```

The approval goes to your account's people, and shows the limit, the amount and any budget above that a yes would take over. To pass it to the person yourself, get its link with [`POST /v1/mandate/approvals/{id}/link`](https://provenanceauth.com/docs/api/approvals.md#post-v1-mandate-approvals-id-link) (see [pass the link on yourself](https://provenanceauth.com/docs/mandate/guides/step-up-approval.md#pass-the-link-on-yourself)). Once someone approves, verify again with the same token.

The yes is spent once, as an entry with `kind: "approved_over_limit"`, with the same rules as a yes at a store: the child's own limit is skipped, and each budget above may go over by its own margin. A second verify of the same token spends nothing again. Your account hears `mandate.grant.over_limit_approved` with `surface: "verify"`, and the ledger row's facts carry `over_limit`.

A limit that refuses, a miss past its margin and a currency mismatch are refused with their own reason, and nobody is asked. If the chain moves past a margin before the yes is spent, verify returns `grant_budget_exceeded` and spends nothing. With `require_same_person: true`, a yes not decided with the person's own passkey returns `approver_not_linked` and spends nothing.

Your policy sees four facts and can route the approval its own way, or deny:

| Fact | What it holds |
| --- | --- |
| `delegation.depth` | Hand-offs from the person's grant (1 for a subagent) |
| `delegation.parent_agent` | The agent that handed the grant on |
| `delegation.root` | The person's grant at the top |
| `delegation.over_limit` | The limit a person would be asked about, or `none` |

A rule with `require: { approval: true }` on `delegation.over_limit` asks with its own route; a rule with `require: { deny: true }` refuses. The first three are set under a child grant; `delegation.over_limit` is set whenever a person would be asked.

Accounts created before verify read these settings keep refusing every miss there until you change **Over the limit**. Your settings show `at_verify: "refuse"` until then. Changing any lock moves verify onto the settings, or set `at_verify` yourself with [`PUT /v1/mandate/settings/delegation`](https://provenanceauth.com/docs/api/grants.md#put-v1-mandate-settings-delegation).

### See every ask on the run

When the subagents work under a [run](https://provenanceauth.com/docs/mandate/guides/halt-a-run.md), [`GET /v1/mandate/runs/{id}`](https://provenanceauth.com/docs/api/runs.md#get-v1-mandate-runs-id) lists each purchase that went over a limit in `escalations`, at a store (`surface: "checkout"`) and at verify (`surface: "verify"`), newest first. The run's proposals are listed the same way in `delegation_proposals[]`.

Each escalation has the lock, the limit, the amount, where it stands (`decision`), who said yes (`approver_link`) and how the person decided ([`approval_context`](https://provenanceauth.com/docs/concepts/approval-context.md): the method, the passkey's age, the device and the network). The context is null while nobody has decided.

**Name who you expect to answer.** Send `approver: { name: "Maya Chen" }` with [`POST /v1/mandate/assessments`](https://provenanceauth.com/docs/api/intent-tokens.md#post-v1-mandate-assessments) or with a proposal. A cart at your own store uses the cart's `contact.name`. The run then reads `waiting_on: "Maya Chen"` while that approval is open, and its escalation or proposal carries `approver_name`. With no name sent, it reads `a person`.

Only your account sees the name: never the approval page, a token or a rule. Your account export opens it as `approver_name`, and it's deleted with the approval.

```json
{
  "escalations": [
    {
      "surface": "checkout",
      "approval_id": "coap_01JX4H2N8R5T",
      "agent_session_id": "sess-stays",
      "grant_id": "grt_stays",
      "lock": "amount",
      "limit": 120,
      "amount": 136,
      "currency": "USD",
      "decision": "approved",
      "approver_link": "same_person",
      "created_at": "2026-11-18T09:05:00Z",
      "decided_at": "2026-11-18T09:06:12Z",
      "approval_context": { "object": "approval_context", "method": { "kind": "passkey" }, "…": "…" }
    }
  ]
}
```

A store in another account keeps the IP and the billing address of its cart approval to itself, so the run's copy leaves both out.

## Errors you might see

| Code | What to do |
| --- | --- |
| `purpose_required` | Send a `purpose` of 1 to 200 characters. |
| `delegation_exceeds_parent` | Lower the field named in `param`, or leave it out to inherit the parent's value. For `budget.allocation` (a reserved budget), reserve at most `error.details.available_to_reserve`, or give the child a budget and the grant a currency. |
| `purpose_tags_exceed_parent` | Use tags from the parent's action types or counterparties. |
| `delegation_depth_exceeded` | Delegate from a grant higher in the chain. `error.details.max_depth` is the limit. |
| `delegation_limit_reached` | Revoke children whose work is done, then delegate again. |
| `grant_invalid` | The parent, or a grant above it, is revoked, expired or suspended. |
| `grant_currency_mismatch` | Send the amount in the grant's `currency`, with `context.currency` at verify. |
| `grant_uses_exhausted`, `grant_purchase_limit_reached` | The level named in `count_grant_id` has no purchases left. Ask the person for a new grant, or wait for the next window. |
| `approver_not_linked` | The account requires the person's own passkey for a yes over a limit. Approve with that passkey, or decline. |
| `holder_proof_invalid` | The holder proof didn't check; the message says which part. Send the grant's own token and sign with a key registered to the agent the grant names. |
| `holder_proof_required` | The account requires holder proof. Delegate with the agent's own grant, or turn off `require_holder_proof`. |
| `proposal_closed` | The proposal was already decided, replaced, or ran out of time. Send a new one. |
| `proposal_stale` | The grant changed and the plan doesn't fit it any more. Nothing was minted. Send a new proposal. |
| `proposal_structure_mismatch` | The passkey answered for a different plan. Check the plan again and approve the one you checked. |

## See also

- [Grants](https://provenanceauth.com/docs/mandate/concepts/grants.md)
- [Check an agent's grant](https://provenanceauth.com/docs/mandate/guides/check-another-agents-authority.md)
- [Keep subagents on task](https://provenanceauth.com/docs/mandate/guides/keep-subagents-on-task.md)
- [Halt a run](https://provenanceauth.com/docs/mandate/guides/halt-a-run.md)
- [Step-up approval](https://provenanceauth.com/docs/mandate/guides/step-up-approval.md)
