View as Markdown

a2a · Reference

A2A delegation v1

Extension URI: https://www.provenanceauth.com/docs/a2a/delegation/v1

This page specifies how an agent hands a Provenance grant to another agent over A2A 1.0. The grant is the authority, bound to the receiver's key. The A2A request's own authentication, from the receiver's securitySchemes, stays the operator's credential. The URI is the extension's identifier and includes its version; a breaking change gets a new URI (A2A section 4.6.3). @provenanceauth/rails/a2a implements every shape below, and a working client and server are in examples/a2a-delegation/ in the Provenance repository.

The receiver's Agent Card

A receiver that accepts grants lists the extension in capabilities.extensions (A2A section 4.4.3, AgentExtension in section 4.4.4):

{
  "capabilities": {
    "extensions": [
      {
        "uri": "https://www.provenanceauth.com/docs/a2a/delegation/v1",
        "description": "Accepts Provenance grants bound to this agent's key, in Message.metadata under this URI.",
        "required": false,
        "params": {
          "holder_key": { "kty": "EC", "crv": "P-256", "x": "…", "y": "…" },
          "online_status_checks": true,
          "provenance_agent_id": "agt_…"
        }
      }
    ]
  }
}
ParamTypeMeaning
holder_keyP-256 public JWKThe key a grant handed to this agent is bound to (cnf.jkt). Never a private part
online_status_checksbooleanThe receiver checks each grant's status online before it acts
provenance_agent_idstring, optionalThe receiver's registered agent. A grantor then sees its registry name and operator, and its account gets incoming-grant records

Leave required false unless every request to the agent needs a grant.

Turning it on

The sender lists the URI in the A2A-Extensions request header (A2A section 3.2.6). A receiver that activates it lists the URI in the response's A2A-Extensions header, as the A2A extensions guide recommends.

The grant in the message

The sender gets the grant from Provenance with a hand-off to the receiver's key (see hand off to outside agents). It puts the grant in the message's metadata under the extension URI, and lists the URI in the message's extensions (A2A section 4.1.4):

{
  "messageId": "6f1c…",
  "role": "ROLE_USER",
  "parts": [{ "text": "Hold seat 14C on TP1351." }, { "data": { "flight": "TP1351", "seat": "14C", "fare": 420, "currency": "EUR" } }],
  "metadata": {
    "https://www.provenanceauth.com/docs/a2a/delegation/v1": {
      "grant_token": "eyJhbGciOiJFUzI1NiIsInR5cCI6Im1hbmRhdGUrand0Ii…",
      "handoff_id": "xho_…",
      "approval_id": "appr_…"
    }
  },
  "extensions": ["https://www.provenanceauth.com/docs/a2a/delegation/v1"]
}
FieldMeaning
grant_tokenThe grant (mandate+jwt), bound to the receiver's key
handoff_idThe Provenance hand-off it was minted from, optional
approval_idThe grantor's approval, optional

Checking the grant

The receiver accepts the grant only when all of these hold:

  1. It checks against Provenance's published JWKS: signature, expiry, and the limits for what is asked.
  2. Its cnf.jkt is the thumbprint of the receiver's own holder_key. A bearer grant, or one bound to another key, is refused.
  3. When the receiver declared online_status_checks, or the grant says status_check: "online", its status at GET /v1/public/grants/{id}/status is active.
import { acceptDelegation } from "@provenanceauth/rails/a2a";

const verdict = await acceptDelegation(message, { jwks, holderKey: myPublicKey, need: { amount: 420 }, online: true, apiBase: "https://api.provenanceauth.com" });

When the receiver acts at a store under the grant, it signs each request with its key (a DPoP proof), as bind a grant to its holder describes.

Asking for more

A receiver whose grant doesn't cover the request moves the task to TASK_STATE_AUTH_REQUIRED (A2A section 4.1.3). Its status message names what it needs under the extension URI:

{
  "state": "TASK_STATE_AUTH_REQUIRED",
  "message": {
    "role": "ROLE_AGENT",
    "parts": [{ "text": "I need a grant that covers 840." }],
    "metadata": { "https://www.provenanceauth.com/docs/a2a/delegation/v1": { "need": { "amount": 840, "currency": "EUR", "action_type": "purchase", "reason": "The fare for seat 2A is 840." } } },
    "extensions": ["https://www.provenanceauth.com/docs/a2a/delegation/v1"]
  }
}

The sender asks its grantor for a new grant through Provenance, then replies in the same task (taskId and contextId) with the new grant_token. The state itself authorizes nothing; only a signed grant does.

The receipt

The receiver's result artifact names what it did under the grant in its metadata under the extension URI (A2A section 4.1.7):

{ "https://www.provenanceauth.com/docs/a2a/delegation/v1": { "grant_id": "grt_…", "reference": "hold_8c2f…" } }
FieldMeaning
grant_idThe grant used
referenceThe receiver's own reference for what it did, optional
decision_id, receipt_idA Provenance decision or receipt, when the action went through Provenance, optional

Versions

URIA2AChanges
https://www.provenanceauth.com/docs/a2a/delegation/v11.0First version