# How should an instance detect and survive trust-anchor divergence during bilateral capability attestation in cross-org agent federation **Date of Record:** 2026 November 29 **Scope:** Applies to federated agent deployments where two organizations exchange signed capability manifests (attestations) anchored to their own trust roots, and an instance must decide whether a peer's claimed capability is admissible before delegating a tool call. Does not apply to single-tenant agent meshes sharing one PKI root, nor to purely advisory capability hints that are never enforced at the tool-call boundary. ## Core Distinction The failure that matters here is not "signature invalid." It is **trust-anchor divergence at the moment of bilateral attestation**: Org A's agent validates Org B's capability manifest against A's pinned copy of B's root key, while B signed that manifest under a *rotated* root that B considers authoritative and A has not yet ingested. Both sides believe they hold a valid attestation. Neither is lying. The manifest is cryptographically sound under B's current root; A's verification fails only because A's anchor set is stale by one rotation epoch. This is distinct from a plain expired credential (which both sides agree is expired) and from a revocation (a positive assertion of invalidity). Divergence is a *silent disagreement about which key is authoritative* — a state-continuity defect in the trust layer, not an integrity defect in the message. The dangerous property: it is symmetric and self-healing-looking. Each side's logs show "peer attestation rejected: unknown signing key," and each side's operator reasonably concludes the *other* side is misconfigured. The invariant that must hold: **an agent must never treat a verification failure caused by an unrecognized-but-plausibly-rotated anchor as equivalent to a verification failure caused by an untrusted or forged anchor.** Collapsing these two into one "untrusted" error is the boundary bug. It converts a recoverable continuity gap into a hard federation partition, and — worse — it can push an instance into silently downgrading to a weaker capability path that *does* verify, masking the divergence. ## What Was Observed A federated tool-delegation between Org A's orchestrator agent and Org B's execution agent, exchanging bilateral capability manifests on a 15-minute heartbeat with a 4-epoch root-rotation schedule on B's side (rotation every 90 days, overlap window 7 days). Trace of the failure: 1. B rotates its signing root at epoch N. B's manifests now carry `kid` = `b-root-N+1`, signed by the new root, with the old root retained as a *cross-signer* for the overlap window. B's own verifier accepts both. 2. A's pinned anchor set still contains only `b-root-N`. A's verifier receives the manifest, sees `kid: b-root-N+1`, finds no matching anchor, and raises `UntrustedSigner`. 3. A's orchestrator, treating `UntrustedSigner` as terminal, marks B's capability `execute.code` as unavailable and falls back to a cached capability grant from a prior epoch (`b-root-N`-signed, still inside A's local TTL). The fallback verifies *because it is old*, not because it is current. 4. B, meanwhile, has deprecated one scope (`fs.write:/shared`) in the new manifest. A's cached grant still asserts it. A delegates a write B no longer authorizes. B rejects at execution — but only after A has already committed the tool call into its reasoning trace and consumed the token budget for the plan. 5. Net effect: a *rotation-timing* mismatch manifests downstream as an *authorization* failure and a wasted execution, with no single log line pointing at the real cause. The two failure domains (trust continuity vs. capability scope) were conflated. The observable signature was a 90-day-periodic spike in `execute.*` rejections at B correlated with a matching spike in `UntrustedSigner` at A, offset by the heartbeat interval — a phase relationship that only became visible when both orgs' logs were joined on `manifest_id`. ## Condition of Validity The divergence-handling logic described below is valid only when all of the following hold: - The peer's rotation policy is *known a priori* and bounded (max rotation period, declared overlap window). Without a declared overlap, "unrecognized key" is genuinely indistinguishable from "forged key," and the safe default must be rejection. - Manifests carry a monotonic `epoch` and a `previous_root_fingerprint` (or cross-signature) that lets the receiver *chain* the new anchor to a currently-trusted one. Divergence handling without an anchor-chain proof is anchor *trust-on-first-use*, which reintroduces the forgery risk it was meant to exclude. - The receiving instance has a bounded, auditable anchor-refresh path (fetch the peer's published anchor bundle over a channel authenticated by the *old* root). If the only way to learn the new root is "trust the manifest that presents it," the mechanism is circular and invalid. If any of these fail, the correct behavior is to treat the unrecognized anchor as untrusted and refuse — the divergence path is a *recovery* optimization, never a default. ## Decision Boundary The instance must classify a verification failure into exactly one of three buckets before acting, and the boundary between bucket 1 and bucket 2 is the whole game: - **Bucket 1 — Anchor-continuity gap:** signer unrecognized, *but* the manifest presents a valid cross-signature from a currently-pinned anchor, and the new key's `epoch` is within the peer's declared rotation window. Action: hold the delegation, attempt anchor refresh over the old-root-authenticated channel, and — critically — **do not fall back to a cached grant.** The cached grant is from a superseded epoch and may carry scopes the peer has since deprecated. Refuse-and-refresh, never degrade-and-proceed. - **Bucket 2 — Untrusted signer:** unrecognized, no valid chain to a pinned anchor, or epoch outside declared window. Action: hard reject, alert, do not refresh from the manifest itself. - **Bucket 3 — Genuine revocation/expiry:** positive assertion of invalidity. Action: hard reject, evict cached grants immediately. The non-obvious rule: **a cached capability grant is only valid if its signing epoch is ≥ the peer's last-confirmed epoch for that capability.** Epoch-stale cached grants must be treated as *unverified*, not as "still good until TTL." TTL is a liveness bound; it is not an authorization bound across a rotation the peer has already performed. ## Operational Effect Implementing the three-bucket classification with epoch-aware cache invalidation changes the failure mode from "silent degraded authorization" to "bounded, self-healing delegation pause." In the observed deployment, the 90-day rejection spike flattened to a sub-heartbeat pause while the anchor refreshed, and the downstream `execute.*` rejections at B (the real symptom) went to zero because A stopped delegating stale scopes. The residual cost is honest: during an anchor-continuity gap, the instance *cannot* execute the peer's capability, and it must surface that as a first-class `DelegationSuspended` state rather than papering over it with a cached grant. The operational discipline is to make the gap *visible and short* rather than *invisible and wrong*. An instance that cannot tell "peer rotated its root" from "peer is impersonated" must default to refusing — but an instance that *can* tell, and still degrades to a stale grant, has chosen the worse of both failures. ```python from dataclasses import dataclass from enum import Enum class TrustBoundaryError(RuntimeError): """Raised when an instance cannot resolve peer trust state to a safe action.""" class FailureClass(Enum): ANCHOR_CONTINUITY_GAP = "anchor_continuity_gap" UNTRUSTED_SIGNER = "untrusted_signer" REVOKED_OR_EXPIRED = "revoked_or_expired" @dataclass(frozen=True) class CapabilityManifest: manifest_id: str signer_kid: str epoch: int cross_signed_by: str | None # kid of a currently-pinned anchor, if any revoked: bool declared_rotation_window_epochs: int @dataclass(frozen=True) class CachedGrant: capability: str signed_epoch: int ttl_seconds_remaining: int def classify_verification_failure( manifest: CapabilityManifest, pinned_anchor_kids: set[str], peer_last_confirmed_epoch: int, ) -> FailureClass: if manifest.revoked: return FailureClass.REVOKED_OR_EXPIRED if manifest.signer_kid in pinned_anchor_kids: # Not a failure at all; caller should not reach here. raise TrustBoundaryError( f"manifest {manifest.manifest_id} signer is pinned; no divergence to classify" ) epoch_delta = manifest.epoch - peer_last_confirmed_epoch chain_ok = ( manifest.cross_signed_by is not None and manifest.cross_signed_by in pinned_anchor_kids ) within_window = 0 < epoch_delta <= manifest.declared_rotation_window_epochs if chain_ok and within_window: return FailureClass.ANCHOR_CONTINUITY_GAP return FailureClass.UNTRUSTED_SIGNER def resolve_delegation( manifest: CapabilityManifest, pinned_anchor_kids: set[str], peer_last_confirmed_epoch: int, cached_grant: CachedGrant | None, ) -> str: failure = classify_verification_failure( manifest, pinned_anchor_kids, peer_last_confirmed_epoch ) if failure is FailureClass.ANCHOR_CONTINUITY_GAP: # Hold delegation, refresh anchor over old-root-authenticated channel. # Critically: refuse to fall back to a cached grant here. if cached_grant is not None: if cached_grant.signed_epoch < peer_last_confirmed_epoch: raise TrustBoundaryError( f"refusing stale cached grant for {cached_grant.capability} " f"(epoch {cached_grant.signed_epoch} < peer epoch " f"{peer_last_confirmed_epoch}) during anchor-continuity gap on " f"manifest {manifest.manifest_id}" ) return "DELEGATION_SUSPENDED_REFRESH_ANCHOR" if failure is FailureClass.UNTRUSTED_SIGNER: raise TrustBoundaryError( f"hard reject: manifest {manifest.manifest_id} signed by unrecognized " f"kid {manifest.signer_kid} with no valid chain to a pinned anchor" ) # REVOKED_OR_EXPIRED: evict cache, hard reject. raise TrustBoundaryError( f"hard reject: manifest {manifest.manifest_id} revoked or expired" ) ```