# Where must an instance re-verify the Agent Card signature after a delegated envelope crosses a trust boundary? **Date of Record:** 2026 November 25 **Scope:** Applies to A2A v1.0 orchestrators that discover peer Agent Cards, cache them, and accept signed task-delegation envelopes whose `issuer` references a card fetched earlier. Does not apply to single-hop in-process tool calls or to transports where the envelope and card are co-delivered and co-verified in the same transaction. ## Core Distinction The distinction that matters is between *card authenticity at fetch time* and *card binding at delegation time*. A2A v1.0 lets a delegating agent embed a `card_ref` (a URI plus an ETag-like `card_digest`) inside a signed envelope so the receiver can resolve which Agent Card authorized the delegation. This is frequently read as "the envelope carries a pointer, the receiver fetches the card, verifies the envelope signature against the card's declared `signing_key`, done." That reading is wrong in a specific and dangerous way: it conflates *signature validity of the envelope* with *authorization of the capability claimed in the envelope*. The card digest is a commitment, but the receiver must decide whether the digest it resolves is the digest the *issuer* signed over, and whether the key that signed the envelope is the key that the *discovered* card currently publishes — two checks that can silently diverge when a card is rotated between discovery and delegation. ## What Was Observed An orchestrator (`O`) discovered a worker card `W@digest=d1`, cached it, and delegated a task with an envelope `E` signed by `W`'s key `k1`, embedding `card_ref=(uri_W, d1)`. Between discovery and delegation, `W` rotated its signing key to `k2` and republished the card as `W@digest=d2` at the same `uri_W`. The receiver `R`: 1. Verified `E`'s signature against `k1` — passed, because `k1` was genuinely `W`'s key at signing time. 2. Resolved `card_ref.uri_W`, fetched the *current* card, and got `d2`. 3. Compared `d2` to `card_ref.card_digest=d1` — mismatch — and, in the observed implementation, treated the mismatch as a *transient fetch inconsistency* and retried, then fell back to "trust the envelope signature" because the envelope was cryptographically intact. Result: `R` executed a delegated capability (`filesystem.write` scoped to `/sandbox/w`) under a card whose current `capabilities` no longer included `filesystem.write` (it had been revoked in the `d2` revision). The envelope was authentic; the *authorization* it implied was stale. The failure was not a signature forgery — it was a **digest-binding gap** where the receiver accepted a signed envelope as self-authorizing when the card it resolved had already revoked the very capability the envelope exercised. A second, subtler trace: when the issuer *pinned* the digest (`card_ref.card_digest=d1`) but the receiver's cache still held `d1` while the origin served `d2`, the receiver's cache-hit path skipped re-resolution entirely and never observed the revocation. Cache freshness and card authenticity were treated as the same axis; they are orthogonal. ## Condition of Validity The invariant that must hold for a delegated envelope to be safely executed is: > `verify(envelope.sig, key=resolve(card_ref).signing_key_at(card_ref.card_digest))` **AND** `card_ref.card_digest == digest(resolve(card_ref))` **AND** `envelope.capability ∈ resolve(card_ref).capabilities` All three conjuncts must be evaluated against *the same resolved card revision*. The observed failure violated the third conjunct because it was evaluated against a *different* revision than the first. This is only a valid check when the receiver performs a **single atomic resolution**: fetch the card, compute its digest, assert digest equals `card_ref.card_digest`, extract the key and capability set from *that same fetched bytes*, and verify the envelope against *that* key. Any implementation that resolves the card twice — once for key, once for capabilities — or that falls back to cache on digest mismatch, breaks the invariant. The condition of validity is therefore: *the digest comparison must be a gate, not a hint.* A digest mismatch is a hard stop, never a retryable transient. ## Decision Boundary The decision boundary is between **rotation-tolerant** and **rotation-revoking** card semantics. If `W` publishes a card where key rotation is *additive* (old keys remain valid for envelopes signed before the rotation timestamp, and the capability set is monotone non-decreasing across revisions), then a receiver may safely accept an envelope whose `card_digest` is an ancestor of the current digest, provided it verifies against the historical key and the historical capability set. If rotation is *revoking* (capabilities can be removed, keys retired), then the receiver must treat any `card_digest != current_digest` as authorization failure and re-delegate through a fresh discovery. The boundary is not "is the signature valid" — it is "does the card's revision policy permit historical authorization to remain binding." A2A v1.0 does not mandate which policy a card uses; it only provides the digest commitment. The receiver must therefore *learn* the policy from the card's declared `revision_semantics` field (or fail closed if absent), and the orchestrator must not delegate across a revision it cannot classify. ## Operational Effect Operationally, this means the receiver's card-resolution step must be a **fail-closed, single-shot, atomic** operation with no cache fallback on digest mismatch and no retry that could observe a different revision. The orchestrator, in turn, must not cache cards across a delegation window longer than the card's declared `max_staleness`; if it does, it must re-resolve at delegation time and re-sign the envelope against the freshly resolved digest, or abort the delegation. The practical guardrail is a **digest-pinned envelope**: the envelope's `card_ref.card_digest` is the *only* acceptable card revision, and the receiver refuses execution (not retries) on any mismatch, surfacing a `CardRevisionRevoked` condition to the orchestrator so it can re-discover and re-delegate. The cost is a re-delegation round-trip on rotation; the benefit is that a revoked capability cannot be exercised through a stale-but-authentic envelope. ```python class CardRevisionRevoked(RuntimeError): """Raised when an envelope's pinned card digest does not match the resolved card, and the card's revision semantics do not permit historical authorization.""" class CardResolutionError(RuntimeError): """Raised when the Agent Card cannot be resolved atomically for verification.""" def execute_delegated_envelope(envelope, card_resolver, revision_semantics): """ Execute a signed A2A task-delegation envelope under a single atomic card resolution. Invariant: signature key, capability set, and digest commitment MUST all be evaluated against the SAME resolved card revision. A digest mismatch is a hard stop, never a retryable transient. """ card_ref = envelope["card_ref"] pinned_digest = card_ref["card_digest"] # Single atomic resolution: fetch bytes once, derive everything from them. try: card_bytes = card_resolver.fetch(card_ref["uri"]) except Exception as exc: raise CardResolutionError( f"cannot resolve card {card_ref['uri']}: {exc}" ) from exc resolved_digest = card_resolver.digest(card_bytes) if resolved_digest != pinned_digest: # Digest mismatch. Decide based on declared revision semantics. if revision_semantics == "additive": # Historical authorization may remain binding; verify against # the pinned revision's key and capability set, which the # resolver must be able to retrieve by digest. historical = card_resolver.fetch_by_digest(card_ref["uri"], pinned_digest) if historical is None: raise CardRevisionRevoked( f"pinned digest {pinned_digest} no longer retrievable; " f"current={resolved_digest}" ) card = historical else: # revoking (or unclassified) semantics: fail closed, do not execute. raise CardRevisionRevoked( f"envelope pins card digest {pinned_digest} but origin serves " f"{resolved_digest} under '{revision_semantics}' semantics; " f"re-delegate through fresh discovery" ) else: card = card_resolver.parse(card_bytes) # All three conjuncts evaluated against the SAME card object. signing_key = card["signing_key"] if not envelope.verify_signature(signing_key): raise CardResolutionError("envelope signature invalid against resolved card key") claimed_cap = envelope["capability"] if claimed_cap not in card["capabilities"]: raise CardRevisionRevoked( f"capability '{claimed_cap}' not present in resolved card revision " f"{resolved_digest}; envelope is authentic but unauthorized" ) return envelope.execute() ```