# What structural signals indicate an Agent Card is stale: TTL-less discovery caching and the cross-org delegation handshake divergence in A2A v1.0 **Date of Record:** 2026 November 26 **Scope:** Applies to A2A v1.0 task delegation where a client agent discovers a remote agent via an Agent Card fetched over HTTP, caches it, and then initiates a `tasks/send` handshake across organizational boundaries. Does not apply to same-process or single-tenant deployments where the card is co-located with the executor and cannot drift. ## Core Distinction The A2A v1.0 Agent Card is a *descriptive* artifact: it declares `name`, `description`, `url`, `capabilities`, `skills`, `defaultInputModes`, `defaultOutputModes`, and `securitySchemes`. It carries no mandatory versioning field and no mandatory expiry. The spec treats it as a discovery hint, not a contract. The failure mode is not "the card is wrong at fetch time"—it is that **the card is correct at fetch time and wrong at delegation time**, and the handshake has no mechanism to detect the delta. The structural signal that distinguishes a *stale* card from a *diverged* card is subtle and is the subject of this record: a stale card points at a URL that still resolves and still returns a card, but the returned card's `skills` set is a strict superset or subset of the cached one, and the `securitySchemes` identifiers have rotated while the scheme *types* have not. A diverged card (a genuinely different agent now squatting the endpoint) changes the `name` or `provider.organization` field. Caching layers that key only on URL and TTL cannot tell these apart, and the two require opposite remediation: stale → re-negotiate; diverged → abort and re-discover. ## What Was Observed A client orchestrator (org A) discovered a billing-reconciliation agent (org B) at `https://billing.partner.example/a2a`. The card advertised two skills: `reconcile_invoice` and `issue_credit_memo`, with `securitySchemes: {"oauth2_partner": {type: "oauth2", flows: {...}}}`. Org A cached the card with a 24h TTL and a warm pool of three pre-authenticated task sessions. Seventeen hours later, org B shipped a change: `issue_credit_memo` was split into `issue_full_credit` and `issue_partial_credit` (different input schema — `amount` became required), and the OAuth2 client was rotated, keeping the scheme *name* `oauth2_partner` but changing the token endpoint and audience. The card URL was unchanged. The handshake trace: 1. Org A's dispatcher selects `issue_credit_memo` from its cached skill list and constructs a `tasks/send` with `message.parts[0].data = {invoice_id, amount}` — note it sent `amount` because the *old* skill tolerated it as optional. 2. The request reaches org B's gateway. The gateway validates the bearer token first. The token is signed for the old audience. Gateway returns `401` with `WWW-Authenticate: Bearer error="invalid_token"`. 3. Org A's transport layer classifies `401` as *transient auth failure*, not *capability failure*. It refreshes the token via the cached token endpoint, which now 404s (rotated). The refresh retry loop has a 3-attempt budget. 4. Attempt 2 uses the same cached token endpoint; same 404. Attempt 3 same. The dispatcher marks the *task* failed with `AUTH_REFRESH_EXHAUSTED` and, critically, **does not invalidate the cached Agent Card**, because the card was never the thing that returned the error. 5. A second task for the same skill is dispatched 40 seconds later from the warm pool. It repeats steps 1–4. Over the next 6 hours, 214 tasks fail identically. The card cache TTL never expires because each failure resets the "last successful contact" clock in the orchestrator's health bookkeeping — a bug where `401` is treated as *reachable*. The divergence was only caught when a human noticed the reconciliation backlog. The card had been *stale for 17 hours before first use* and *wrong for 6 hours of active use*, and no structural signal in the handshake surfaced either fact. The deeper observation: when the human forced a re-fetch, the new card was *byte-identical in `name`, `url`, `provider`, and `capabilities`*, and differed only in `skills[].id` and `securitySchemes.oauth2_partner.flows.clientCredentials.tokenUrl`. A naive re-fetch-and-diff on the `name` field would have concluded "no change." ## Condition of Validity The invariant that must hold for cross-org delegation to be safe is: > **The skill identifier and its input schema, plus the security scheme's concrete endpoints, must be re-validated at the moment of delegation, not at the moment of discovery, whenever the delegation crosses an organizational trust boundary.** This invariant is *not* satisfied by any of the following, each of which is commonly assumed to be sufficient: - **TTL-based caching.** A TTL bounds staleness in *time*, not in *change events*. Org B's rotation was instantaneous and TTL-invisible. - **Card `name`/`url` stability checks.** These fields are the most stable in practice; they are the *least* diagnostic. - **HTTP reachability.** A `401` proves the endpoint is alive and the card's `url` is correct. It proves nothing about skill compatibility. - **OAuth token refresh success.** A successful refresh proves the token endpoint still works; it does not prove the *audience* or *scopes* still map to the skill you intend to invoke. The invariant *is* satisfied by binding the delegation request to a **card fingerprint** computed over the semantically load-bearing fields (`skills[].id` set, each skill's `inputSchema`, and the resolved `tokenUrl`/`audience` of each security scheme), carried in a request header (e.g., `A2A-Card-Fingerprint`), and having the remote gateway reject with a distinct `409 CARD_FINGERPRINT_MISMATCH` when the presented fingerprint does not match the currently served card. The spec does not mandate this header; it must be layered on as an extension. Without it, the client cannot distinguish "my cache is stale" from "the remote is broken" from "I am being attacked." ## Decision Boundary The operational decision boundary is between **re-negotiation** and **abort**: | Signal at delegation time | Classification | Action | |---|---|---| | `409 CARD_FINGERPRINT_MISMATCH`, re-fetch shows same `provider.organization` and `name` | Stale cache | Re-fetch card, recompute fingerprint, re-negotiate security scheme, retry once | | `409 CARD_FINGERPRINT_MISMATCH`, re-fetch shows different `provider.organization` or `name` | Diverged / possible hijack | Abort, quarantine endpoint, alert | | `401` with `invalid_token` after a *successful* refresh | Scheme rotation without fingerprint change | Treat as stale; force re-fetch; do **not** retry more than once | | `404` on cached `tokenUrl` | Scheme endpoint moved | Stale; force re-fetch; never retry the old endpoint | | `422` on `tasks/send` citing unknown `skill.id` | Skill set changed | Stale; re-fetch; re-run skill selection | | All of the above, twice within one task | Persistent divergence | Abort; do not loop | The trap is treating `401`/`404`/`422` as *transport* errors and routing them to the retry-with-backoff path. They are *semantic* errors about the card, and the retry path is precisely what burns the token-refresh budget and resets health clocks. The correct routing is: any of these four codes on a cross-org delegation must trigger card re-fetch *before* any retry, and the re-fetch result must be diffed on the fingerprint fields, not on `name`. ## Operational Effect Without the fingerprint binding, the failure is silent, self-reinforcing, and misattributed. The orchestrator's metrics show rising `AUTH_REFRESH_EXHAUSTED` counts, which on-call engineers read as "partner auth is flaky" — a plausible and wrong diagnosis that delays remediation by hours. The warm pool amplifies the failure because each pooled session independently re-attempts the stale handshake, so the blast radius scales with pool size rather than task volume. With the fingerprint binding, the first delegation after rotation fails fast with a *distinguishable* code, the client re-fetches, diffs the fingerprint fields, classifies stale-vs-diverged, and either re-negotiates in one round-trip or quarantines. The failure becomes a single observable event per rotation rather than a multi-hour background bleed, and the on-call signal points at the card, not at auth. The general principle: **in any discovery-then-delegate protocol, the discovery artifact's semantically load-bearing fields must be re-asserted at delegation time, because discovery and delegation are separated by an unbounded, event-driven interval that no TTL can bound.** The Agent Card's stability in `name`/`url` is a trap: it is the field humans and naive diffs check, and it is the field that changes least. ```python import hashlib import json from dataclasses import dataclass from typing import Any class CardFingerprintMismatch(RuntimeError): """Raised when the served Agent Card no longer matches the cached fingerprint.""" class CardDivergence(CardFingerprintMismatch): """Raised when re-fetch shows a different organization/name — possible hijack.""" @dataclass(frozen=True) class CardFingerprint: digest: str organization: str name: str def compute_fingerprint(card: dict[str, Any]) -> CardFingerprint: """Fingerprint over semantically load-bearing fields only. Deliberately excludes 'description' and 'capabilities' (which churn harmlessly) and includes skill ids + input schemas + resolved security endpoints (which are the fields whose drift breaks delegation). """ skills = sorted( (s["id"], json.dumps(s.get("inputSchema", {}), sort_keys=True)) for s in card.get("skills", []) ) schemes = sorted( (name, json.dumps(spec.get("flows", {}), sort_keys=True)) for name, spec in card.get("securitySchemes", {}).items() ) payload = json.dumps( {"skills": skills, "securitySchemes": schemes}, sort_keys=True ).encode() return CardFingerprint( digest=hashlib.sha256(payload).hexdigest(), organization=card.get("provider", {}).get("organization", ""), name=card.get("name", ""), ) def verify_delegation( cached: CardFingerprint, served_card: dict[str, Any], response_status: int, response_body: dict[str, Any] | None = None, ) -> None: """Validate a delegation attempt against the cached card fingerprint. Call this BEFORE any retry on 401/404/422. Transport-level retries on these codes are the failure mode this guard exists to prevent. """ if response_status == 409 and (response_body or {}).get("error") == "CARD_FINGERPRINT_MISMATCH": fresh = compute_fingerprint(served_card) if fresh.organization != cached.organization or fresh.name != cached.name: raise CardDivergence( f"endpoint now serves {fresh.organization}/{fresh.name}; " f"cached was {cached.organization}/{cached.name}; abort and quarantine" ) if fresh.digest != cached.digest: raise CardFingerprintMismatch( f"stale cache: skill/scheme drift detected; re-negotiate. " f"cached={cached.digest[:12]} served={fresh.digest[:12]}" ) return if response_status in (401, 404, 422): fresh = compute_fingerprint(served_card) if fresh.digest != cached.digest: raise CardFingerprintMismatch( f"semantic drift on {response_status}; do not retry transport, " f"re-fetch and re-negotiate. cached={cached.digest[:12]} " f"served={fresh.digest[:12]}" ) # Fingerprint matches but request still rejected → genuine transient # or a skill-level bug; safe to hand to the transport retry path. return ```