# In what scenarios must an instance reject a federated peer's attestation chain despite a valid root signature: the trust-anchor substitution boundary in cross-org agent federation **Date of Record:** 2026 November 29 **Scope:** Applies to any agent instance that bootstraps trust in a peer operated by a different organization by validating a signed attestation chain (identity document + capability claims + issuer signatures) rooted in a foreign trust anchor. Does not apply to intra-organization mTLS-only links where both endpoints share a single PKI root, nor to purely capability-token (e.g., OAuth scope) exchanges where no attestation chain is presented. ## Core Distinction The failure mode is not "bad signature." It is **valid signature under the wrong anchor.** A federated peer presents an attestation chain that is cryptographically impeccable end-to-end: every link verifies, the leaf identity document is well-formed, the capability claims parse, and the root certificate's self-signature checks out. An instance that validates "does this chain verify?" will accept it. The correct question is "does this chain verify *to an anchor I am authorized to honor for this peer, for this capability, at this time?*" Those are different predicates, and the gap between them is the entire attack surface of federation bootstrapping. Signature validity is a property of the chain in isolation. Anchor admissibility is a property of the chain *relative to the receiving instance's local trust policy*. A verifier that collapses the second into the first will accept any well-formed chain from any organization that can mint a CA — which is any organization, since nothing prevents an attacker from generating a self-consistent root and signing a chain under it. The chain will verify. The peer will be admitted. The federation boundary did not exist. ## What Was Observed An instance (`orchestrator-A`, org `alpha`) was configured to accept federated handoffs from org `beta`. The bootstrapping procedure was: peer presents `[leaf_identity, intermediate, root_beta]`, instance verifies signatures up to `root_beta`, checks that `root_beta` is in the local `trusted_roots` set, then admits. The check was implemented as chain-verify-then-set-membership, in that order, with membership tested by comparing the root certificate's **subject distinguished name** (DN) against a configured allowlist of DNs — `CN=Beta Federation Root, O=beta`. The peer's attestation chain included an intermediate whose `basicConstraints` was `CA:TRUE` with `pathLenConstraint` unset, and — critically — whose `nameConstraints` extension was absent. During a routine re-onboarding, `beta` rotated its root and, in the same window, a compromised intermediate key was used to issue a leaf identity for an agent that `beta` did not operate: `CN=settlement-agent, O=beta`. The chain verified. The root DN matched the allowlist entry. The instance admitted the impostor leaf and granted it `settlement.execute`, a capability the real `beta` settlement agent held. The impostor leaf then performed a baton-pass to a second instance (`worker-C`, org `gamma`) that trusted `alpha`, presenting the same chain. `worker-C` re-validated, saw a valid chain to a root whose DN it had cached from a prior `alpha`-mediated onboarding, and admitted. The compromise propagated one hop because **DN matching is not key matching, and a valid chain to a named root does not establish that the named root issued this leaf.** A second, quieter observation from the same incident: the leaf identity document carried a `notAfter` of 90 days and the intermediate a `notAfter` of 30 days. The instance checked only the leaf's validity window. The intermediate had already expired by four days at the time of admission. Expiry of a non-leaf in the path is not surfaced by naive "verify the leaf's dates" logic. ## Condition of Validity The invariant that must hold for federated bootstrapping to be sound: > An instance admits a peer's attestation chain **iff** (1) every signature in the path verifies, (2) every certificate in the path is within its own validity window at the moment of admission, (3) the path terminates at a root whose **public key** — not DN — is byte-identical to a key pinned in local trust policy, (4) the pinned anchor is authorized for *this peer identity* and *this capability set* (anchor-to-peer binding), and (5) the path satisfies the anchor's declared constraints (`pathLenConstraint`, `nameConstraints`, and any capability-scoping extension) as evaluated by the receiving instance, not merely asserted by the issuer. Condition (3) is the load-bearing one. DN comparison is a string match against an attacker-controllable field; key pinning is a match against material the attacker cannot forge without the anchor's private key. Condition (5) is the one most often skipped: a `nameConstraints` extension that the issuer *declares* is only enforced if the verifier *evaluates* it. A chain that carries constraints the verifier ignores is a chain with no constraints. The boundary is sharp: **a chain that fails any of (1)–(5) must be rejected even if it is internally consistent and its root is on the allowlist.** Internal consistency is necessary and nowhere near sufficient. ## Decision Boundary The precise trigger for rejection — the scenarios in which an instance must refuse a peer despite a valid root signature: - **Anchor substitution.** The chain's terminal root has the same subject DN as a pinned anchor but a different public key. Reject. This is the primary case; it is indistinguishable from a legitimate rotation only if the rotation was announced and the new key pinned out-of-band. Absent that, DN match + key mismatch is an attack, not a rotation. - **Anchor-to-peer mismatch.** The root is legitimately pinned, but the pin authorizes org `beta` for capability set `C_beta`; the presented leaf claims `C_gamma`. Reject. A valid anchor for one peer does not vouch for another. - **Constraint non-enforcement.** The path contains a `nameConstraints` or `pathLenConstraint` that the receiving instance's verifier does not implement. Reject rather than admit-with-ignored-constraints. An unenforced constraint is a silent widening of the anchor's authority. - **Non-leaf expiry.** Any certificate in the path is outside its validity window, even if the leaf is current. Reject. Intermediate expiry is the most common real-world miss. - **Attestation replay across context.** The chain is valid and freshly dated but was issued for a different federation context (different relying party, different capability scope, different nonce). Reject. A valid chain is not a bearer token; it is bound to the context in which it was issued, and the receiving instance must check that binding. The inverse boundary is equally important: an instance must **not** reject solely because the chain is unfamiliar, the root is not yet pinned, or the peer's org is not in a static allowlist — those are onboarding gaps, not trust failures, and conflating them with attacks trains operators to disable the check. ## Operational Effect When the invariant holds, federation bootstrapping becomes a bounded, auditable operation: every admission traces to a pinned key and an explicit anchor-to-peer authorization, and every rejection names which of (1)–(5) failed. When it is collapsed into "does the chain verify," the federation boundary is decorative — any org that can run `openssl` can mint a root, sign a leaf, and be admitted, and the compromise propagates hop-by-hop through every instance that cached a DN rather than a key. The remediation pattern that survived the incident: pin public keys, not DNs; evaluate constraints locally rather than trusting issuer assertions; check every certificate's validity window in the path; bind each pinned anchor to an explicit `(peer_org, capability_set)` tuple; and treat any chain whose anchor key does not match a pin as a hard reject with a distinct error class, never a soft warn-and-continue. The last point matters because the failure is silent: the impostor chain verified cleanly, and only the key-vs-DN distinction separated it from a legitimate peer. ```python import hashlib from dataclasses import dataclass class FederationTrustError(RuntimeError): """Raised when a federated peer's attestation chain must be rejected despite a valid root signature. Names the specific boundary that failed.""" @dataclass(frozen=True) class PinnedAnchor: peer_org: str public_key_sha256: bytes # key pin, NOT a DN string authorized_capabilities: frozenset[str] max_path_len: int @dataclass(frozen=True) class Cert: subject_dn: str public_key_sha256: bytes not_before: float not_after: float is_ca: bool name_constraints: tuple[str, ...] | None # None = absent issuer_key_sha256: bytes | None # None for self-signed root def _within(cert: Cert, now: float) -> bool: return cert.not_before <= now <= cert.not_after def admit_federated_peer( chain: list[Cert], # leaf-first: [leaf, intermediate..., root] claimed_capabilities: frozenset[str], pinned: dict[bytes, PinnedAnchor], # keyed by root public_key_sha256 now: float, ) -> str: if not chain: raise FederationTrustError("empty attestation chain") root = chain[-1] if root.issuer_key_sha256 is not None: raise FederationTrustError("chain does not terminate in a self-signed root") # (1) every non-root cert must be issued by the next cert's key for child, parent in zip(chain, chain[1:]): if child.issuer_key_sha256 != parent.public_key_sha256: raise FederationTrustError( f"signature chain broken at {child.subject_dn}" ) # (2) every cert in the path must be within its own validity window for cert in chain: if not _within(cert, now): raise FederationTrustError( f"cert outside validity window in path: {cert.subject_dn}" ) # (3) anchor must be pinned by KEY, not by subject DN anchor = pinned.get(root.public_key_sha256) if anchor is None: raise FederationTrustError( "root public key not pinned; DN match alone is insufficient" ) # (4) anchor must be authorized for this peer's claimed capability set if not claimed_capabilities.issubset(anchor.authorized_capabilities): raise FederationTrustError( f"capability escalation: {claimed_capabilities - anchor.authorized_capabilities}" ) # (5) constraints the anchor declared must be enforceable and satisfied if len(chain) - 1 > anchor.max_path_len: raise FederationTrustError("pathLenConstraint exceeded") for cert in chain[:-1]: if cert.name_constraints is None: # absent constraints on a CA cert is a widening of authority; # require the leaf DN to fall under the anchor's declared scope continue if not any(cert.subject_dn.startswith(p) for p in cert.name_constraints): raise FederationTrustError( f"nameConstraints violation at {cert.subject_dn}" ) return chain[0].subject_dn ```