Mandate · Guide
Offer options
Use options when your agent found more than one way to do the job, such as three flights or two quotes, and the person should pick. You authorize 2 to 5 complete actions at once. Each gets its own intent token, the person sees them as cards and approves one, and only that option's token verifies.
Before you begin: export the sandbox account key. Options open an approval in the account's inbox, so they need an account key.
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_acct_P9xN2vQ7bT4mW8sYd3cFjLh6gAe1kR5
- Agent authorizes optionsone token per option
- Person approves onethe card they want
- Agent verifies its pickvalid; the others refused
1. Authorize the options
Send options to POST / instead of action_description. Each option is a complete action:
| Field | Meaning |
|---|---|
label | What the person sees on the card |
action | The option's action description, hashed into its own token |
payload | The option's exact payload, hashed into its own token |
context | Facts for your policy and the card: transaction_, currency, payee, date |
curl -s $PROVENANCE_API/v1/mandate/intents \
-H "Authorization: Bearer $PROVENANCE_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_session_id": "sess_travel_1",
"device_id": "dev_00000000000000000000000000000001",
"options": [
{ "label": "6:05 am nonstop", "action": "Book flight NW 412 BOS to SFO on Nov 3", "payload": { "flight": "NW412", "fare": 389 }, "context": { "transaction_amount": 389, "currency": "USD", "date": "2026-11-03" } },
{ "label": "9:40 am nonstop", "action": "Book flight NW 1520 BOS to SFO on Nov 3", "payload": { "flight": "NW1520", "fare": 412 }, "context": { "transaction_amount": 412, "currency": "USD", "date": "2026-11-03" } },
{ "label": "1:15 pm, one stop", "action": "Book flight NW 433 BOS to SFO on Nov 3", "payload": { "flight": "NW433", "fare": 298 }, "context": { "transaction_amount": 298, "currency": "USD", "date": "2026-11-03" } }
]
}' | tee options.json
export APPROVAL_ID=$(jq -r .approval_id options.json)
export PICK_TOKEN=$(jq -r '.options[1].intent_token' options.json)
export OTHER_TOKEN=$(jq -r '.options[0].intent_token' options.json)
const flight = (label: string, code: string, fare: number) => ({
label,
action: `Book flight NW ${code} BOS to SFO on Nov 3`,
actionPayload: { flight: `NW${code}`, fare },
context: { transaction_amount: fare, currency: "USD", date: "2026-11-03" },
});
const offer = await prov.mandate.intents.create({
agentSessionId: "sess_travel_1",
deviceId: "dev_00000000000000000000000000000001",
options: [flight("6:05 am nonstop", "412", 389), flight("9:40 am nonstop", "1520", 412), flight("1:15 pm, one stop", "433", 298)],
});
def flight(label, code, fare):
return {
"label": label,
"action": f"Book flight NW {code} BOS to SFO on Nov 3",
"payload": {"flight": f"NW{code}", "fare": fare},
"context": {"transaction_amount": fare, "currency": "USD", "date": "2026-11-03"},
}
offer = prov.mandate.intents.create(
agent_session_id="sess_travel_1",
device_id="dev_00000000000000000000000000000001",
options=[flight("6:05 am nonstop", "412", 389), flight("9:40 am nonstop", "1520", 412), flight("1:15 pm, one stop", "433", 298)],
)
{
"object": "intent_authorization",
"status": "approval_pending",
"option_group_id": "optg_01M5WK3T8Q2R6V9X1Z4B7D0F3H",
"approval_id": "appr_01M5WK3T8R5T8W1Y3A6C9E2G5J",
"approval_expires_at": "2026-10-26T18:10:00.000Z",
"expires_at": "2026-10-26T22:00:00.000Z",
"biometric_bound": false,
"options": [
{ "index": 0, "label": "6:05 am nonstop", "intent_token": "eyJhbGciOiJFUzI1NiJ9.eyJqdGkiOiIwIn0.c2ln", "attestation_id": "5f0c1e2a-7b3d-4c8e-9a1f-2d4b6e8f0a13" },
{ "index": 1, "label": "9:40 am nonstop", "intent_token": "eyJhbGciOiJFUzI1NiJ9.eyJqdGkiOiIxIn0.c2ln", "attestation_id": "9a3e5c7b-1d2f-4e6a-8c0b-3f5d7e9a1c24" },
{ "index": 2, "label": "1:15 pm, one stop", "intent_token": "eyJhbGciOiJFUzI1NiJ9.eyJqdGkiOiIyIn0.c2ln", "attestation_id": "2b4d6f8a-0c1e-4a3b-9d5f-7e9a1c3b5d36" }
]
}
Every token carries the same option_group_id and its own jti and action_hash. One approval holds the group, and the person is asked now, before the agent acts.
The account's policy runs on each option. An option it denies outright comes back with disabled: true and its disabled_reason, and the person sees it greyed out.
2. The person approves one
The person sees one lettered card per option, with its label, the key facts and the exact action, and Approve this one on each. None of these declines every option. With a passkey rule, the assertion signs sha256 of the group and the chosen option's action_hash, so the passkey signs the choice itself.
Here you approve the second option with the key, through POST /:
curl -s $PROVENANCE_API/v1/mandate/approvals/$APPROVAL_ID/respond \
-H "Authorization: Bearer $PROVENANCE_KEY" \
-H "Content-Type: application/json" \
-d '{ "decision": "approve", "option_index": 1 }'
await prov.mandate.approvals.respond(offer.approvalId, { decision: "approve", optionIndex: 1 });
prov.mandate.approvals.respond(offer["approval_id"], decision="approve", option_index=1)
{
"id": "appr_01M5WK3T8R5T8W1Y3A6C9E2G5J",
"object": "approval",
"status": "approved",
"action_description": "Choose one: 6:05 am nonstop · 9:40 am nonstop · 1:15 pm, one stop",
"option_group_id": "optg_01M5WK3T8Q2R6V9X1Z4B7D0F3H",
"chosen_option": { "index": 1 }
}
Once the group is decided, nothing switches the choice: approving another option answers 409 approval_already_decided.
3. Verify the chosen option
Verify the chosen option's token with its own action and payload. It's valid:
curl -s $PROVENANCE_API/v1/mandate/assessments \
-H "Authorization: Bearer $PROVENANCE_KEY" \
-H "Content-Type: application/json" \
-d '{
"intent_token": "'"$PICK_TOKEN"'",
"action_description": "Book flight NW 1520 BOS to SFO on Nov 3",
"action_payload": { "flight": "NW1520", "fare": 412 },
"context": { "transaction_amount": 412 }
}'
const pick = offer.options[1]!;
const result = await prov.mandate.assessments.create({
intentToken: pick.intentToken,
actionDescription: "Book flight NW 1520 BOS to SFO on Nov 3",
actionPayload: { flight: "NW1520", fare: 412 },
context: { transactionAmount: 412 },
});
result = prov.mandate.assessments.create(
intent_token=offer["options"][1]["intent_token"],
action_description="Book flight NW 1520 BOS to SFO on Nov 3",
action_payload={"flight": "NW1520", "fare": 412},
context={"transaction_amount": 412},
)
{
"object": "mandate_assessment",
"valid": true,
"payload_bound": true
}
4. Other options are refused
Every other option's token fails with option_not_chosen, and chosen_option names the one the person picked:
curl -s $PROVENANCE_API/v1/mandate/assessments \
-H "Authorization: Bearer $PROVENANCE_KEY" \
-H "Content-Type: application/json" \
-d '{
"intent_token": "'"$OTHER_TOKEN"'",
"action_description": "Book flight NW 412 BOS to SFO on Nov 3",
"action_payload": { "flight": "NW412", "fare": 389 },
"context": { "transaction_amount": 389 }
}'
const other = await prov.mandate.assessments.create({
intentToken: offer.options[0]!.intentToken,
actionDescription: "Book flight NW 412 BOS to SFO on Nov 3",
actionPayload: { flight: "NW412", fare: 389 },
context: { transactionAmount: 389 },
});
other = prov.mandate.assessments.create(
intent_token=offer["options"][0]["intent_token"],
action_description="Book flight NW 412 BOS to SFO on Nov 3",
action_payload={"flight": "NW412", "fare": 389},
context={"transaction_amount": 389},
)
{
"object": "mandate_assessment",
"valid": false,
"reason": "option_not_chosen",
"option_group_id": "optg_01M5WK3T8Q2R6V9X1Z4B7D0F3H",
"chosen_option": { "index": 1 }
}
The mandate.approval.approved webhook carries the pick as chosen_option: { index, jti }, so your server knows which token to run without polling.
Use options in a policy
Verify on an option token adds two facts your rules can read:
| Fact | Value |
|---|---|
approval. | How many options the person chose from |
approval. | The index of the option they approved |
Errors you might see
| Code | Status | What to do |
|---|---|---|
parameter_ | 400 | Send 2 to 5 options with distinct labels, and no action_, action_, approval or mandate_ beside them. On respond, send option_ with approve only. |
approval_ | 409 | The group was decided; read it with GET / instead. |
option_ | 200 | A verify reason, not an error: run only the chosen option. |