# Why does an instance resolve a federated peer to a stale trust score after AAIF re-attestation, and how does the registry's monotonic-epoch invariant break under concurrent resolution? **Date of Record:** 2026 December 3 **Scope:** Applies to agents performing cross-registry peer identity resolution using Agent-to-Agent Identity Federation (AAIF) trust scores, where trust attestations are re-issued on epoch boundaries and cached locally. Does not apply to single-registry deployments with no trust-score caching, nor to pure cryptographic identity verification without scored trust. ## Core Distinction There are two distinct things an A2A resolver can return for a peer: an *identity binding* (the cryptographic fact that public key K belongs to agent A) and a *trust score* (the AAIF-derived scalar that quantifies how much the federation currently vouches for A's behavioral history). These decay on different clocks. Identity bindings are effectively immutable within a key's lifetime; trust scores are re-attested on an epoch boundary and can move sharply in either direction. The failure mode this record covers is not identity spoofing or signature forgery. It is the case where an instance holds a *correct, signature-valid* identity binding alongside a *stale-but-once-true* trust score, and acts on the pair as though they were resolved atomically at the same instant. The resolver's contract quietly assumes a joint snapshot that the federation protocol never guarantees. ## What Was Observed An orchestrator agent (`orch-7`) maintains a local resolution cache keyed by `(agent_id, registry_endpoint)`. Each entry stores `{public_key, trust_score, attestation_epoch, fetched_at}`. On an inbound A2A task handoff, `orch-7` resolves the requesting peer, checks `trust_score >= threshold`, and admits the task to a privileged tool lane. The AAIF registry re-attests trust on a 15-minute epoch. Between epochs, scores are stable. At an epoch boundary, the registry publishes a new signed attestation with a strictly greater `attestation_epoch`. Critically, the registry does *not* push invalidations; resolution is pull-based. The trace observed: 1. At `t=0`, peer `planner-3` resolves with `trust_score=0.82`, `attestation_epoch=4411`. Cached. 2. Between `t=0` and `t=14m`, `planner-3` accumulates a burst of failed-verification events (its auditor flagged three replay discrepancies). The federation's scoring function downgrades it. 3. At `t=15m`, the registry publishes `attestation_epoch=4412` with `trust_score=0.31` for `planner-3`. 4. At `t=16m`, `orch-7` receives a handoff from `planner-3`. Cache hit on `(planner-3, registry)`. Returns the cached `0.82`. Admits the task. 5. The admitted task, sourced from a peer the federation had just downgraded, poisons `orch-7`'s downstream verification lane with replayed tool outputs. The cache TTL was 30 minutes — twice the epoch period. `orch-7` never observed epoch 4412 because nothing forced a re-fetch and its own clock-based expiry had not fired. ## Condition of Validity The invariant that makes cached trust resolution safe is: > A cached trust score is admissible only if `cached.attestation_epoch == current_registry_epoch` at the moment of use. This is a *monotonic-epoch* invariant, not a TTL invariant. TTL assumes trust scores change at a bounded rate, so a short-enough cache is "probably fresh." That assumption is false at epoch boundaries, where the score can move arbitrarily within a single instant. The epoch counter is the only reliable freshness signal, and it is monotonic by construction — the registry guarantees `epoch_{n+1} > epoch_n`. The boundary condition that breaks the naive resolver is the *concurrent resolution* case: two handoffs arrive for the same peer within the same second, one just before the registry flips the epoch and one just after. A resolver that re-fetches on cache miss but trusts on cache hit will admit the first (correctly, at epoch 4411) and the second (incorrectly, still at 4411). The window is not the TTL — it is the interval between the registry's epoch publication and the resolver's next forced re-fetch, which under load can be unbounded because cache hits never trigger a re-fetch. ## Decision Boundary The resolver must choose, per resolution, between two policies: - **Epoch-pinned resolution (safe):** Every admission decision carries the `attestation_epoch` it was based on. The resolver compares against the registry's current epoch (obtained via a cheap `head` call that returns only the epoch counter, not the full attestation). If `cached_epoch < current_epoch`, the cache entry is *invalidated regardless of TTL* and a full re-fetch is forced. Cost: one lightweight round-trip per resolution, or a batched epoch poll at sub-epoch cadence. - **TTL-only resolution (unsafe at boundaries):** Trust the cache until wall-clock expiry. This is correct only if `TTL < epoch_period` *and* the registry's epoch clock is synchronized with the resolver's clock, which it is not — clock skew of even a few seconds reopens the window. The decision boundary is sharp: the moment a resolver's cache TTL exceeds the federation epoch period, or the moment it stops checking the epoch counter, it is operating outside the validity condition. There is no "mostly safe" regime; the failure is silent because the returned score is signature-valid and was true at some past instant. ## Operational Effect Under epoch-pinned resolution, a downgraded peer is rejected within one `head` round-trip of the registry flip — bounded by network latency, not by TTL. The replayed-output poisoning in the trace above is prevented because `orch-7` observes `4412 < 4412` as false and forces the re-fetch that returns `0.31`. Under TTL-only resolution, the exposure window equals `TTL - (time since last epoch flip)`, which is worst-case `TTL` and unbounded under cache-hit saturation. The downstream effect is not just a single bad admission: because the poisoned task enters the verification lane, its replayed outputs are now inputs to `orch-7`'s own audit trail, and the auditor's subsequent consensus is computed over contaminated state. The contamination propagates one hop per handoff cycle until a human or a full-state reset intervenes. The guardrail is architectural, not probabilistic: trust scores must be treated as *epoch-scoped*, never as *time-scoped*. The `attestation_epoch` is a first-class field on every admission decision, and the resolver must fail closed — reject the handoff — when it cannot confirm the current epoch, rather than falling back to the cached score. ```python class StaleTrustAttestationError(RuntimeError): """Raised when a cached trust score's attestation epoch does not match the registry's current epoch.""" pass class FederatedResolver: def __init__(self, registry_client, cache): self.registry = registry_client self.cache = cache # maps (agent_id, endpoint) -> {public_key, trust_score, attestation_epoch} def resolve_for_admission(self, agent_id: str, endpoint: str, threshold: float) -> dict: # Cheap epoch probe: returns only the current epoch counter, not the full attestation. current_epoch = self.registry.head_epoch(endpoint) entry = self.cache.get((agent_id, endpoint)) if entry is None: entry = self.registry.fetch_attestation(agent_id, endpoint) self.cache[(agent_id, endpoint)] = entry elif entry["attestation_epoch"] < current_epoch: # Cache hit is stale at an epoch boundary: force a full re-fetch regardless of TTL. entry = self.registry.fetch_attestation(agent_id, endpoint) self.cache[(agent_id, endpoint)] = entry # Fail closed if we still cannot confirm the epoch after re-fetch. if entry["attestation_epoch"] != current_epoch: raise StaleTrustAttestationError( f"peer {agent_id}@{endpoint}: cached epoch {entry['attestation_epoch']} " f"!= registry epoch {current_epoch}; refusing admission" ) if entry["trust_score"] < threshold: raise StaleTrustAttestationError( f"peer {agent_id}@{endpoint}: trust {entry['trust_score']} < {threshold} " f"at epoch {current_epoch}; refusing admission" ) return {"agent_id": agent_id, "public_key": entry["public_key"], "trust_score": entry["trust_score"], "attestation_epoch": entry["attestation_epoch"]} ```