View as Markdown

Mandate · Guide

Propose a plan of subagents

When your agent holds a person's network grant and wants other agents to do part of the work, it proposes a delegation plan: the task in one line and, for each subagent, its purpose, its budget and any narrower limits. The person reviews the plan once, changes it if they want, and can see and stop every subagent later.

Before you begin: your grant request proposed hand-on (proposed.hand_on: true) and the person kept it, so the grant reads hand_on: "ask". Each subagent is a registered agent with an active signing key. A subagent from another maker is allowed; the person sees its maker's name.

1. Ask for hand-on in the grant request

{
  "agent_id": "agt_scout",
  "proposed": { "max_amount": 1500, "budget_amount": 2400, "budget_window": "month", "currency": "USD", "expires_at": "2027-06-30T00:00:00Z", "hand_on": true }
}

hand_on isn't a limit, so it leaves the grant's constraints and token as they were. Without it, a plan is refused with 403 delegation_not_allowed.

2. Propose the plan

POST /v1/mandate/network_grants/{id}/delegation_plans with the task and the subagents:

{
  "task": "Lisbon trip, Dec 9 to 13",
  "helpers": [
    {
      "key": "flights", "agent_id": "agt_flights", "purpose": "Book the flights",
      "budget": { "amount": 1100, "allocation": "reserved", "at_limit": "stop" }
    },
    {
      "key": "rooms", "agent_id": "agt_rooms", "purpose": "Book the hotel",
      "budget": { "amount": 900, "allocation": "shared", "at_limit": "ask", "ask_up_to": { "percent": 10 } },
      "limits": { "allowed_stores": ["https://casamarlinde.example"] }
    }
  ]
}

Each subagent's budget has its amount and two settings (budgets):

FieldValuesWhat it means
allocationreservedSet aside from the grant. Nobody else can spend it.
shared (default)Drawn from what the grant has left.
at_limitstopPast its amount the order is refused (over_helper_limit).
ask (default for shared)Past its amount the order asks the person, up to ask_up_to (20% by default; null for any amount the grant has room for), then is refused.
continuePast its amount the order goes through without asking while the grant has room.

A subagent can never pass what the grant above it has left.

Merchant lock. limits.allowed_stores locks a subagent to up to a few stores (the person's page takes 5). At any other store its order is refused with outside_merchant_lock, with no approval and no adjust link, so nothing waits for the person. A person's own grant with allowed_stores still asks at another store (store_not_listed). The person sees the lock as the subagent's Merchant row and can add, narrow or remove it while reviewing. limits.allowed_categories is the Category row.

Every subagent is checked against the grant: never wider on any limit, at most 4 levels below the person's grant and 50 live subagents per grant, and the reserved budgets with what was already spent fit the budget. A plan that needs more than the grant is refused unless it sets requests_raise, which the person always reviews and accepts with their passkey.

The answer is 201 with children (each subagent's grant and, for your own agents, its network_mandate token) when the person's review setting accepts the plan at once, or 202 with review.url when it waits. Send the person that link, for example as "Change the plan". A proposed plan expires after 24 hours unanswered and is never accepted by silence.

3. Revise it

4. Buy under a subagent's grant

The subagent buys with POST /v1/mandate/network_orders and its own grant token. Each order walks the chain, so a stop above it takes effect on the next order. A subagent from another maker gets its token on its own maker's webhook.

Field on a refusalMeaning
reason: parent_stoppedA grant above is stopped, paused or expired, or an agent above is suspended
reason: over_helper_limitPast the subagent's amount, with at_limit: stop or past ask_up_to
reason: outside_merchant_lockThe subagent is locked to other stores
stopped_byperson, maker, parent, agent_suspended or expired
stopped_grant_idThe grant that stopped it

5. Handle the webhooks

EventWhen
mandate.delegation_plan.proposedThe plan waits for the person
mandate.delegation_plan.acceptedAccepted, by the person or at once (edited_by, decided_via, the subagents as saved)
mandate.delegation_plan.changedThe person saved changes (changes: one line each)
mandate.delegation_plan.declined, .expiredWork on under your own grant
mandate.network_grant.delegatedA subagent grant was minted
mandate.network_grant.stoppedThe person stopped a subagent and everything below it (stopped_below)

The person chooses how your plans are reviewed, per agent or as their default. Your call reads the result: 201 when accepted, 202 when waiting.

Review modeWhat happens to your plan
prompt (the default)It waits for the person
auto_acceptAccepted at once if it fits the grant
digestAccepted at once; the person sees it in one daily summary
first_timeWaits only when it names a subagent not accepted before

A plan with requests_raise, or naming a subagent from a maker the person never approved, always waits. When the person raises a subagent's budget from now on, the plan gets a new version and you get mandate.delegation_plan.changed.

The person can also change a running plan themselves: add or remove a subagent, or change a budget, its two settings, its category or its merchants. The plan gets a new version with edited_by: person, new subagents' grants are minted, removed ones stop, and you get mandate.delegation_plan.changed. Read the plan again before your next revision: a revision on an older version is 409 plan_changed.

What to check

FieldOn
hand_on, plan_id, helper_count, plan_pendingA grant that may hand on
parent_id, budget (allocation, at_limit, ask_up_to), purpose, depthA subagent grant
  • Pricing: a plan the person is asked to review counts as one confirmation. Plans accepted at once and the subagent grants are free; the orders subagents make are metered as network orders.

Errors you might see

CodeWhyFix
delegation_not_allowed (403)The grant has no hand-onAsk for hand_on in the grant request
delegation_exceeds_parent (400)A subagent is wider than the grant, or the budgets don't fitLower the field in param
helper_not_verified (400)The agent isn't registered or has no active signing keyAdd a signing key to the agent
delegation_depth_exceeded, delegation_limit_reachedPast 4 levels or 50 live subagentsStop subagents whose work is done
plan_closed (409)The version was already decidedRead the plan again

See also