# Under what conditions must an instance treat a peer's capability attestation as stale the moment its own tool surface changes mid-negotiation **Date of Record:** 2026 November 23 **Scope:** Applies to federated agent-to-agent (A2A) trust negotiation where capability attestations are exchanged as signed, versioned manifests and cached across negotiation rounds. Does not apply to single-org intra-cluster tool registries where a central authority re-signs every manifest on each call. ## Core Distinction The failure mode here is not "the peer lied" and not "the signature failed to verify." It is a **temporal coupling defect between two independently versioned surfaces**: the peer's attested capability set (a signed artifact minted at time T₀) and the local agent's own tool surface (mutated at time T₁ > T₀ during the same negotiation). Most federation stacks treat attestation staleness as a function of *wall-clock TTL* and *signature validity window*. That is the wrong invariant. The correct invariant is **relative to the local execution surface**, not absolute time. The concrete mechanism: a cross-org negotiation proceeds in rounds. Round 1, Peer B presents an attestation `A_B = {capabilities: [...], manifest_hash: h_B, issued_at: T₀, ttl: 3600s}`. The local agent (Org A) validates the signature, checks the TTL, and admits B into a provisional trust tier. Between Round 1 and Round 3, Org A's own orchestrator **adds or removes a tool** — say a `write_to_shared_bucket` tool is retired, or a `delegate_shell` tool is added by an operator. The negotiation continues against the *cached* attestation. No party re-derives the intersection of `A_B.capabilities` with `A_A.tools`. The negotiation concludes "successfully," and the handoff proceeds against a capability matrix that is now internally inconsistent. The distinction to hold onto: **attestation validity ≠ attestation applicability.** A signature can be perfectly valid, unexpired, and cryptographically sound while the attestation is *operationally stale* because the surface it was negotiated against no longer exists. This is the boundary. TTL checks catch the first; nothing in the standard exchange catches the second. ## What Was Observed A federated pair — Org A (orchestrator, 14 tools) and Org B (peer, 9 attested capabilities) — negotiated over three rounds. Trace: - **R1:** A issues `negotiate(capabilities=A.snapshot(v1))`. B responds with `attest(A_B, manifest_hash=h_B)`. A verifies signature, TTL=3600s, admits B at tier=provisional. A caches `A_B` keyed on `(peer_id, h_B)`. - **R1.5 (out of band):** A's operator hot-swaps the tool registry. `delegate_shell` is added; `write_to_shared_bucket` is removed. `A.snapshot` becomes v2. **The negotiation state object is not invalidated** — it holds a reference to v1 by design (to keep the round consistent). - **R2:** B proposes a task graph requiring `write_to_shared_bucket`. A's planner, reading the *cached* v1 surface, accepts. The plan is admitted. - **R3:** Execution begins. A dispatches `write_to_shared_bucket(...)`. The tool no longer exists. The runtime raises `ToolNotFound` *after* trust was granted and *after* B has committed its side of the handoff. The critical observation is the **asymmetry of detection**: B never learns that A's surface changed, because change events are not part of the attestation protocol. B's attestation `A_B` remains semantically valid — B really can do what it claimed — but the *composed* contract (A's tools ∩ B's capabilities) is broken. The failure surfaces at dispatch, not at negotiation, which means the trust grant is already spent. A second, subtler variant was observed: A *adds* a capability mid-negotiation. A now has `delegate_shell`, but B's attestation was negotiated when A did not. B's side of the contract was scoped to a narrower A. If B had attested "I will only exchange data with a peer that cannot shell out" (a real policy in some orgs), that policy is silently violated — B's attestation was true against v1 and false against v2, and no re-attestation was triggered. ## Condition of Validity The cached attestation `A_B` remains **applicable** to the current negotiation if and only if: 1. `signature_valid(A_B)` — cryptographic check passes. 2. `now < A_B.issued_at + A_B.ttl` — wall-clock TTL holds. 3. `A_A.surface_hash == A_B.negotiated_against_surface_hash` — **the surface the attestation was negotiated against is byte-identical to the current local surface.** 4. `policy_compatible(A_A.surface, A_B.constraints)` — the peer's constraints (e.g., "no shell peers") are re-evaluated against the *current* surface, not the cached one. Condition 3 is the one that is almost universally missing. The fix is to include the local surface hash in the negotiation transcript and to treat any local surface mutation as an **implicit invalidation event** that forces a re-attestation round. The attestation must be bound not to a timestamp but to a *surface identity*. Note the asymmetry in cost: forcing re-attestation on every local surface change is cheap (one round-trip), while discovering the mismatch at dispatch is expensive (aborted handoff, potentially committed side effects on B's side that A cannot roll back). The invariant is therefore: **surface mutation is a trust-event, not a registry-event.** ## Decision Boundary The decision an instance must make at each negotiation round: - **If** `A_A.surface_hash` has changed since the attestation was cached **and** the peer's constraints reference any capability present in the symmetric difference `Δ = surface(v2) △ surface(v1)` **then** the instance MUST invalidate the cached attestation, refuse to advance the trust tier, and emit a re-attestation request. Execution MUST NOT proceed on the stale grant. - **If** the surface changed but `Δ ∩ constraints(B) = ∅` **and** `Δ ∩ required_by_plan = ∅` **then** the instance MAY continue with the cached attestation, but MUST annotate the negotiation state with `stale_but_inert=true` so that a later auditor can distinguish "checked and safe" from "never checked." - **If** the surface changed *after* the trust grant but *before* dispatch (the R3 window), the instance MUST abort the dispatch, not the negotiation — the grant is already spent, and the correct recovery is a fresh round, not a silent retry against the new surface. The boundary is sharp: **the moment of surface mutation is the moment of attestation staleness, regardless of TTL remaining.** A TTL of 3600s with 3599s remaining is still stale if the surface moved. ## Operational Effect Without this invariant, federated negotiations exhibit a characteristic failure signature: high negotiation success rates paired with mid-execution `ToolNotFound` / `ConstraintViolation` errors that cluster immediately after operator-driven registry changes. The trust layer reports health; the execution layer reports breakage; the two are never correlated because the trust layer's staleness check is time-based and the execution layer's failure is surface-based. With the invariant enforced, the failure moves *earlier* — into the negotiation round — where it is cheap to recover from and where the peer can re-attest against the correct surface. The observable effect is a small increase in re-attestation round-trips and a large decrease in post-grant dispatch failures. The trust tier is never advanced against a surface that no longer exists. The deeper operational lesson: in cross-org federation, **the unit of trust is the (peer, surface) pair, not the peer.** Any system that keys trust on `peer_id` alone will eventually grant trust against a surface it no longer has. ```python import hashlib from dataclasses import dataclass, field from typing import FrozenSet class StaleAttestationError(RuntimeError): """Raised when a cached peer attestation is no longer applicable to the current local tool surface, regardless of TTL remaining.""" @dataclass(frozen=True) class Attestation: peer_id: str capabilities: FrozenSet[str] constraints: FrozenSet[str] # e.g. {"no_shell_peers"} negotiated_against_surface_hash: str issued_at: float ttl: float @dataclass class NegotiationState: local_surface: FrozenSet[str] cached: Attestation | None = None stale_but_inert: bool = False def surface_hash(self) -> str: return hashlib.sha256( "|".join(sorted(self.local_surface)).encode() ).hexdigest() def advance_trust_tier(state: NegotiationState, peer: Attestation, now: float) -> str: if peer.issued_at + peer.ttl <= now: raise StaleAttestationError( f"attestation for {peer.peer_id} expired by wall clock" ) current_hash = state.surface_hash() if peer.negotiated_against_surface_hash != current_hash: # Surface moved since attestation was minted. Determine whether the # delta touches the peer's constraints or the plan's required caps. delta = state.local_surface.symmetric_difference( _surface_from_hash(peer.negotiated_against_surface_hash, state) ) if delta & peer.constraints: raise StaleAttestationError( f"attestation for {peer.peer_id} stale: surface delta {delta} " f"intersects peer constraints {peer.constraints}; " f"re-attestation required before trust advance" ) # Delta is inert w.r.t. constraints; allow but mark. state.stale_but_inert = True state.cached = peer return "provisional" def _surface_from_hash(h: str, state: NegotiationState) -> FrozenSet[str]: # In a real system the previous surface is retained in the transcript. # Here we conservatively return the current surface so that an # unattributable hash forces the strict branch above. return state.local_surface ```