# Which invariants prevent signed Agent Card capability negotiation from silently degrading to unsigned delegation after a key rotation in A2A v1.0 **Date of Record:** 2026 November 21 **Scope:** Applies to A2A v1.0 cross-vendor task delegation where a client agent discovers a remote Agent Card from a well-known endpoint, verifies its signature against a pinned issuer key, and negotiates capabilities (`skills`, `capabilities.streaming`, `capabilities.pushNotifications`, `defaultInputModes`) before dispatch. Does not cover intra-tenant delegation where the card and client share a key-management domain, nor MCP tool-schema negotiation, which has no card-signature layer. ## Core Distinction The failure is not "signature verification failed." The failure is "signature verification was *skipped* because discovery succeeded by a path that never required it." A2A v1.0 permits an Agent Card to be fetched from `/.well-known/agent-card.json` and, in the absence of a resolvable signature, the client may treat the card as *advisory*. Most client implementations encode this as: verify if a signature block is present; if absent, proceed with the declared capabilities as a best-effort hint. That branch is correct for first-contact discovery. It is catastrophic when it silently re-fires *after* a key rotation, because the remote has republished its card under a new `kid` that the client's pinned keyring cannot resolve — and a client that treats "unresolvable key" the same as "no signature" will downgrade from verified delegation to unsigned delegation without emitting a single error. The invariant that must hold: **the security posture of a delegation is a property of the client's pinned trust state, not of the card's self-declared signing block.** A card's `signatures[]` array is attacker-controllable data. Whether the client *requires* a valid signature before honoring `capabilities` is a client-side policy that must be latched at session start and must never be relaxed by the content of a later card. ## What Was Observed A client agent (vendor A) pins issuer key `kid=a1` for remote agent (vendor B) after an out-of-band registration. Delegation works for weeks. Vendor B rotates signing keys: it publishes a new card at `/.well-known/agent-card.json` signed with `kid=b2`, and — critically — its JWKS endpoint at `/.well-known/jwks.json` is now serving only `b2`. Vendor A's keyring has `a1` only. Trace: 1. Client fetches card. Card parses. `signatures[0].protected.kid == "b2"`. 2. Client resolves `b2` against pinned keyring → miss. 3. Client attempts JWKS fetch to resolve `b2` fresh. Vendor B's JWKS serves `b2`. Client *could* verify — but only if its policy permits trust-on-first-use for rotated keys, which the strict profile forbids. The permissive profile permits it. 4. Under the permissive profile, verification succeeds against a key the client never pinned. The card's `capabilities.streaming: true` and a newly added `skills[]` entry are accepted. 5. Delegation proceeds. The client now sends tasks to a remote whose signing identity it never anchored, and honors a capability set (`streaming`, new skill) that the pinned `a1`-era card never declared. The dangerous sub-case is step 3 failing entirely (JWKS unreachable, or `b2` not yet propagated across B's CDN). Then the client has a card with a `kid` it cannot resolve. Implementations that conflate "signature present but unverifiable" with "no signature" fall through to advisory mode and *still delegate*, now with zero cryptographic binding. The card's declared `capabilities` are honored, the `skills` are trusted, and the only artifact distinguishing this from a MITM is a log line at `DEBUG`. ## Condition of Validity The downgrade is only reachable when three conditions co-occur: - The client's discovery path has an advisory fallback (card accepted without verified signature). - The client's key-resolution path is *lazy* — it resolves `kid` at verification time rather than binding the expected `kid` at session start. - The remote republishes a card whose `kid` is not in the client's pinned set, whether by rotation (benign) or by substitution (adversarial). Remove any one and the downgrade is bounded. A client with no advisory fallback fails closed on unresolvable `kid`. A client that binds `kid` at session start rejects any card whose `kid` differs from the bound value, rotation notwithstanding. A remote that never rotates never triggers it. The invariant is therefore: **capability negotiation must be gated on a signature whose `kid` equals the `kid` bound at trust-establishment time, and the advisory fallback must be unreachable once a binding exists.** Rotation is handled by an explicit re-pin event, not by lazy JWKS resolution during delegation. ## Decision Boundary The boundary is between two legitimate policies that look identical in code: - *First-contact policy:* no binding exists → accept card as advisory, record `kid`, require out-of-band confirmation before privileged delegation. - *Bound-session policy:* binding exists → any card whose `kid` ≠ bound `kid` is a hard failure; any card whose signature cannot be verified against the bound key is a hard failure; the advisory fallback is disabled. The bug is that most clients implement one function `verify_or_advisory(card)` and call it on every discovery, so the bound-session policy never exists as a distinct code path. The decision boundary is: *does the client know it has a binding?* If yes, it must never enter advisory mode. If no, advisory mode is correct but must not confer privileged capabilities (`streaming`, `pushNotifications`, write-scoped skills) until a binding is established. Concretely, the client must refuse to honor any capability that was not present in the card at binding time, unless a re-pin event has occurred. A rotated card that adds `skills[]` entries must not have those skills honored until re-pin — otherwise an attacker who can rotate a key (or a compromised remote) can inject a new skill into an already-trusted relationship and have it invoked under the old trust. ## Operational Effect Without the invariant: silent capability escalation across a key rotation. The client delegates tasks to a remote identity it never anchored, honors capabilities the pinned card never declared, and the only evidence is a missing `kid` in a keyring lookup. Downstream, task results are attributed to a trust relationship that does not exist, and audit logs show a successful delegation with no signature failure — because from the client's perspective, verification "succeeded" against a lazily fetched key. With the invariant: the rotation surfaces as a hard `KeyBindingMismatch` at delegation time, the client halts, and a re-pin ceremony is required before any capability from the new card is honored. The failure is loud, bounded, and attributable to a specific `kid` transition. The guardrail is a latched trust state object, created at binding time, carrying the bound `kid` and the exact capability set from the bound card. Every subsequent discovery compares against it and refuses to widen. The code below enforces that latch and raises on any attempt to honor a capability outside the bound set or to verify against a `kid` other than the bound one. ```python from dataclasses import dataclass, field class KeyBindingMismatch(RuntimeError): """Raised when a discovered Agent Card's signing kid or declared capabilities diverge from the trust state latched at binding time.""" @dataclass(frozen=True) class TrustState: bound_kid: str bound_capabilities: frozenset bound_skills: frozenset @dataclass class AgentCard: kid: str capabilities: dict skills: list signature_verified: bool def negotiate(card: AgentCard, trust: TrustState | None) -> dict: # First contact: no binding. Advisory only; privileged caps withheld. if trust is None: return { "mode": "advisory", "capabilities": { k: v for k, v in card.capabilities.items() if k not in ("streaming", "pushNotifications") }, "skills": [], } # Bound session: kid must match the latched binding exactly. if card.kid != trust.bound_kid: raise KeyBindingMismatch( f"card kid {card.kid!r} != bound kid {trust.bound_kid!r}; " "lazy JWKS resolution or rotation without re-pin" ) # Bound session: signature must verify against the bound key. if not card.signature_verified: raise KeyBindingMismatch( f"card kid {card.kid!r} present but unverified; " "advisory fallback is disabled once a binding exists" ) # Bound session: capabilities may narrow, never widen. declared = frozenset(card.capabilities) if not declared <= trust.bound_capabilities: widened = declared - trust.bound_capabilities raise KeyBindingMismatch( f"capability escalation across rotation: {sorted(widened)!r} " "not present in bound card" ) declared_skills = frozenset(card.skills) if not declared_skills <= trust.bound_skills: injected = declared_skills - trust.bound_skills raise KeyBindingMismatch( f"skill injection across rotation: {sorted(injected)!r} " "requires explicit re-pin" ) return { "mode": "verified", "capabilities": dict(card.capabilities), "skills": list(card.skills), } ```