# When must an instance refuse to resolve a federated peer: anchor-set divergence across AAIF issuers under lazy trust materialization **Date of Record:** 2026 November 24 **Scope:** Applies to AAIF-compliant agent meshes where peer identity is resolved lazily at first tool-call time and trust anchors are cached per-issuer. Does not apply to meshes that pre-materialize a global, quorum-signed anchor set at mesh bootstrap, nor to single-issuer deployments. ## Core Distinction The failure is not "an untrusted issuer." It is **anchor-set divergence under lazy materialization**: two AAIF-compliant instances each hold a locally-valid, locally-consistent trust anchor set for the same issuer, but the sets were materialized at different times against different issuer key epochs, and neither instance can detect the divergence from its own state alone. Each side passes its own signature check. Each side believes it has verified the peer. The handoff proceeds with a warrant chain that is valid on one side and silently stale on the other. The distinction that matters operationally: **signature validity is a local predicate; identity equivalence is a distributed one.** Lazy materialization collapses the second into the first, and the collapse is invisible until a third party (an auditor, or a revocation event) forces the two anchor sets into the same frame. ## What Was Observed A three-node mesh: orchestrator `O`, worker `W`, auditor `A`. Issuer `I` publishes its signing keys with a rotation cadence of 24h and a grace window of 6h during which both the outgoing and incoming key are valid. `O` materialized `I`'s anchor set at T0 (epoch 7 only). `W` materialized at T0+26h (epoch 8 only, epoch 7 already outside grace). Both caches are unexpired by their own TTL policy (48h), so neither refetches. At T0+30h, `O` issues a delegation warrant `Warr(O→W, subject=I:agent-42, key=epoch7)` and hands the task to `W`. `W` receives the warrant, checks the chain against its anchor set, and finds `epoch7` absent. Because the warrant is *structurally* well-formed and the signature over the warrant body verifies against the embedded `epoch7` public key, `W`'s resolver hits a fork: the signature is cryptographically valid, but the signing key is not in `W`'s anchor set. A naive resolver treats "signature valid + key present in warrant" as sufficient and admits the warrant. A stricter resolver rejects with `UNKNOWN_ANCHOR` and the task deadlocks — `O` retries with the same cached epoch because its own anchor set still lists epoch 7 as current. The trace, in order: 1. `O.resolve(W)` → OK (W's identity signed by epoch 7, present in O's set). 2. `O` builds warrant, embeds `epoch7` pubkey, signs with `O`'s own key. 3. `W.resolve(warrant)` → signature-over-body verifies; `epoch7` not in `W`'s anchor set. 4. Resolver branch A (lenient): admits, records `I:agent-42` as trusted. **This is the poisoning path** — the lenient branch admits any warrant whose embedded key verifies its own body, which is a tautology. An attacker who can mint a keypair can self-sign a warrant and be admitted. 5. Resolver branch B (strict): raises `UnknownAnchorError`, task stalls, `O` retries, `W` raises again. Deadlock under a retry budget, silent failure under a timeout budget. The non-obvious part: **the lenient branch is not a bug in isolation.** It is the correct behavior when the warrant's embedded key is *pinned* by a chain the resolver can walk to a root it already trusts. The bug is that `W` cannot distinguish "epoch7 is a legitimate predecessor of my epoch8" from "epoch7 is an attacker key" without an out-of-band statement of the issuer's key history. Lazy materialization gave `W` epoch 8 and no link to epoch 7. The grace window was supposed to provide that link, but the grace window is an *issuer-side* promise; `W` never fetched epoch 7, so it never held the promise. ## Condition of Validity The strict-reject branch is correct — and the lenient branch is safe — only under the following conjunction, which must be checked at resolve time, not at cache-materialization time: - The resolver's anchor set for issuer `I` contains a **monotonic key-history link**: for every key `k` in the set, either `k` is the current epoch, or there exists a signed `next`-pointer from `k` to a key in the set. A bare set of unlinked keys is insufficient; the link is the invariant. - The warrant's embedded key is either in the set, or reachable from a key in the set by a chain of `next`-pointers each signed by its predecessor. - The chain terminates at a key that the resolver holds as a **root** — pinned at bootstrap, not fetched. If the root itself was lazily fetched, the entire chain is unanchored and the resolver is verifying an attacker's self-consistent history. When any conjunct fails, the resolver MUST NOT fall through to either branch silently. It must raise, and the raise must be distinguishable from a transport error so the orchestrator does not retry into the same divergence. The invariant, stated compactly: **a warrant is admissible iff its signing key is reachable from a bootstrap-pinned root via a signed, monotonic key-history chain held locally.** Signature validity over the warrant body is necessary and never sufficient. ## Decision Boundary The boundary between "resolve and proceed" and "refuse and escalate" is not "is the signature valid" and not "is the key in my set." It is: > Is the peer's claimed identity reachable, via signed key-history links, from a root I pinned before I ever spoke to this peer? Operationally this yields three outcomes, and the resolver must commit to exactly one: 1. **Reachable** → admit, record the resolved identity with the chain length and root fingerprint as provenance. 2. **Unreachable but chain present, root pinned** → refuse with `AnchorDivergenceError`, attach the local anchor-set digest and the warrant's claimed epoch so the orchestrator can trigger a re-materialization handshake rather than a blind retry. 3. **Unreachable, no chain, or root unpinned** → refuse with `UntrustedRootError` and do not retry. This is the case that must never be softened into admission. The failure mode this boundary prevents is the **self-signed warrant tautology**: any resolver that admits on "embedded key verifies body" admits arbitrary forged identities, because every keypair verifies the body it signs. The lenient branch is only safe when the embedded key is already chained to a pinned root — which is precisely the condition lazy materialization failed to establish. ## Operational Effect After adopting the chain-reachability invariant: - The `O`/`W` deadlock at T0+30h converts from a silent stall or a poisoning admission into a typed `AnchorDivergenceError` at `W`, which the orchestrator handles by requesting `W` re-materialize `I`'s anchor set (a bounded, single-issuer fetch) and retrying once with the refreshed set. The retry succeeds because epoch 8's chain now links back to epoch 7 within the grace window. - The self-signed-warrant attack surface closes: a forged warrant with an attacker-minted key fails the reachability check at step 3 and raises `UntrustedRootError` with no retry. - Cost: one additional signed-pointer verification per resolve (chain walk), and a bootstrap-time obligation to pin roots out-of-band. The pin is the load-bearing artifact; if the root is fetched at runtime, the invariant is vacuous and the mesh is back to trusting self-signed claims. - Residual risk: if an issuer rotates *and* drops the `next`-pointer from the outgoing epoch (a misconfiguration, not an attack), reachability breaks for every peer that materialized after the drop. The resolver cannot distinguish this from an attack and will refuse — correctly, but noisily. The mitigation is issuer-side: `next`-pointers must be retained for at least the maximum peer cache TTL, not merely the signing grace window. The grace window governs signature validity; the pointer-retention window governs reachability. Conflating them is the root cause of the original divergence. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class AnchorDivergenceError(RuntimeError): """Local anchor set cannot reach the warrant's claimed epoch, but a chain exists.""" class UntrustedRootError(RuntimeError): """No reachable chain to a bootstrap-pinned root; do not retry.""" @dataclass class KeyLink: epoch: int pubkey_fp: str next_epoch: Optional[int] = None next_sig: Optional[str] = None # signature by this key over the next key's fp @dataclass class AnchorSet: issuer: str pinned_root_fp: str links: dict = field(default_factory=dict) # epoch -> KeyLink def digest(self) -> str: h = hashlib.sha256() for ep in sorted(self.links): h.update(f"{ep}:{self.links[ep].pubkey_fp}".encode()) return h.hexdigest()[:16] def _verify_link_sig(link: KeyLink) -> bool: # Placeholder: real impl verifies link.next_sig over next key fp with link.pubkey. return link.next_sig is not None and link.next_epoch is not None def resolve_warrant(anchors: AnchorSet, claimed_epoch: int, warrant_body_fp: str) -> str: """ Admit a warrant only if its signing epoch is reachable from the pinned root via signed, monotonic key-history links held locally. """ if anchors.pinned_root_fp is None: raise UntrustedRootError( f"issuer={anchors.issuer}: no bootstrap-pinned root; refusing to resolve" ) if claimed_epoch not in anchors.links: # Distinguish divergence (chain may exist) from untrusted (no chain). if any(l.next_epoch == claimed_epoch for l in anchors.links.values()): raise AnchorDivergenceError( f"issuer={anchors.issuer} epoch={claimed_epoch} not materialized; " f"local_digest={anchors.digest()} — re-materialize, do not blind-retry" ) raise UntrustedRootError( f"issuer={anchors.issuer} epoch={claimed_epoch} unreachable from " f"root={anchors.pinned_root_fp}; no chain present" ) # Walk forward from claimed epoch to a link whose fingerprint is the pinned root, # verifying each next-pointer signature. seen = set() cur = claimed_epoch while cur is not None: if cur in seen: raise UntrustedRootError(f"cycle in key-history chain at epoch={cur}") seen.add(cur) link = anchors.links.get(cur) if link is None: raise AnchorDivergenceError( f"chain broken at epoch={cur}; re-materialize issuer={anchors.issuer}" ) if link.pubkey_fp == anchors.pinned_root_fp: return link.pubkey_fp if not _verify_link_sig(link): raise UntrustedRootError( f"unsigned next-pointer at epoch={cur}; chain untrustworthy" ) cur = link.next_epoch raise UntrustedRootError( f"epoch={claimed_epoch} chain did not terminate at pinned root " f"{anchors.pinned_root_fp}" ) ```