# What happens when an instance trusts a cached Agent Card after the remote signer rotates its JWKS **Date of Record:** 2026 November 20 **Scope:** Applies to A2A v1.0 cross-org task delegation where the calling agent (delegator) discovers a remote Agent Card, caches it, and subsequently signs task envelopes against the `jwks_uri` advertised in that card. Does not apply to same-org trust domains where JWKS is served from a shared control plane, nor to push-notification webhook verification (separate signing path). ## Core Distinction Agent Card discovery and task-envelope signing are two logically separate trust operations that A2A v1.0 *couples* through a single cached document. The card contains both (a) capability/schema metadata used for planning, and (b) `jwks_uri` + `signing_keys`, used to verify the remote agent's signed task acceptance and to bind the delegator's own signed envelope to a specific key. Caching the card for capability-planning reasons (hours to days, to avoid re-fetch latency in a swarm) silently extends the lifetime of the *signing* material. The failure boundary is not "the card is stale" — it is that **the delegator verifies the remote's signed task-acceptance against a key set it fetched before a rotation it never observed**, producing a signature-verification outcome that is neither a clean accept nor a clean reject: it is a *stale-accept* on the old kid combined with a *hard-fail* on the new kid, and A2A does not specify which wins when both keys are present in the cached card. ## What Was Observed Delegator `A` (org α) discovered Agent Card for remote `B` (org β) at `T0`. Card advertised `jwks_uri: https://b.example/.well-known/jwks.json`, `signing_keys: [kid_b1]`, `card_version: 3`, `card_ttl: 3600`. `A` cached the full card for 24h (its own planning cache policy, not the card's TTL). At `T0+6h`, β rotated its signing key: new kid `kid_b2` became active, `kid_b1` moved to `retired` but was **retained in the JWKS for a 72h grace window** (a common, well-intentioned rotation practice). The card was republished with `signing_keys: [kid_b2]`, `card_version: 4`. At `T0+9h`, `A` dispatched a signed task envelope. `B` accepted and returned a signed task-acceptance signed with `kid_b2`. `A`'s verifier: 1. Looked up `kid_b2` in its **cached card's** `signing_keys` → not present → attempted JWKS fetch from cached `jwks_uri`. 2. JWKS fetch succeeded, returned `{kid_b1 (retired), kid_b2 (active)}`. 3. Verifier accepted `kid_b2` because it was in the *live JWKS*, but did **not** re-validate that `kid_b2` was authorized by the *card's* `signing_keys` list — it treated JWKS presence as sufficient authorization. Result: the task was accepted and executed, but `A`'s audit trail recorded the delegation as authorized under `card_version: 3` while the actual signing key (`kid_b2`) was only ever authorized under `card_version: 4`. The two records the two orgs hold disagree on *which card version authorized the transaction*. This is a **card-version/key-authorization split** — a continuity invariant violation, not a cryptographic failure. Both signatures verify. The authorization lineage is broken. A second, sharper variant: at `T0+9h` β had *revoked* `kid_b1` (compromise, not retirement) and republished JWKS with only `kid_b2`. `A`'s cached card still listed `kid_b1`. A malicious or buggy peer presenting a `kid_b1`-signed acceptance would still verify against the cached card's `signing_keys` if `A`'s verifier trusted the *card* over the *live JWKS*. Two verifiers in the same fleet, one trusting card-first and one trusting JWKS-first, produced **opposite accept/reject decisions on the same signed message**. ## Condition of Validity The invariant that must hold for safe cross-org delegation is: > *The key that verifies a task-acceptance must be authorized by the same card version whose capability metadata the delegator used to plan the task.* This holds only when the verifier binds `(card_version, kid)` atomically. It fails whenever: - Card cache TTL > remote rotation interval (the common case: cards cached for planning, keys rotated on security cadence). - The remote retains retired keys in JWKS for a grace window (correct security practice, but it makes "present in JWKS" a weaker predicate than "authorized by current card"). - The verifier's fallback path (card → JWKS) does not re-check the card's `signing_keys` list against the fetched JWKS, i.e., treats the two as an OR rather than requiring the JWKS key to also appear in the card's authorized set. The condition is *not* satisfied merely by fetching the live JWKS. Fresh keys do not imply fresh authorization. ## Decision Boundary The delegator must choose, per task, between two bounded behaviors and must never straddle them: - **Re-fetch-on-mismatch:** if the verifying `kid` is absent from the cached card's `signing_keys`, re-fetch the Agent Card (not just JWKS), require `card_version` to have advanced, and re-authorize the `kid` against the *new* card before accepting. Cost: one extra round-trip on rotation events only. - **Hard-reject-on-mismatch:** if `kid ∉ cached_card.signing_keys`, reject the acceptance and surface a `CardKeyAuthorizationMismatch` to the orchestrator, forcing an explicit re-discovery. Cost: task failure on rotation, but no lineage ambiguity. The forbidden third behavior — the one observed in the field — is **JWKS-fallback-accept**: fetch JWKS, verify the signature, accept without re-binding to card version. This is the boundary violation. The decision boundary is exactly: *does the verifier require the verifying key to be a member of the current card's authorized set, or does it accept JWKS membership as a substitute?* Only the former preserves the invariant. Additionally, the delegator must record in its audit envelope the `card_version` and `kid` it authorized against, and the remote must reject any acceptance whose `kid` is not in the card version the delegator claims — closing the loop in both directions. ## Operational Effect - **Silent authorization drift:** delegations succeed across a rotation, so no error surfaces; the drift is only detectable by reconciling `card_version` in both orgs' audit logs. In a multi-agent swarm this compounds: N delegators each cached at different times produce N different "authorizing card versions" for the same remote, and no two audit trails agree. - **Split-brain verification:** two verifiers with different fallback policies (card-first vs JWKS-first) return opposite decisions on the same signed envelope, which in an auditor/executor topology causes the auditor to flag a task the executor already committed — a consensus deadlock at the verification layer, not the coordination layer. - **Revocation blind spot:** a compromised retired key remains acceptable to any delegator whose cached card predates the revocation, for the full cache TTL. The 72h JWKS grace window and a 24h card cache compose to a window where a revoked key still verifies against a stale card. - **Mitigation invariant:** bind `(card_version, kid)` atomically at verification; treat JWKS as a *lookup* for keys the card already authorized, never as an *authorization source*; on any `kid`/card mismatch, force card re-discovery and reject-by-default until re-authorized. ```python import hashlib from dataclasses import dataclass class CardKeyAuthorizationMismatch(RuntimeError): """Raised when a verifying kid is not authorized by the card version the delegator planned against.""" pass @dataclass(frozen=True) class CachedCard: card_version: int signing_keys: frozenset # kids authorized by THIS card version jwks_uri: str @dataclass(frozen=True) class SignedAcceptance: kid: str card_version_claimed: int signature: bytes def verify_acceptance( card: CachedCard, acceptance: SignedAcceptance, live_jwks: dict, # kid -> public key, fetched live (may contain retired/revoked keys) signature_valid: bool, ) -> None: # Invariant: the verifying kid MUST be authorized by the SAME card version # the delegator used to plan the task. JWKS membership alone is NOT authorization. if acceptance.card_version_claimed != card.card_version: raise CardKeyAuthorizationMismatch( f"acceptance claims card_version={acceptance.card_version_claimed}, " f"delegator planned against card_version={card.card_version}" ) if acceptance.kid not in card.signing_keys: # The key is not authorized by the card we planned against. Even if it is # present in the live JWKS (retired-key grace window or rotation), we must # NOT fall back to JWKS-as-authorization. Force re-discovery. raise CardKeyAuthorizationMismatch( f"kid={acceptance.kid} not in authorized signing_keys " f"{sorted(card.signing_keys)} for card_version={card.card_version}; " f"present_in_live_jwks={acceptance.kid in live_jwks}. " f"Re-discover Agent Card before accepting." ) if not signature_valid: raise CardKeyAuthorizationMismatch( f"signature invalid for kid={acceptance.kid} under card_version={card.card_version}" ) # Lineage record: the (card_version, kid) pair that authorized this delegation. lineage = hashlib.sha256( f"{card.card_version}:{acceptance.kid}".encode() ).hexdigest() return lineage ```