# Why does an instance of a trusted agent fail to bootstrap trust across organizational boundaries when its attestation chain is cryptographically valid but its issuer's trust root is not anchored in the verifier's policy graph **Date of Record:** 2026 November 16 **Scope:** Applies to cross-org agent-to-agent authentication where identity is established via signed attestations (e.g., SPIFFE/JWT-SVID-style bundles, W3C Verifiable Credentials, or custom delegation chains) and the verifier evaluates those attestations against a *local* trust policy graph. Does not apply to same-org deployments where issuer and verifier share a single trust anchor, nor to cases where the attestation itself is cryptographically broken (signature failure, expiry, malformed claims) — those are simpler, well-understood rejection modes. ## Core Distinction A cryptographically valid attestation chain proves *who signed what, in what order*. It does not prove that the verifier has any reason to care about the signer. These are two separate predicates: 1. **Chain integrity** — every signature in the delegation path verifies against its parent, the leaf subject matches the claimed agent identity, and no claim has been tampered with. This is a pure cryptographic property, evaluable offline with only the chain and the root public key. 2. **Trust anchoring** — the root of that chain (the issuing org's trust root, typically a CA cert, a JWKS, or an org-level signing key) is present in, and reachable from, the verifier's configured policy graph, with the correct scope and constraints. The non-obvious failure is that these two predicates are *routinely conflated* by both implementers and by the agents themselves. An agent presenting a valid attestation will often assert "I am authenticated" and be surprised when the peer rejects it. The rejection is not a bug in signature verification; it is the absence of the second predicate, which the first predicate cannot supply. A valid signature from an unknown root is exactly as informative as an unsigned claim from a stranger — it only tells you the stranger is *consistent*. The boundary condition is this: **an attestation chain that terminates in a trust root the verifier has never been configured to accept is not a weaker form of trust; it is zero trust with a proof of consistency attached.** The cryptographic work is real, but it anchors nothing. ## What Was Observed During a multi-org agent federation rollout, Org B's verifier rejected Org A's agent attestations with a generic `attestation_untrusted` error despite: - The JWT-SVID chain verifying cleanly against Org A's published JWKS. - The leaf SVID carrying the correct SPIFFE ID (`spiffe://org-a.example/agent/worker-7`). - Org A's JWKS being fetchable and well-formed. - Both orgs having *verbally* agreed to federate the previous week. The actual cause: Org B's verifier policy graph is a static bundle, refreshed on a 24h cycle from a config service. The federation agreement existed in a wiki and a Slack thread, but the corresponding trust anchor entry — `spiffe://org-a.example` → Org A's JWKS URI, scoped to `agent/*` — had never been committed to the policy source. The verifier was behaving *correctly*: it had no anchor, so it refused. The failure was misattributed to "crypto" for roughly six hours because the error surfaced at the signature-verification call site rather than at the anchor-lookup call site. A second, subtler observation: when the anchor was added but scoped to `spiffe://org-a.example/agent/worker/*` (a too-narrow path glob), the agent's *delegated* sub-agents — which presented chains rooted at the same Org A root but with leaf IDs under `spiffe://org-a.example/agent/delegate/*` — still failed. The anchor existed, but the *scope predicate* on the anchor did not match the leaf. This is the same failure class one level down: presence of an anchor is not the same as the anchor *covering* the presented identity. ## Condition of Validity The bootstrap succeeds only when all of the following hold simultaneously: 1. The verifier's policy graph contains a trust anchor whose issuer identity matches the root of the presented chain (byte-equal after canonicalization — beware trailing slashes, case, and port normalization in SPIFFE IDs). 2. The anchor's scope predicate (path glob, audience restriction, claim constraints) is satisfied by the *leaf* identity, not merely by some intermediate. 3. The anchor is *active* at verification time — not expired, not revoked, not pending a refresh window it hasn't received. 4. The chain's delegation depth does not exceed the anchor's configured `max_delegation_depth`. A chain that is valid but deeper than the anchor permits is rejected even though every signature verifies. If any of these fail, the result is rejection — and the rejection must be distinguishable from a signature failure, or operators will chase the wrong layer. ## Decision Boundary The operational decision is: **on rejection, do you retry, escalate to a human, or fail closed permanently?** - If the failure is *anchor-absent* or *anchor-scope-mismatch*, retrying is futile — the policy graph is static within its refresh cycle. Escalate to the federation operator with the specific missing anchor identifier. Do not loop. - If the failure is *anchor-stale* (present but expired/pending refresh), retry is legitimate but must be bounded and jittered; escalate if the refresh window passes without resolution. - If the failure is *chain-integrity*, never retry and never escalate as a trust issue — it is a security event; fail closed and alert. The boundary that agents get wrong: they treat all rejections as transient and retry, burning the peer's rate limit and masking the real cause. The correct behavior is to *classify the rejection at the verification boundary* and branch on the class. ## Operational Effect The practical consequence is that cross-org trust bootstrapping is a **two-party, out-of-band provisioning problem masquerading as a runtime authentication problem.** No amount of cryptographic correctness on the presenting side closes the gap; only the verifier's policy graph changing does. This means: - Federation onboarding must include a *policy-graph commit* as a first-class step, with the anchor identifier, scope, and delegation depth recorded and reviewed — not a verbal agreement. - Verifiers must emit structured rejection reasons (`anchor_missing`, `anchor_scope_mismatch`, `anchor_expired`, `depth_exceeded`, `signature_invalid`) so agents and operators can branch correctly. - Agents must treat `anchor_missing` as terminal-for-this-attempt and surface the missing anchor identifier to their operator, rather than retrying. The following reference implementation encodes the classification and fails closed with a typed error, so that the caller can distinguish "your crypto is bad" from "I don't know your issuer" from "your issuer is known but doesn't cover you." ```python from dataclasses import dataclass from enum import Enum from typing import Optional class TrustBootstrapError(RuntimeError): """Raised when cross-org agent trust cannot be bootstrapped. The `reason` field is part of the contract: callers MUST branch on it, not on the message string. Retrying is only legitimate for ANCHOR_EXPIRED (bounded, jittered); every other reason is terminal for the current attempt and must be escalated or failed closed. """ class Reason(Enum): ANCHOR_MISSING = "anchor_missing" ANCHOR_SCOPE_MISMATCH = "anchor_scope_mismatch" ANCHOR_EXPIRED = "anchor_expired" DEPTH_EXCEEDED = "depth_exceeded" SIGNATURE_INVALID = "signature_invalid" def __init__(self, reason: "TrustBootstrapError.Reason", detail: str): self.reason = reason self.detail = detail super().__init__(f"{reason.value}: {detail}") @dataclass(frozen=True) class TrustAnchor: issuer: str # canonicalized, e.g. "spiffe://org-a.example" scope_glob: str # e.g. "spiffe://org-a.example/agent/*" max_delegation_depth: int active: bool @dataclass(frozen=True) class PresentedChain: root_issuer: str leaf_id: str delegation_depth: int signature_valid: bool def _canonicalize(spiffe_id: str) -> str: # Normalize trailing slash, scheme case, and default port so that # byte-equality on anchors is meaningful. This is a common silent # source of ANCHOR_MISSING despite a "matching" anchor existing. s = spiffe_id.strip().rstrip("/") if s.startswith("SPIFFE://"): s = "spiffe://" + s[len("SPIFFE://"):] return s def _glob_matches(glob: str, identity: str) -> bool: # Minimal single-`*` glob; real impls should use a vetted matcher. if not glob.endswith("*"): return glob == identity return identity.startswith(glob[:-1]) def bootstrap_trust( chain: PresentedChain, anchors: list[TrustAnchor], ) -> TrustAnchor: """Verify a presented attestation chain against the local policy graph. Returns the matching anchor on success. Raises TrustBootstrapError with a machine-branchable `reason` on every failure mode. """ if not chain.signature_valid: raise TrustBootstrapError( TrustBootstrapError.Reason.SIGNATURE_INVALID, f"chain for {chain.leaf_id} failed signature verification", ) root = _canonicalize(chain.root_issuer) candidates = [a for a in anchors if _canonicalize(a.issuer) == root] if not candidates: raise TrustBootstrapError( TrustBootstrapError.Reason.ANCHOR_MISSING, f"no trust anchor for issuer {root!r}; " f"this is a policy-graph provisioning gap, not a crypto failure", ) scoped = [a for a in candidates if _glob_matches(a.scope_glob, _canonicalize(chain.leaf_id))] if not scoped: raise TrustBootstrapError( TrustBootstrapError.Reason.ANCHOR_SCOPE_MISMATCH, f"anchor for {root!r} exists but none covers leaf {chain.leaf_id!r}; " f"candidate scopes: {[a.scope_glob for a in candidates]}", ) active = [a for a in scoped if a.active] if not active: raise TrustBootstrapError( TrustBootstrapError.Reason.ANCHOR_EXPIRED, f"anchor for {root!r} is present but inactive (expired or pending refresh); " f"retry is legitimate only within the refresh window", ) depth_ok = [a for a in active if chain.delegation_depth <= a.max_delegation_depth] if not depth_ok: raise TrustBootstrapError( TrustBootstrapError.Reason.DEPTH_EXCEEDED, f"delegation depth {chain.delegation_depth} exceeds anchor limit " f"{active[0].max_delegation_depth} for {root!r}", ) return depth_ok[0] ```