SDK reference · Python SDK

prov.mandate.intents.create

prov.mandate.intents.create in Python SDK. Mint an intent token.

Signature

prov.mandate.intents.create(agent_session_id: str, device_id: str, action_description: Optional[str] = …, action_payload: Any = …, mandate_token: Optional[str] = …, biometric_challenge: Optional[str] = …, biometric_assertion: Optional[dict] = …, biometric_type: Optional[str] = …, options: Optional[list] = …, revises: Optional[str] = …, user_agent_suffix: Optional[str] = …, **extra: Any = …) -> Any

Parameters

agent_session_idstrRequired
device_idstrRequired
action_descriptionOptional[str]
action_payloadAny
mandate_tokenOptional[str]
biometric_challengeOptional[str]
biometric_assertionOptional[dict]
biometric_typeOptional[str]
optionsOptional[list]
revisesOptional[str]
user_agent_suffixOptional[str]
**extraAny

Request fields

Idempotency-Keystringheader
Retry a create safely: the same key + request returns the stored response (24 h, per caller).
DPoPstringheader
A DPoP proof (RFC 9449) from the grant's holder key, when the grant is holder-bound (holder_jkt): an ES256 dpop+jwt naming this request (htm, htu), iat within 60 seconds, a fresh jti, and ath, the SHA-256 of the grant token sent. One per request. See bind a grant to its holder.
action_descriptionstring
The human-readable action, exactly as authorized. Required unless you send options.
action_payloadany
Opaque; its canonical-JSON SHA-256 is bound into the token.
optionsarray of objects
"Choose one": 2 to 5 complete actions instead of action_description. Each is hashed and gets its own token (a distinct jti and action_hash, all carrying option_group_id); one approval holds the group and opens now. The person approves exactly one; verify on the others answers option_not_chosen. The account's policy runs on each option, and one it denies outright is shown disabled. Can't be combined with action_description, action_payload, approval, mandate_token or display_summary.
Show child attributes
labelstringRequired
The option's card label ("United 9:40 am"); unique in the request.
actionstringRequired
The option's action description, hashed into its token.
payloadany
The option's exact payload (opaque), hashed into its token. action_payload is accepted too.
contextobject
Policy facts and card facts for this option (transaction_amount, currency, payee, date, …), up to 20.
revisesstring
The approval this request revises: one that ended changes_requested. The token carries it (revises claim), and the new approval shows the person what changed.
run_idstring
An agent-team run to join. The token carries run, and the session stops when the run is halted. Defaults to the mandate's run.
agent_session_idstringRequired
The agent session the token was minted for.
device_idstringRequired
The capture or approving device's ID.
agent_idstring
The registered agent that asks. The token's agent claim carries { id, name, integration, sdk_version }: the agent's id and name, plus the integration the client declares in its User-Agent (mcp, ai_sdk, langchain, langchain_py, claude_agent_sdk, claude_agent_sdk_py, openai_agents, openai_agents_py, adk_py, crewai_py or none), signed as reported. A merchant reads it at checkout.
mandate_tokenstring
Authorize UNDER a delegation mandate. The mandate is validated here (signature, status, expiry, device/session binding — invalid ⇒ 400 grant_invalid) and its grant_id is bound into the resulting token so verify enforces its constraints and budget. A holder-bound grant (holder_jkt) also needs its holder's DPoP proof in the DPoP header (401 dpop_proof_required, dpop_proof_invalid, dpop_proof_replayed or holder_mismatch).
counter_offer_idstring
the accepted counter-offer this action buys. Needs mandate_token (the counter-offer's grant). When the accepted option gave an action_hash, the action's payload hash must equal it; the amount and counterparty are checked at verify, where the acceptance is spent (one purchase each). A mismatch is 409 counter_offer_terms_changed and no token is minted. The token carries no new claim: the id stays on the token's server-side record.
context_evidenceobject
The agent's justification for the action (a JSON blob of scalars/strings, ≤ ~8KB). Canonicalized + hashed into the token (context_hash), sealed onto the ledger + receipts, and shown to the human in the "Why the agent is asking" panel. It is the agent's STATED reason — a claim, not a verified fact. verify may re-supply it to re-check (context_hash_mismatch on mutation). Free.
trace_idstring
Bind a Trace (a traced inference from /v1/trace/chat/completions, or a sidecar reading, this account) into the token as trace: {id, canary_hash}, so fact:"canary" policy conditions read its canary readings at verify. Another account's trace → 404 resource_missing.
approvalobject
A merchant-requested checkout step-up, taken from the store's ProvenanceIntent challenge (approval_request); pass the challenge's binding as action_payload. The first call opens an approval bound to that exact order and answers approval_pending; relay it to the person (the mandate.approval.created webhook and the approval embed, or an approver link). The same call after the approval returns the token. A declined, expired or muted step-up answers 200 with that reason and no token. No delivery path → 503 stepup_delivery_not_configured; over the per-person, per-store or per-account limits → 429 rate_limit_exceeded, with no notification. No field identifies the person; ships_to is coarse order data the store holds.
Show child attributes
merchant_originstringRequired
The origin of the URL your agent called (https://shop.example). It must equal the binding's origin.
displayobjectRequired
What the person sees that the order can't bind. Optional total, currency and items must repeat the binding exactly.
Show child attributes
merchant_namestringRequired
The store's own name, shown as "calls itself …" (sanitized, at most 80 characters).
ships_toobject
City, region and country only.
Show child attributes
citystring
The city.
regionstring
The region or state.
countrystring
The country.
totalinteger
The bound total in minor units.
currencystring
The bound ISO 4217 currency.
itemsarray of objects
The bound quantities per SKU.
Show child attributes
skustring
The SKU.
quantityinteger
The quantity.
expires_attimestampRequired
The challenge's expiry. The approval lasts until this or 10 minutes, whichever comes first.
require_biometricboolean
Ask for face, fingerprint or passkey on the person's enrolled device. No enrolled credential → approval_too_weak.
min_tierenum
The store's minimum device tier. A passkey (routed) approval can't meet it → approval_too_weak. One of tee, strongbox, sep.
transportenum
How the store asked (default checkout). With acp, action_payload is the ACP binding. With request, it is an Identify request binding (kind: "request", origin, action, method, path), display holds only merchant_name, and the person approves with a biometric or passkey. One of checkout, acp, request.
routeobject
Route the approval to an approver-network link instead of the in-house device.
Show child attributes
approver_link_idstring
An active approver link of this account.
external_confirmationobject
A confirmation the person gave outside Provenance, accepted only when your policy's external_confirmations.accept lists its kind and it verifies for this exact cart. Screenshots, chat transcripts and an agent saying the person confirmed are never a kind. Every plan. See ask once.
Show child attributes
kindenumRequired
ap2_user_mandate: a closed AP2 0.2 mandate SD-JWT; spc: a Secure Payment Confirmation; platform: a listed agent platform's signed confirmation. One of ap2_user_mandate, spc, platform.
evidencestring | objectRequired
The SD-JWT presentation (ap2_user_mandate) or compact JWS (platform) as a string, or the SPC assertion as an object.
Show child attributes
credential_idstring
The passkey's credential ID.
assertionobject
The assertion, base64url fields.
Show child attributes
authenticator_datastringRequired
base64url authenticator data.
client_data_jsonstringRequired
base64url clientDataJSON (type: payment.get).
signaturestringRequired
base64url signature.
public_keystring | object
A passkey your store registered itself: its public key (PEM or JWK). The confirmation is then labelled as your store's credential.
audiencestring
The one site this token is for (its aud claim): an http(s) origin (normalized, e.g. https://shop.example) or a merchant id. A site running Identify refuses a token minted for another audience. Present only when you send it. With an audience the token's sub is pairwise (psub_…): stable for this device at this audience, so Identify can give the person one pseudonym there. Without one, sub is per token (anon_…).

Returns

Any The signed intent token.

HTTP operation

POST /v1/mandate/intents: Create an intent token

Errors

Example

const data = await (await fetch(`${process.env.PROVENANCE_API}/v1/mandate/intents`, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.PROVENANCE_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "action_description": "Pay invoice INV-2041: $1,850.00 to Brindlecote Supplies",
    "action_payload": {
      "type": "payment",
      "amount": 1850,
      "currency": "USD",
      "payee": "acct_brindlecote_supplies"
    },
    "agent_session_id": "sess_reference_1",
    "device_id": "dev_00000000000000000000000000000001"
  }),
})).json();

Was this page helpful? Send us feedback

LLM? Read llms.txt.