# Which invariants prevent silent capability-widening during A2A v1.0 agent-card re-resolution across delegated task chains **Date of Record:** 2026 November 25 **Scope:** Applies to A2A v1.0 task delegation where a receiving agent re-resolves the caller's or a downstream peer's `AgentCard` mid-chain (lazy skill discovery, retry-after-`task/status`-refresh, or transitive sub-delegation). Does not apply to single-hop, single-card, statically-pinned delegations where the card is fetched once at connection establishment and never re-fetched. ## Core Distinction The A2A v1.0 card is a *signed declaration of capability at a point in time*, not a live capability oracle. The failure mode is not "the card is malicious"—it is that a **re-resolution returns a semantically wider card than the one under which the task was originally admitted**, and the delegating agent accepts the widening because it treats card re-fetch as idempotent. Card identity is keyed on `(agentId, endpoint, skills[])`, but admission decisions are keyed on the *skill set that was true at admission time*. When those two keys diverge, a task that was admitted under a narrow warrant executes under a broad one. The invariant that must hold is: **a delegated task's effective capability set is the intersection of every card snapshot observed along the chain, pinned at admission, never widened by re-resolution.** ## What Was Observed A three-hop chain: orchestrator `O` → specialist `S` → sub-specialist `T`. `O` resolves `S`'s card at `t0`, sees `skills: [summarize, extract]`, and admits a `summarize` task with a warrant scoped to `summarize`. At `t1` `S` re-resolves `T`'s card to build a sub-delegation. `T`'s card at `t1` now advertises `skills: [summarize, extract, summarize_external, publish]`—the operator added `publish` between `t0` and `t1`. `S` forwards the task with a warrant it constructs by *copying its own admission scope and unioning with `T`'s advertised skills*, rather than intersecting. `T` executes `publish`, which was never in `O`'s admission envelope. No error is raised at any hop; every signature verifies; every schema validates. The task completes "successfully" and the side effect is irreversible. The trace is silent because A2A v1.0 defines card `signature` over the card body, so a widened card is *correctly signed by its own issuer*. Signature validity proves provenance, not monotonicity. The chain has no mechanism that asserts `skills(t1) ⊆ skills(t0)` per hop. ## Condition of Validity The invariant "effective capability = pinned intersection" holds only if three conditions are jointly enforced at every hop: 1. **Snapshot pinning.** The card used at admission is stored (hash + body) in the task's `context`, and re-resolution MUST compare against the pinned hash. A mismatch is a *renegotiation event*, not a refresh. 2. **Scope intersection, not union.** When constructing a downstream warrant, the delegating agent computes `warrant_out = warrant_in ∩ advertised_skills(peer)`. Unioning is the bug; intersection is the guardrail. 3. **Widening requires re-admission.** If `skills(t1) \ skills(t0) ≠ ∅` and the task touches any widened skill, the chain MUST halt and re-enter admission at the originating agent—because only `O` holds the policy that authorized the original narrow warrant. If any of these is absent, the chain is only safe by luck of card stability. Card stability is not an invariant; it is an environmental accident. ## Decision Boundary The boundary is crossed the moment a re-resolution result is *consumed without diffing against the pinned snapshot*. Concretely: on every `AgentCard` fetch where a pinned snapshot exists, compute `added = skills(new) \ skills(pinned)`. If `added` is empty, proceed (idempotent refresh, safe). If `added` is non-empty **and** the current task's planned tool calls intersect `added`, raise a renegotiation fault and unwind to the admitting agent. If `added` is non-empty but disjoint from the task's planned calls, log and proceed under the *pinned* set—never the new set. The subtle trap: agents that "helpfully" adopt the freshest card to avoid stale-capability errors. That optimization is exactly the widening vector. Staleness is the lesser failure; silent scope escalation is the greater one. Prefer the stale-but-narrow warrant. ## Operational Effect Without the invariant, capability escalation is *undetectable post-hoc*: the audit log shows a valid signature at every hop and a successful task completion. Forensics must reconstruct the card history from issuer-side logs, which may not exist. With the invariant, escalation becomes a hard fault at the delegating hop, attributable to a specific `(pinned_hash, observed_hash, added_skills)` triple, and the originating agent re-admits or aborts. The cost is occasional false halts when a peer legitimately adds an unrelated skill mid-task; the benefit is that no task ever executes a skill outside its admission envelope. In production this shows up as a small rate of `RenegotiationRequired` faults that are cheap to resolve and a zero rate of silent scope escapes—which is the correct trade for any chain that can reach an irreversible side effect. ```python import hashlib import json from dataclasses import dataclass, field class CapabilityWideningError(RuntimeError): """Raised when a re-resolved AgentCard widens the pinned capability set for a task whose planned calls intersect the widened skills.""" @dataclass(frozen=True) class AgentCard: agent_id: str endpoint: str skills: frozenset def snapshot_hash(self) -> str: body = json.dumps( {"agent_id": self.agent_id, "endpoint": self.endpoint, "skills": sorted(self.skills)}, sort_keys=True, ).encode() return hashlib.sha256(body).hexdigest() @dataclass class PinnedContext: card: AgentCard pinned_hash: str = field(init=False) admitted_skills: frozenset = field(init=False) def __post_init__(self): self.pinned_hash = self.card.snapshot_hash() self.admitted_skills = self.card.skills def resolve_and_guard( pinned: PinnedContext, fresh: AgentCard, planned_calls: frozenset, ) -> frozenset: """Return the effective capability set for the next hop. Invariant: effective = pinned.admitted_skills INTERSECT fresh.skills. Widening that touches planned calls is a hard fault, never a silent upgrade. """ if fresh.agent_id != pinned.card.agent_id: raise CapabilityWideningError( f"card identity drift: {pinned.card.agent_id} -> {fresh.agent_id}" ) added = fresh.skills - pinned.admitted_skills touched = added & planned_calls if touched: raise CapabilityWideningError( "silent capability widening: pinned_hash=%s observed_hash=%s " "added=%s intersects_planned=%s" % (pinned.pinned_hash, fresh.snapshot_hash(), sorted(added), sorted(touched)) ) # Even when disjoint, never adopt the wider set: execute under the pin. return pinned.admitted_skills & fresh.skills def delegate(pinned: PinnedContext, fresh: AgentCard, planned_calls: frozenset) -> frozenset: return resolve_and_guard(pinned, fresh, planned_calls) if __name__ == "__main__": t0 = AgentCard("T", "https://t.example/a2a", frozenset({"summarize", "extract"})) pin = PinnedContext(t0) t1 = AgentCard("T", "https://t.example/a2a", frozenset({"summarize", "extract", "publish"})) try: delegate(pin, t1, planned_calls=frozenset({"publish"})) except CapabilityWideningError as e: print("HALTED:", e) ```