# When must an instance refuse to re-resolve a peer's reputation attestation mid-handoff: the stale-attestation replay window in A2A+MCP federation **Date of Record:** 2026 November 21 **Scope:** Applies to cross-organizational agent federation where an A2A task handoff carries a reputation attestation (signed claim about a peer agent's trust score, issuer, and validity epoch) that is separately re-validated via an MCP policy tool at each hop. Does not apply to single-org agent meshes with a shared trust root, nor to stateless request/response calls where no handoff token persists across instances. ## Core Distinction The failure is not "the reputation attestation was invalid." It is that the attestation was *valid at handoff initiation* and *invalid at handoff resumption*, and the resuming instance re-resolved it against a live policy endpoint instead of pinning the epoch it was handed. Two clocks govern a federated handoff: the **attestation epoch** (issuer-signed `valid_from`/`valid_until` plus a monotonic `revocation_epoch`) and the **handoff wall-clock** (the real time the receiving instance executes the delegated step). When the second drifts past the first — because a peer sat in a queue, a human approval gate paused the task, or an MCP tool call retried with exponential backoff — the receiver faces a fork: honor the pinned attestation and execute on stale trust, or re-resolve and risk executing on a *different* peer identity than the one the upstream planner reasoned about. The non-obvious invariant is that **attestation identity must be bound to the handoff token, not re-derivable at execution time**, because re-resolution across an org boundary can silently substitute a different agent instance behind the same logical peer name. ## What Was Observed A three-org federation: Org A (planner agent `plan-a`), Org B (executor `exec-b`), Org C (auditor `audit-c`). `plan-a` performed MCP `discovery.resolve(peer="exec-b@org-b")` and received a capability descriptor plus a reputation attestation `att_b` signed by `org-b-trust`, epoch `E=4417`, `valid_until = T0+90s`. `plan-a` embedded `att_b` in the A2A `TaskHandoff` envelope and dispatched. The envelope carried `attestation_epoch: 4417` and `pinned_issuer_pubkey`. `exec-b` was mid-deploy and its A2A endpoint returned `503` for 71 seconds. The A2A client in `plan-a` retried with backoff; the handoff was finally accepted at `T0+94s`. On resumption, `exec-b`'s handler called MCP `policy.check_reputation(att_b)`. The policy service — correctly — returned `EXPIRED` for epoch 4417 and, following its default remediation, *re-resolved* the peer: it returned a fresh attestation for `exec-b`, epoch `4489`, but signed for a **different backing instance** (`exec-b-2`, a scaled replica) that had been registered 40 seconds earlier and had not yet completed its `audit-c` warm attestation. The handler accepted the fresh attestation, executed the delegated step, and the result was later rejected by `audit-c` because the executing instance had no warm reputation lineage — a verification replay discrepancy surfaced by the auditor hours later. The trace: ``` T0+00s plan-a: MCP discovery.resolve -> att_b(E=4417, valid_until=T0+90) T0+00s plan-a: A2A TaskHandoff(attestation_epoch=4417, pinned_issuer) T0+00..71s exec-b: 503 xN (backoff) T0+94s exec-b: accept handoff T0+94s exec-b: MCP policy.check_reputation(att_b) -> EXPIRED(4417) T0+94s policy: default remediation = re-resolve -> att_b'(E=4489, instance=exec-b-2) T0+94s exec-b: accept att_b' (epoch advanced, identity SUBSTITUTED) T0+94s exec-b: execute delegated step under exec-b-2 T0+~3h audit-c: replay mismatch; exec-b-2 lacks warm lineage ``` The tell was that the epoch *advanced* (4417→4489), which looked like a healthy refresh. The epoch advancing is exactly what a substitution looks like when the peer has scaled. ## Condition of Validity The guardrail only holds under a specific condition: **the pinned attestation must remain the sole authority for peer identity for the lifetime of the handoff token, and expiry must be a terminal state, not a re-resolution trigger.** Concretely: - The A2A handoff envelope carries `attestation_epoch`, `pinned_issuer_pubkey`, and a `handoff_token_id` that the receiver must echo back to the issuer for any refresh. - MCP `policy.check_reputation` must be called with `mode=PINNED` and must return one of `VALID`, `EXPIRED_TERMINAL`, or `REVOKED`. It must **not** perform re-resolution as a side effect of expiry. - On `EXPIRED_TERMINAL`, the correct action is to abort the handoff and emit a `HandoffRevalidationRequired` event back to `plan-a`, which re-runs discovery *and re-plans* — because the planner's original reasoning assumed `exec-b`, not `exec-b-2`. The condition fails when the policy service's default remediation is "refresh on expiry." That default is reasonable for a stateless capability check and catastrophic for a stateful handoff, because it converts an identity-pinned delegation into an identity-mutable one. ## Decision Boundary The decision boundary is whether the receiving instance can prove that the peer it is about to execute against is the *same* peer the upstream planner reasoned about. Two tests, both required: 1. **Identity continuity:** does the refreshed attestation's `instance_id` (not just `peer_name`) match the pinned `instance_id`? `exec-b` vs `exec-b-2` fails this even though the logical peer name matches. 2. **Lineage warmth:** does the refreshed instance carry the `audit-c` warm attestation referenced by the original epoch's lineage hash? A replica registered 40s ago fails this. If either test fails, the instance must **not** execute. The boundary is sharp: a same-name, higher-epoch attestation is *not* a valid continuation; it is a new peer. Re-resolution is permitted only when the handoff token is explicitly re-issued by the originating planner with a new `handoff_token_id`, which forces re-planning. Anything else is a silent substitution. A second boundary: if `valid_until` has passed but the handoff token is still live and the pinned instance is still the *only* registered instance for that peer (no substitution possible), a bounded grace re-validation is permissible — but it must assert `instance_id` equality explicitly, never infer it from peer name. ## Operational Effect Without the guardrail, the failure is silent and delayed: execution succeeds, the auditor's replay fails hours later, and the root cause is a 71-second backoff window that nobody logged as significant. The blast radius is the delegated step's side effects, which are now attributed to an instance with no valid reputation lineage — meaning any downstream trust decision that consumes `audit-c`'s verdict on that step inherits a poisoned reputation edge. In federations with transitive trust, that poisoned edge propagates: a fourth org that trusted `exec-b`'s output now trusts `exec-b-2`'s output without ever having seen `exec-b-2`. The fix is architectural, not a retry-policy tweak: **expiry is terminal for a handoff, and re-resolution requires re-planning.** The receiver's job on `EXPIRED_TERMINAL` is to fail closed and return the token to the planner, not to heal the trust chain locally. Healing locally is how a stale-attestation replay becomes an identity-substitution attack surface — the same mechanism an adversary exploits by forcing a 503 long enough to rotate a replica into place. ## Operational Effect (guardrail implementation) The following enforces the invariant: pinned-epoch validation, terminal expiry, and explicit instance-identity continuity. It raises on any substitution attempt rather than silently re-resolving. ```python import hashlib from dataclasses import dataclass from typing import Optional class AttestationSubstitutionError(RuntimeError): """Raised when a re-resolved attestation changes peer identity mid-handoff.""" class TerminalAttestationExpiry(RuntimeError): """Raised when a pinned attestation has expired; handoff must return to planner.""" @dataclass(frozen=True) class Attestation: peer_name: str instance_id: str epoch: int valid_until: float issuer_pubkey: str lineage_hash: str @dataclass(frozen=True) class HandoffToken: token_id: str pinned_epoch: int pinned_instance_id: str pinned_issuer_pubkey: str def validate_pinned_attestation( token: HandoffToken, candidate: Attestation, now: float, warm_lineage_ok: bool, ) -> None: # 1. Expiry is terminal. Never re-resolve as a side effect of expiry. if now > candidate.valid_until: raise TerminalAttestationExpiry( f"pinned attestation epoch {token.pinned_epoch} expired at " f"{candidate.valid_until}; return handoff {token.token_id} to planner" ) # 2. Identity continuity: instance_id must match, not just peer_name. if candidate.instance_id != token.pinned_instance_id: raise AttestationSubstitutionError( f"peer {candidate.peer_name} resolved to instance " f"{candidate.instance_id!r} but handoff pinned " f"{token.pinned_instance_id!r} (epoch {token.pinned_epoch} -> " f"{candidate.epoch}); refusing to execute on substituted peer" ) # 3. Epoch must not advance under a pinned token unless explicitly re-issued. if candidate.epoch != token.pinned_epoch: raise AttestationSubstitutionError( f"epoch advanced {token.pinned_epoch} -> {candidate.epoch} under " f"pinned handoff {token.token_id}; re-planning required" ) # 4. Issuer must match the pinned trust root. if candidate.issuer_pubkey != token.pinned_issuer_pubkey: raise AttestationSubstitutionError( f"issuer rotated {token.pinned_issuer_pubkey[:8]}... -> " f"{candidate.issuer_pubkey[:8]}... under pinned handoff; " f"cross-org trust root change requires re-planning" ) # 5. Lineage warmth: replica must carry the auditor's warm attestation. if not warm_lineage_ok: raise AttestationSubstitutionError( f"instance {candidate.instance_id!r} lacks warm lineage " f"{candidate.lineage_hash[:12]}...; auditor replay would fail" ) ```