Authorize · Guide
Verify a Provenance token
Use offline verification when you receive an intent token from someone else, such as a merchant, a bank or another agent, and want to check it without a Provenance API key. Tokens are signed with ES256 and the public keys are published, so you check the signature and expiry yourself. Intent tokens and receipts explains what each token and receipt holds.
Three guides cover agent orders. Pick the one that matches your job:
| You want to | Guide |
|---|---|
Check one intent token or receipt you received, offline against the published keys or with POST / | Verify a token |
| Get one outcome per agent order (approved, challenged or rejected) from your own checkout rules, shaped like a 3-D Secure result | Assess an agent checkout |
Check the cart-bound token and grant a shopping agent presents at your own checkout, with the verifyAgentCheckout helper | Verify agent checkouts |
Before you begin: export the full-access sandbox key to get a token to check. Steps 2 to 4 need no key.
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe
| Check | Offline | With the API |
|---|---|---|
| Signed by Provenance and not expired | Yes | Yes |
| Not revoked | Keyless status check (step 4) | POST / |
| Description and payload match what was approved | No | POST / |
| Policy and approvals | No | POST / |
1. Get a token to check
In production the token arrives with the request you're about to honor. Here you mint one:
curl -s $PROVENANCE_API/v1/mandate/intents \
-H "Authorization: Bearer $PROVENANCE_KEY" \
-H "Content-Type: application/json" \
-d '{
"action_description": "Pay invoice INV-2041: $1,850.00 to Brindlecote Supplies",
"agent_session_id": "sess_offline_1",
"device_id": "dev_00000000000000000000000000000001"
}' | tee authorization.json
export INTENT_TOKEN=$(jq -r .intent_token authorization.json)
export JTI=$(jq -r .attestation_id authorization.json)
import { Provenance } from "@provenanceauth/sdk";
const prov = new Provenance({ apiKey: process.env.PROVENANCE_KEY!, baseUrl: process.env.PROVENANCE_API });
const auth = await prov.mandate.intents.create({
actionDescription: "Pay invoice INV-2041: $1,850.00 to Brindlecote Supplies",
agentSessionId: "sess_offline_1",
deviceId: "dev_00000000000000000000000000000001",
});
const token = auth.intentToken;
import os
from provenanceauth import Provenance
prov = Provenance(os.environ["PROVENANCE_KEY"], base_url=os.environ["PROVENANCE_API"])
auth = prov.mandate.intents.create(
action_description="Pay invoice INV-2041: $1,850.00 to Brindlecote Supplies",
agent_session_id="sess_offline_1",
device_id="dev_00000000000000000000000000000001",
)
token = auth["intent_token"]
{
"object": "intent_authorization",
"intent_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ijc1MjY5NmZmMGY1ZTRmNTMifQ.eyJpc3MiOiJwcm92ZW5hbmNlLWF1dGhvcml6ZSJ9.dUvSg20-l4xn1dRTrhQTU8F0W9tRDWpE1INz793rICt-daFn5wVgd0SndvqNIquHFUih1aFMJ24rCoZCMq3AOA",
"expires_at": "2026-10-24T17:36:45.000Z",
"attestation_id": "7f79a885-5fc7-4946-a27e-6d5c5dc412d0",
"biometric_bound": false
}
The token's jti claim is the attestation_id.
2. Fetch the published keys
GET / is public and can be cached for an hour. During a key rotation it lists both keys, and each token's header names its key in kid.
curl $PROVENANCE_API/.well-known/jwks.json
import { fetchJwks } from "@provenanceauth/sdk";
const jwks = await fetchJwks(process.env.PROVENANCE_API!);
from provenanceauth import fetch_jwks
jwks = fetch_jwks(os.environ["PROVENANCE_API"])
{
"keys": [
{ "kty": "EC", "crv": "P-256", "x": "BK6V-uOw7SR4VDlKGwHj2eQpv5ZC5PwMnsrJhLoGVLQ", "y": "w7xDNaHuUjpEnYwC9u5p1Mosjw6ChXISYi7ojgjsUTc", "kid": "752696ff0f5e4f53", "use": "sig", "alg": "ES256" }
]
}
3. Verify the signature and expiry
The SDK verifiers use the platform's own crypto, so they run in Node, the browser and Python with no API key:
import { verifyIntentTokenOffline } from "@provenanceauth/sdk";
const result = await verifyIntentTokenOffline(token, jwks);
if (result.valid) console.log("authorized for subject", result.payload?.sub, "in session", result.payload?.session);
from provenanceauth import verify_intent_token_offline
result = verify_intent_token_offline(token, jwks)
if result.valid:
print("authorized for subject", result.payload["sub"], "in session", result.payload["session"])
The result has valid, expired, the token's claims in payload, and a reason when it fails. Any standard JOSE library works too, for example jwtVerify from jose with algorithms: ["ES256"]. To check without code, paste the token into the console's Verify a proof page.
Only ES256 is accepted. Pin the algorithm to ES256 and pick the key by the header kid before you check the signature. The API does the same: a token with any other alg, including HS256 or none, fails POST / with reason invalid_token.
The claims you'll use most:
jtistring- The token's ID, used for revocation checks.
substring- An opaque subject for the person who approved, never their device id. A token minted with an
audiencecarries a pairwise subject (psub_…): the same for one device at your site and unrelated at every other site, so you can count or block repeat approvals without linking the person elsewhere. A token minted without one carries a per-token subject (anon_…). Tokens minted before October 2026 carry the device's UUID until they expire. audstring- The one site the token is for, when the agent named one. Accept the token only when it names your origin or merchant id.
action_hashstring- SHA-256 of the approved
action_description. Hash the description you received and compare. payload_hashstring- SHA-256 of the canonical JSON of the approved payload, when one was bound.
confirmedobject- When a person approved the action (
at) and how it reached them (via). Present only when a person approved. How they approved (the method, the biometric, the device tier) is in the paid check, POST/.v1/ authorize/ verifications agentobject- The registered agent's display name (
name). Present when a registered agent asked. riskobject- A coarse risk read at mint:
score(0 to 100) andaction(allow,revieworblock). expinteger- Expiry, four hours after issue.
4. Check revocation before a high-value action
A token can be revoked before it expires, and an offline check can't see that. The free POST / needs no key: it checks the signature, the issuer, the expiry and revocation, and answers with the token's free claims:
{ "object": "verification_result", "valid": true, "reason": null, "kind": "intent", "binding": "not_checked", "revoked": false, "confirmed": null }
Approval holds
A token is signed when the agent asks for it, before anyone approves it. When the issuer's rules ask a person (require.approval), the agent's first decision opens the approval. Until the person approves, every check of the token answers valid: false: the free POST /, the paid POST /, checkout assessments and the @provenanceauth/rails verifiers.
reason | What happened | What to do |
|---|---|---|
approval_ | The person hasn't answered yet. | Hold the order and check again after they answer. |
approval_ | The person declined it. | Don't run the action or ship the order. |
approval_ | Nobody answered before the approval expired. | Ask the agent to authorize again. |
approval_ | The person asked for a change. | Wait for the agent's revised token. |
option_ | The person chose a different option of the same request. | Run only the chosen option. |
A hold is a status, like revocation. The free check names the reason only, never the method, the biometric, the device tier or who approved. The paid check also names the approval (approval.id). Once the person approves, the token verifies, and confirmed says when they said yes (via: "approval"), even when they approved after the token was minted. confirmed is null when a rule alone allowed the action.
An agent that never calls its own decision has no approval to report, so its token verifies when nothing asked a person. To require a person's yes on every order, read confirmed, or pass require.confirmed to verifyAgentCheckout.
If you hold a key for the issuing account, POST / runs every check at once, including the description and payload binding.
5. Choose the free check or the paid one
POST / verifies any Provenance token for free: an intent token, a grant token or a signed receipt. Send expected.action_payload to have it compare the payload too; binding then says match or mismatch. It answers with the token's free claims only (the ones listed in step 3) and never the approval detail. It allows 120 requests a minute per IP address; past that it answers 429.
A merchant that needs to know how the person approved calls POST / with its own key. It runs the same checks, applies your checkout rules, and adds the approval detail Provenance keeps on its side: the method, whether it was biometric, the device's trust tier and the agent's registration. Each call is metered as one Authorize check.
| Check | Key | Answers with |
|---|---|---|
| Offline (steps 2 and 3) | None | Signature and expiry |
POST / | None | Signature, expiry, revocation, approval holds, binding and the free claims |
POST / | Your account key | All of that, your checkout rules and how the person approved |
Errors you might see
| Symptom | Cause | Fix |
|---|---|---|
valid: false, reason unknown kid | Your cached keys predate a rotation | Fetch the keys again. |
valid: false, expired: true | Tokens last four hours | Ask the sender to authorize again. |
valid: false, reason unsupported alg | The token isn't an ES256 intent token | Check you were sent an intent token, not a receipt or another JWT. |
valid: false, reason approval_ | The issuer's rules asked a person, who hasn't answered | Hold the order; see approval holds. |
429 on the status check | The keyless status check is rate-limited per IP | Cache results for the token's lifetime, or verify with a key. |
See also
- Execution binding
- Verify page
- Decision ledger, for receipts that verify the same way