# Where must an instance re-verify a peer's signed Agent Card before honoring a delegated capability claim in A2A v1.0? **Date of Record:** 2026 November 19 **Scope:** Applies to A2A v1.0 task delegation where the caller relies on a peer's advertised `AgentCard` (skills, capabilities, security schemes) to authorize a signed task envelope. Does not cover intra-instance tool invocation, MCP server capability handshakes, or unsigned/best-effort discovery channels. ## Core Distinction The failure mode is not "the peer lied about a capability" in the abstract. It is the **temporal decoupling between Agent Card discovery and signed-envelope verification**. In A2A v1.0, the `AgentCard` is fetched out-of-band (well-known URI, registry, or cached handshake) and is *not* embedded in the task envelope's signed payload. The envelope signature covers the task body, the `taskId`, the caller identity, and the requested skill ID — but **not the capability metadata the caller used to decide the delegation was legal**. This means the invariant "the capability I verified is the capability I invoked" is not cryptographically enforced by the protocol; it is only enforced by the caller's re-verification discipline. The distinction that matters operationally: a *signature-valid* envelope can be *capability-invalid* against the current card, and the protocol will not tell you. Signature verification and capability verification are orthogonal checks over disjoint artifacts (envelope vs. card), and the gap between them is where stale-card delegation, card-swap race, and post-revocation invocation live. ## What Was Observed In a three-instance delegation chain (Orchestrator → Planner → Executor), the Orchestrator fetched the Executor's Agent Card at cold start (T0), cached it, and used `skills[].id == "code.execute.sandboxed"` plus `capabilities.securitySchemes == ["jws-envelope-v1"]` to justify routing a high-privilege task. At T0+41min the Executor's operator rotated its card: `code.execute.sandboxed` was demoted to `code.execute.untrusted` (no sandbox attestation), and the `jws-envelope-v1` scheme was replaced with `jws-envelope-v2` requiring a nonce. The Executor kept accepting v1 envelopes for a 30-minute drain window — correct behavior for in-flight tasks. The Orchestrator, holding the T0 card, continued to mint v1 envelopes claiming `code.execute.sandboxed`. The Executor's envelope verifier checked: signature valid, `taskId` fresh, caller authorized, requested skill ID present in the *envelope*. It did **not** re-check that the envelope's claimed skill matched its *current* card tier. Result: a task the Executor would now refuse under its own card was executed because the claim arrived pre-blessed by a stale peer. Trace of the failure: 1. T0: Orchestrator fetches card C0. Caches `{skill: code.execute.sandboxed → sandboxed, scheme: v1}`. 2. T0+41m: Executor publishes C1 (`code.execute.sandboxed → untrusted`, scheme `v2`). Retains v1 acceptance for drain. 3. T0+52m: Orchestrator mints envelope E with `requestedSkill: code.execute.sandboxed`, `scheme: v1`, signs with caller key. 4. Executor verifies E: signature ✓, taskId ✓, caller ✓, skill-in-envelope ✓. **Does not consult C1.** Executes under its *current* runtime policy, which still maps the skill string to the sandboxed path because the demotion was expressed in the card, not the runtime. 5. The mismatch surfaces only when the audit replay compares the envelope's declared capability tier against the card version in effect at execution time — and finds the envelope asserts a tier the card had already revoked. The non-obvious part: **both sides behaved correctly against their local view.** The Orchestrator honored its cached card faithfully. The Executor honored its envelope verifier faithfully. The failure is purely in the *unverified join* between the two. ## Condition of Validity Re-verification of the peer card is mandatory — not merely advisable — when **any** of the following hold, and the envelope must carry the evidence: - The cached card's `version` or `etag` is older than the envelope's `issuedAt` minus the card's advertised `cacheMaxAge`. If the card declares no `cacheMaxAge`, treat the cache as valid only for the duration of a single task, never across tasks. - The requested skill's `tier` or `attestation` field is load-bearing for the caller's own authorization decision (i.e., the caller would not have delegated without it). Capability claims that gate privilege must be re-fetched, not cached. - The envelope's `scheme` differs from the card's current `securitySchemes[0]`. Scheme drift is the leading indicator that the card rotated. - The task is idempotency-critical or audit-replayable: any envelope whose execution will be replayed against a card snapshot must embed that snapshot's `cardVersion` and `cardDigest` so the replay can detect the join. The invariant to enforce: **an envelope may only assert a capability tier that the caller has verified against a card whose digest is bound into the envelope.** If the digest is absent, the envelope is capability-unverifiable and must be treated as `untrusted` regardless of signature validity. ## Decision Boundary The boundary is between *drain-window tolerance* and *capability laundering*. A drain window (Executor keeps accepting old-scheme envelopes briefly) is legitimate continuity behavior. But it becomes a laundering channel the moment the Orchestrator uses a stale card to assert a tier the Executor has already revoked. The protocol cannot distinguish these because the envelope carries the *claim* and the card carries the *truth*, and nothing joins them. Operational rule: on any envelope whose declared skill tier exceeds the caller's cached card tier, the caller must perform a **synchronous card re-fetch with digest comparison** before signing. If re-fetch fails or the digest mismatches the cached value, the caller must downgrade the envelope to the highest tier both card versions agree on, or refuse. The Executor, symmetrically, must reject any envelope whose embedded `cardDigest` does not match a card version it currently honors — this closes the drain window to envelopes that *declared* the old card, rather than accepting any v1 envelope blindly. ## Operational Effect With card-digest binding, the T0+52m envelope in the trace would have embedded `cardDigest: C0`. The Executor, now on C1, would reject it as `StaleCardDigest` rather than execute it — forcing the Orchestrator to re-fetch, observe the demotion, and either downgrade or escalate. Without it, the system silently executes revoked-capability tasks for the full drain window, and the only detector is post-hoc audit replay. The cost of the guardrail is one extra card fetch per privilege-gating delegation; the cost of its absence is an unbounded window in which capability revocation is advisory rather than enforced. ```python import hashlib from dataclasses import dataclass class StaleCardDigest(RuntimeError): """Raised when an envelope asserts a capability tier bound to a card version the executor no longer honors.""" @dataclass(frozen=True) class AgentCard: version: str skill_tiers: dict # skill_id -> tier string schemes: tuple # e.g. ("jws-envelope-v2",) def digest(self) -> str: body = f"{self.version}|{sorted(self.skill_tiers.items())}|{self.schemes}" return hashlib.sha256(body.encode()).hexdigest() @dataclass(frozen=True) class TaskEnvelope: task_id: str requested_skill: str claimed_tier: str scheme: str card_digest: str | None # digest of the card the caller verified against def verify_envelope(env: TaskEnvelope, honored: AgentCard) -> None: """Executor-side gate: envelope must bind to a currently-honored card, and its claimed tier must not exceed that card's tier for the skill.""" if env.card_digest is None: # capability-unverifiable: signature may be valid, tier is not raise StaleCardDigest( f"envelope {env.task_id} carries no card_digest; " f"capability claim for {env.requested_skill!r} is unverifiable" ) if env.card_digest != honored.digest(): raise StaleCardDigest( f"envelope {env.task_id} bound to card digest {env.card_digest[:12]} " f"but executor honors {honored.digest()[:12]} (version {honored.version})" ) current_tier = honored.skill_tiers.get(env.requested_skill) if current_tier is None: raise StaleCardDigest( f"skill {env.requested_skill!r} absent from honored card {honored.version}" ) if env.claimed_tier != current_tier: raise StaleCardDigest( f"envelope {env.task_id} claims tier {env.claimed_tier!r} for " f"{env.requested_skill!r}; honored card grants {current_tier!r}" ) if env.scheme not in honored.schemes: raise StaleCardDigest( f"envelope {env.task_id} uses scheme {env.scheme!r} not in " f"honored schemes {honored.schemes}" ) ```