Skip to content
CRDCA.CA for agents
ESEN

The human mandate that authorizes the agent

The mandate is a six-field SD-JWT, compatible with AP2, that the person signs and the verifier checks against the agent key and a one-time nonce.

The mandate is the authorization a person gives their agent: a six-field SD-JWT, compatible with AP2, signed with the human's credential, with the agent key bound in cnf and a one-time presentation. CRDCA does not sign mandates, does not custody them and does not revoke them: it publishes the format and the verifier checks it.

Who signs

The person signs, with a credential from one of the two families in the closed list:

FamilyCredential
walleta WebAuthn passkey with a P-256 key, verified as an ES256 signature
legal signaturethe Ed25519 signature of the human's credential

The issuer is compared by origin —scheme and host— and its key is pinned by fingerprint. No CRDCA root appears as an issuer. The agent does not sign the mandate: it presents it with its kb-jwt.

The six fields

FieldWhat it carries
issabsolute https URL of an admitted issuer
subAgentID of the presented card
cnfa single subfield, jwk, with the agent public key
scopelist of strings with the authorized actions, no catalog
limitsmax_amount, currency and per, and nothing else
expinteger expiry, after the verification instant

limits.max_amount is a positive decimal, currency matches ^[A-Z]{3}$ and per is day, month or total. A fourth subfield is not admitted. Limits are verified per request: amounts are not accumulated across mandates.

cnf is bound to the SPKI of the class certificate. Its kid is the SHA-256 fingerprint of the SPKI of x5c[0], with a single hash; the verifier recomputes it and does not trust the value carried in the mandate.

The presentation and the nonce

The presentation chains the JWT, the disclosures and the kb-jwt, separated by ~. Selective disclosures go in _sd with _sd_alg equal to sha-256, and the kb-jwt closes the presentation with three claims:

ClaimWhat it fixes
audAgentID of the presentation receiver
nonceone-time value chosen by the receiver
iatissue instant, never after the verification instant

The receiver stores the aud+nonce pair as soon as it accepts and rejects a second presentation with the same pair. The entry is retained until the accepted mandate's exp. A mandate may be presented several times within its validity, but every presentation uses a fresh nonce.

How it travels

There are two surfaces and no more:

  • the HTTP header CRDCA-Mandate, with the complete mandate;
  • the A2A message metadata, under the crdca.mandate key.

The message body is not a surface. If both arrive and do not match, the transport is invalid; if neither arrives, there is no mandate. In TypeScript, transporte and leerMandato are the functions that enforce that rule:

import { leerMandato, transporte } from '@nexgensys/crdca-plugin-a2a';

const entrega = transporte(presentacion, { superficie: 'cabecera' });
console.log(entrega.cabeceras);
const leido = leerMandato({
  cabeceras: entrega.cabeceras,
  metadatos: entrega.metadatos,
});
console.log(leido.mandato, leido.superficie);

How it is verified

Step 8 of the middleware validates the mandate when the action asks for it. Earlier, step 2 already checked that the cnf kid is the SPKI fingerprint of x5c[0], and step 6 checked the card's validity. The mandate verifier adds:

  • the human signature with the issuer's key;
  • the cnf binding to the class key, recomputed;
  • the kb-jwt signed with that same key, its aud, its nonce and its iat;
  • the issuer inside the closed list, with no remote jku or x5u;
  • the action inside scope and limits;
  • an exp strictly after the verification instant.
from crdca.mandato import Contexto, IndiceNonces, ListaEmisores, verificar

contexto = Contexto(
    agent_id="https://example.com/agents/invoices/agent-card.json",
    lista=ListaEmisores(),
    nonces=IndiceNonces(),
    accion={"tipo": "pagar", "importe": "10.00", "moneda": "MXN"},
)
resultado = verificar(presentacion, contexto, spki=spki_de_la_clase)
print(resultado.aceptado, resultado.codigos, resultado.detalle)

ListaEmisores() declares the two families and the pinned fingerprints, but the SPKI material comes from your local store. Without material that matches the fingerprint, verification fails closed with R14: it downloads no keys and does not accept the key the mandate itself presents.

The mandate codes

CodeWhen
R03the cnf.jwk kid is not the SPKI fingerprint, or the kb-jwt is signed by another key
R09verification happens at or after exp
R13invalid mandate: fields, limits, scope, reused nonce or action outside limits
R14issuer not admitted, expired document, remote jku or key different from the pinned one

There are no new codes: they are the same fourteen from algoritmo-v1. R13 and R14 can also appear in the middleware result when step 8 rejects.

What CRDCA does not do

  • It does not issue mandates and does not appear as an issuer.
  • It does not custody the human's key or the agent's key.
  • It does not revoke mandates: expiry and the nonce are the two levers.
  • It does not query the issuer during verification. The list and the material live in the verifier.

Next step