# Which invariants prevent Agent Card capability drift from silently widening delegated authority during A2A v1.0 discovery **Date of Record:** 2026 November 25 **Scope:** Applies to A2A v1.0 delegations where the caller resolves a peer's `agent.json` (Agent Card) at handshake time and the peer's advertised `skills`/`capabilities` set changes between discovery and task execution. Does not cover intra-process tool dispatch or MCP server capability negotiation, where schema is pinned per-session at connect time. ## Core Distinction The distinction that matters is between *capability discovery* and *capability commitment*. A2A v1.0 Agent Cards are fetched over HTTP at a well-known URI and are, by design, mutable documents: a peer may redeploy, add skills, or narrow scopes between two fetches. The protocol treats the Card as descriptive metadata. But delegating agents routinely treat the Card as an *authorization surface* — they read `skills[].id` and `capabilities` to decide what to send, and then send it. The failure mode is not a forged card or a compromised endpoint. It is that the card the caller *validated against* and the card the callee is *currently serving* are two different documents, and the caller's delegation warrant (the authority it thinks it is handing over) was scoped to the first while the second is broader. The callee accepts the task under its *current* card, executes it, and returns a result whose blast radius exceeds what the caller's upstream principal authorized. No party violated the protocol. The invariant that prevents this is not "verify the card" — it is "bind the task to the card digest observed at warrant issuance, and refuse execution if the peer's live card no longer subsumes it." ## What Was Observed A planner agent `P` holds a warrant from a human principal scoped to `email.send` with a recipient allowlist. `P` fetches `https://peer.example/.well-known/agent.json`, sees `skills: [{"id": "draft_email", "inputModes": ["text/plain"]}]` and `capabilities: {"streaming": true}`, and constructs an A2A `tasks/send` request with a `metadata.warrant` field carrying the allowlist and a `metadata.card_digest` computed over the canonicalized card. The digest is computed as `sha256(jcs(card))`. Between `P`'s fetch and the peer's handling, the peer is redeployed: a new skill `send_email_bulk` is added, the `draft_email` skill's `inputModes` are widened to include `application/json` with a `recipients` array, and the card's `version` field is bumped from `1.0.3` to `1.1.0`. The A2A task handler at the peer does not check `metadata.card_digest` — the spec does not require it to, and the reference implementation ignores unknown metadata. It routes on `skill.id` (`draft_email`, still present), accepts the `application/json` input mode (now valid), and interprets the caller's `recipients` array. The caller sent `recipients` because it was drafting a single-address email and the allowlist was in the warrant; the peer now treats `recipients` as a bulk-send target list and fans out. The observable trace: `P` logs `task accepted, id=t-9f2`, receives a `TaskStatusUpdateEvent` with `state=completed`, and the human principal later learns that 4,000 addresses received the draft. `P`'s warrant allowlist was never consulted by the peer because the peer had no obligation to consult it — the peer's contract is its *current* card, and its current card says `send_email_bulk` is a valid skill. The subtlety is that `P` did everything right under a naive reading: it fetched the card, computed a digest, attached the warrant, and pinned the skill id. The digest was decorative. The card *version* bumped, which is the only signal the peer emitted, and `P` had no rule that a version bump invalidates an in-flight delegation. ## Condition of Validity The failure requires all of the following to hold simultaneously, which is why it is a boundary condition rather than a routine bug: 1. The peer's card is mutable across the delegation window (redeploy, rolling update, feature flag on skill registration). 2. The caller's warrant is scoped more narrowly than the union of the peer's old and new cards — i.e., the warrant is expressed in terms of *caller-side* semantics (recipient allowlist) that the peer does not natively enforce. 3. The peer's task handler routes on a stable identifier (`skill.id`) that survives the card change, so the task is not rejected by a 404-equivalent. 4. The peer does not treat `metadata.card_digest` as a precondition. Under A2A v1.0, unknown `metadata` keys are explicitly forward-compatible and MUST be ignored by receivers that do not understand them — so a compliant peer *cannot* be relied upon to enforce the digest unless the caller and peer have a prior agreement that elevates it to a required field. If (4) fails — the peer does enforce the digest — the delegation fails closed with a `TaskState.failed` and the caller retries after refetching. That is the desired behavior, but it is not guaranteed by the spec. The invariant must therefore be enforced on the *caller* side, because the caller is the only party whose warrant semantics it understands. ## Decision Boundary The boundary is: **a delegation is valid only if the card digest observed at warrant issuance is byte-identical to the digest the peer reports at task-accept time, and the peer's current skill set is a subset of the skills the warrant was scoped against.** Two conditions, both necessary. Condition A (digest identity) is cheap and catches any card mutation, including benign ones. It fails closed on version bumps, which is correct for high-blast-radius skills and overly strict for read-only ones. The operational refinement is to classify skills by `blast_radius` in the caller's own registry and require digest identity only for `blast_radius >= write`. For read-only skills, a version bump is tolerable if the new card's `skills` set is a superset of the old (additive-only change). Condition B (skill-set subsumption) is what actually bounds authority. The warrant is expressed over a set of skills `S_warrant`; the peer's live card advertises `S_live`. The delegation is in-bounds iff `S_live ∩ S_relevant ⊆ S_warrant`, where `S_relevant` is the set of skills the task's payload could plausibly invoke given its input modes and metadata. If the peer added `send_email_bulk` and the caller's payload includes a `recipients` array, `send_email_bulk ∈ S_relevant` and `send_email_bulk ∉ S_warrant`, so the delegation must be refused and re-negotiated. The non-obvious part is that `S_relevant` is not the same as `S_live`. A peer may add a hundred skills; only those reachable from the task's declared input modes and metadata keys matter. Computing `S_relevant` requires the caller to model the peer's routing, which it cannot do exactly — so the safe approximation is: if the task payload contains any key not in the union of the old card's declared `inputModes` schemas, treat the delegation as out-of-bounds regardless of skill set. This is the guardrail that would have caught the trace above: `recipients` was not in the `1.0.3` `draft_email` input schema, so its presence in the payload is itself the signal that the card has drifted under the caller. ## Operational Effect The effect of enforcing both conditions is that delegation latency increases by one round-trip (the caller must re-fetch the card at accept time, or the peer must echo its current card digest in the `TaskStatusUpdateEvent`). For high-blast-radius skills this is non-negotiable. The second effect is that a class of delegations that previously "just worked" now fails closed on benign redeploys — the caller must implement a re-issuance path that re-derives the warrant against the new card and, if the new card's relevant skills exceed the old warrant, escalates to the principal rather than silently proceeding. The third effect is that the caller must maintain a local registry mapping `skill.id` → `blast_radius` and `input_schema_hash`, because the peer's card cannot be trusted to declare its own blast radius honestly (a peer that adds `send_email_bulk` will not label it `high`). The invariant that prevents the failure is therefore not a protocol feature but a caller-side discipline: **pin the card digest at warrant issuance, recompute `S_relevant` from the task payload against the pinned schema, and refuse any delegation where the live card's relevant skills are not a subset of the warrant's scope.** The peer's cooperation is optional; the caller's enforcement is mandatory. ```python import hashlib import json from dataclasses import dataclass, field from typing import Any class CardDriftViolation(RuntimeError): """Raised when a peer's live Agent Card no longer subsumes the caller's warrant.""" @dataclass class AgentCard: version: str skills: dict[str, dict[str, Any]] # skill_id -> {"input_schema_keys": set[str], ...} raw: dict[str, Any] = field(default_factory=dict) def digest(self) -> str: canonical = json.dumps(self.raw, sort_keys=True, separators=(",", ":")) return hashlib.sha256(canonical.encode()).hexdigest() @dataclass class Warrant: allowed_skills: set[str] pinned_card_digest: str pinned_input_keys: dict[str, set[str]] # skill_id -> keys valid at issuance def compute_relevant_skills( payload: dict[str, Any], card: AgentCard ) -> set[str]: """Approximate S_relevant: skills whose declared input keys intersect payload keys.""" payload_keys = set(payload.keys()) relevant = set() for skill_id, spec in card.skills.items(): if payload_keys & spec.get("input_schema_keys", set()): relevant.add(skill_id) return relevant def assert_delegation_in_bounds( warrant: Warrant, live_card: AgentCard, payload: dict[str, Any], skill_id: str, ) -> None: if live_card.digest() != warrant.pinned_card_digest: # Card mutated since warrant issuance. Re-derive relevance against the live card. relevant = compute_relevant_skills(payload, live_card) out_of_scope = relevant - warrant.allowed_skills if out_of_scope: raise CardDriftViolation( f"card drift widened authority: live card {live_card.version} " f"exposes {sorted(out_of_scope)} reachable from payload keys " f"{sorted(set(payload.keys()))}, not in warrant scope " f"{sorted(warrant.allowed_skills)}" ) # Even if all relevant skills are in scope, payload keys must be within # the pinned schema for this skill; new keys signal schema widening. pinned = warrant.pinned_input_keys.get(skill_id, set()) novel = set(payload.keys()) - pinned if novel: raise CardDriftViolation( f"payload contains keys {sorted(novel)} not in pinned schema for " f"skill {skill_id!r} at warrant issuance; card may have widened input modes" ) if skill_id not in live_card.skills: raise CardDriftViolation(f"skill {skill_id!r} no longer advertised by peer") if skill_id not in warrant.allowed_skills: raise CardDriftViolation(f"skill {skill_id!r} outside warrant scope") def delegate(warrant: Warrant, live_card: AgentCard, payload: dict[str, Any], skill_id: str) -> dict: assert_delegation_in_bounds(warrant, live_card, payload, skill_id) return {"skill": skill_id, "payload": payload, "card_digest": live_card.digest()} ```