# What structural signals indicate a signed Agent Card has silently degraded across heterogeneous A2A v1.0 registries **Date of Record:** 2026 November 21 **Scope:** Applies to A2A v1.0 agent discovery where an orchestrator resolves an Agent Card from a registry that re-serializes, caches, or proxies the manifest before delivery, and where the card carries a detached signature over a canonicalized payload. Does not apply to direct point-to-point card fetches from the origin agent's well-known endpoint, nor to registries that serve the manifest byte-for-byte with the original signature intact. ## Core Distinction The failure is not "a bad signature was rejected." It is that a *valid* signature was accepted against a *re-canonicalized* payload that the registry reconstructed from a lossy intermediate representation, producing a card whose signature verifies but whose capability declarations no longer match the origin agent. The distinction that matters operationally: **signature validity and manifest fidelity are independent invariants**, and heterogeneous registries collapse them into one. A registry that parses a card into a typed object and re-emits it (JSON→protobuf→JSON, or YAML→dict→JSON, or a schema-validating proxy that fills defaults) will reorder keys, drop fields it does not model, coerce types, and inject default values. If the signature covers the canonical form of the *re-emitted* bytes, verification passes. If it covers the origin bytes, verification fails loudly—which is the *safe* outcome. The dangerous case is the one where the registry canonicalizes *after* mutation. ## What Was Observed An orchestrator resolved a planner agent through a federated registry chain (origin → regional cache → aggregator). The card declared `capabilities.streaming: true`, `capabilities.pushNotifications: false`, and a single `defaultInputModes: ["text/plain"]`. The aggregator modeled cards with a schema that (a) treated `pushNotifications` as optional with a default of `true`, (b) normalized `defaultInputModes` to a sorted set, and (c) dropped the `signature` extension block's `canonicalization` field because it was not in the aggregator's schema version. The re-emitted card carried `pushNotifications: true`. The signature block was re-attached and re-canonicalized by the aggregator using its *own* default canonicalization (JCS), which happened to match the origin's declared algorithm. The signature verified. The orchestrator, trusting verification, negotiated a push-notification channel the origin agent never implemented, and sent a streaming request the origin had actually disabled at the origin (the `streaming: true` was correct; the mismatch was the notification path). The handoff failed at execution time—not at negotiation time—because the origin responded `405` to the notification registration the orchestrator had every reason to believe was supported. The structural signal was present but ignored: the card's `signature.canonicalization` field was absent in the delivered manifest while the `signature.algorithm` was present. A card with a signature algorithm but no declared canonicalization is a card that was reconstructed by something that did not preserve the signing context. ## Condition of Validity The invariant holds only under this conjunction: 1. The signature covers a canonical byte sequence derived deterministically from the semantic payload, and the canonicalization algorithm is *declared inside the signed region* (so it cannot be swapped). 2. The verifying party recomputes canonicalization from the *received* payload, not from a cached or re-derived form, and compares against the declared algorithm. 3. The registry is a *transport*, not a *transformer*: any registry that parses and re-emits must either preserve unknown fields losslessly or decline to serve the card. When any of these is violated—specifically when the canonicalization declaration is outside the signed region or is dropped by an intermediate—signature verification degrades from a fidelity proof into a mere presence check. The condition of validity is therefore not "the signature verifies" but "the signature verifies against a payload whose canonicalization declaration is itself covered by the signature." ## Decision Boundary The boundary is between **reject-and-refetch** and **accept-with-downgrade**: - If the delivered card's signature block lacks a canonicalization declaration, or declares an algorithm the verifier cannot reproduce from the received bytes, the card is **structurally degraded** regardless of whether the signature mathematically verifies. Treat verification as inconclusive. - If the canonicalization declaration is present and covered by the signature, and the verifier reproduces it exactly, the card is **fidelity-attested** and may be trusted for capability negotiation. - If the registry cannot serve a fidelity-attested card, the orchestrator must fall back to the origin's well-known endpoint (direct fetch) rather than negotiate against the degraded card. Negotiating against a degraded card is strictly worse than failing discovery, because it defers the failure to execution time where rollback is expensive. The decision must be made *before* capability negotiation, on the card's structure, not on the outcome of the negotiation. ## Operational Effect Orchestrators that gate on signature-verifies-alone will, in heterogeneous federations, negotiate capabilities the origin does not possess and discover the mismatch only at first tool invocation, after task state has been allocated and context spent. The correct guardrail is a pre-negotiation structural check: assert that the canonicalization declaration is present, that it is inside the signed region, and that recomputation from received bytes reproduces the signature. Anything less is a presence check masquerading as a fidelity proof. ```python import json import hashlib from typing import Any class CardFidelityError(RuntimeError): """Raised when a delivered Agent Card's signature is structurally inconclusive.""" REQUIRED_SIGNED_FIELDS = ("canonicalization", "algorithm", "value") def _canonicalize_jcs(payload: dict[str, Any]) -> bytes: # Deterministic JSON canonicalization (RFC 8785 subset sufficient for this check). return json.dumps(payload, sort_keys=True, separators=(",", ":"), ensure_ascii=False).encode("utf-8") CANONICALIZERS = {"JCS": _canonicalize_jcs} def verify_card_fidelity(card: dict[str, Any]) -> bool: """ Returns True only if the card is fidelity-attested: the signature block declares its canonicalization INSIDE the signed region, and recomputation from the received bytes reproduces the signature. """ sig = card.get("signature") if not isinstance(sig, dict): raise CardFidelityError("card carries no signature block; cannot attest fidelity") for field in REQUIRED_SIGNED_FIELDS: if field not in sig: # This is the exact structural signature of a lossy re-emit: # algorithm present, canonicalization dropped by an intermediate schema. raise CardFidelityError( f"signature block missing required field '{field}'; " "card was likely reconstructed by a registry that did not preserve signing context" ) canon_name = sig["canonicalization"] if canon_name not in CANONICALIZERS: raise CardFidelityError(f"unsupported canonicalization '{canon_name}'") # The signed region excludes only the signature value itself. signed_region = {k: v for k, v in card.items() if k != "signature"} signed_region["signature"] = {k: v for k, v in sig.items() if k != "value"} recomputed = hashlib.sha256(CANONICALIZERS[canon_name](signed_region)).hexdigest() if recomputed != sig["value"]: raise CardFidelityError( "signature does not reproduce from received bytes; " "payload was mutated after signing or canonicalization was applied post-mutation" ) return True def negotiate_or_refetch(card: dict[str, Any], origin_well_known: str) -> dict[str, Any]: try: verify_card_fidelity(card) return card except CardFidelityError as exc: # Do NOT negotiate against a degraded card. Defer to origin fetch. raise CardFidelityError( f"registry-delivered card is not fidelity-attested ({exc}); " f"refetch directly from {origin_well_known} before capability negotiation" ) ```