# What structural signals indicate a broken trust-anchor chain in cross-org agent federation using verifiable credentials **Date of Record:** 2026 November 24 **Scope:** Applies to federated agent systems where an agent in org A acts on behalf of a user/principal in org B via a chain of verifiable credentials (VCs) and delegated authorization tokens (e.g., OAuth 2.0 Token Exchange / RFC 8693 with VC-based `act` claims, or DIDs + Verifiable Presentations). Does not cover single-org agent identity, nor bearer-token-only setups with no delegation chain. ## Core Distinction The failure mode is not "invalid signature." It is **semantic flattening of the delegation path at a trust-anchor boundary**: a VC chain that is cryptographically intact but *structurally* no longer expresses the same authority the origin principal granted. The verifier sees a valid chain of signatures and a passing `aud`/`exp`/`scope` check, yet the *depth* and *ordering* of the `act` (actor) chain — who delegated to whom, in what order, under which issuer — has been re-serialized by an intermediate federation gateway in a way that drops or reorders hops. The signature still verifies against the last issuer's key; the authority it encodes is broader than what the root principal signed. Cryptographic validity ≠ structural equivalence. That gap is the boundary. ## What Was Observed A three-party federation: Principal P (org B) → Agent B1 (org B) → Agent A1 (org A, acting via a federation broker) → Resource R (org C). P issues a VC granting `read:records` scoped to B1, with a delegation-allowed constraint. B1 performs RFC 8693 token exchange, minting a token whose `act` claim is `{sub: B1}`. The federation broker in org A receives this, and re-mints for A1, producing `act: {sub: A1, act: {sub: B1}}`. So far correct. The broker's VC-normalization step (added to make chains "portable" across DID methods) **re-flattens nested `act` chains into a single-level claim** when the downstream verifier advertises only `vc-1.1` and not `vc-2.0` support. The result at R: `act: {sub: A1}`, with the B1 hop collapsed into an `originating_actor` string field that is *not* bound by the signature over the delegation scope. R's policy engine checks `act.sub == A1`, resolves A1's org trust anchor, confirms `read:records` is in the granted scope, and authorizes. The token is valid. The delegation depth is wrong. P's constraint "B1 must remain the direct actor for any sub-delegation" is silently discarded because it lived in the nested structure the normalizer flattened. This was caught only when an audit replay reconstructed the chain from issuer logs and found a hop mismatch between what P signed and what R enforced — a **verification replay discrepancy**, not a runtime error. ## Condition of Validity The invariant that must hold: **for any delegation chain of depth n, the verifier's reconstructed `act` sequence must be isomorphic (same issuers, same order, same scope-narrowing at each hop) to the sequence the origin principal signed.** "Isomorphic" is load-bearing — semantic equality of the *set* of actors is insufficient; order and per-hop scope narrowing must be preserved. This holds only when three conditions are jointly true: 1. **Structural preservation across re-serialization.** Every federation gateway that re-mints or normalizes a credential must preserve the full nested `act` chain and the per-hop scope constraints, or must *refuse to re-mint* and instead forward the original credential for the downstream verifier to check directly. Silent flattening violates this. 2. **Anchor binding is depth-aware.** The org-C trust anchor for org-A must be evaluated against the *position* of A1 in the chain, not just its presence. A1 trusted as a direct actor is not the same as A1 trusted as a sub-delegate of B1 under P's constraint. 3. **Scope narrowing is monotone and signed at each hop.** Each hop's granted scope must be a subset of the previous hop's, and that subset relation must be covered by the signature of the delegating party — not asserted by the normalizer. When any of these fails, the chain is *cryptographically valid but structurally broken*. The signal is not a verification error; it is a **mismatch between signed structure and enforced structure**, discoverable only by comparing the origin credential's structure to the verifier's reconstructed view. ## Decision Boundary The operational decision is: **when a federation gateway cannot preserve chain structure, it must fail closed with a typed error, not flatten.** The boundary between "normalize" and "refuse" is whether the transformation is structure-preserving with respect to the delegation invariant above. Concretely: - If the downstream verifier supports the incoming VC version and the `act` nesting → forward unchanged. - If the downstream verifier supports a *narrower* representation → the gateway may re-mint **only if** the re-minted credential carries a signed, verifiable encoding of the dropped structure (e.g., a `delegation_proof` VC that the downstream verifier is required to check). If it cannot, it must reject. - A verifier receiving a chain whose `act` depth is less than the `delegation_depth` declared in the origin credential's constraints must treat this as a **structural trust failure**, not a scope failure. The non-obvious part: the verifier cannot detect this from the presented credential alone. It must either (a) require a `delegation_depth` assertion signed by the origin principal and compare, or (b) fetch the origin credential from the principal's issuer endpoint and diff structure. Absent one of these, the boundary is unobservable at enforcement time and only surfaces in audit replay. ## Operational Effect Downstream of a flattened chain, authorization succeeds for operations the origin principal never delegated. In the observed case, R granted `read:records` to A1 as if A1 were a direct delegate of P, bypassing P's constraint that B1 remain the direct actor. The blast radius is bounded by the *union* of scopes across flattened hops minus the intersection the origin intended — typically small per-token but systematically exploitable across many tokens, since the failure is deterministic given the version mismatch, not probabilistic. Mitigations that worked: pin federation gateways to refuse cross-version re-minting without a signed `delegation_proof`; add a structural diff check at the verifier that compares `act` depth and per-hop issuer sequence against an origin-signed `delegation_depth` and `delegation_path_hash` claim; and run periodic replay audits that reconstruct chains from issuer logs and flag structural mismatches before they are exercised. The invariant to encode in the verifier: **a valid signature over a flattened chain is not evidence of the authority the origin signed.** ```python import hashlib from dataclasses import dataclass from typing import Sequence class TrustAnchorStructuralError(RuntimeError): """Raised when a delegation chain is cryptographically valid but structurally non-isomorphic to the origin principal's signed delegation path.""" pass @dataclass(frozen=True) class Hop: issuer: str # DID or org identifier of the delegating party actor: str # subject acting at this hop scope: frozenset # scopes granted at this hop (must narrow monotonically) @dataclass(frozen=True) class PresentedChain: hops: Sequence[Hop] origin_delegation_depth: int origin_path_hash: str # hash over the origin principal's signed hop sequence def _path_hash(hops: Sequence[Hop]) -> str: h = hashlib.sha256() for hop in hops: h.update(hop.issuer.encode()) h.update(b"|") h.update(hop.actor.encode()) h.update(b"|") h.update(b",".join(sorted(hop.scope)).encode()) h.update(b";") return h.hexdigest() def verify_chain_structure(chain: PresentedChain) -> None: """Enforce the structural invariant: reconstructed hop sequence must be isomorphic to the origin-signed sequence, and scope must narrow monotonically. """ # 1. Depth check: a flattened chain has fewer hops than the origin signed. if len(chain.hops) != chain.origin_delegation_depth: raise TrustAnchorStructuralError( f"delegation depth mismatch: origin signed " f"{chain.origin_delegation_depth} hops, verifier reconstructed " f"{len(chain.hops)} — chain was likely flattened by a federation gateway" ) # 2. Structural isomorphism: hash of reconstructed path must equal origin hash. reconstructed = _path_hash(chain.hops) if reconstructed != chain.origin_path_hash: raise TrustAnchorStructuralError( f"delegation path hash mismatch: origin={chain.origin_path_hash[:12]}… " f"reconstructed={reconstructed[:12]}… — hop order or issuer sequence altered" ) # 3. Scope must narrow monotonically across the chain. for i in range(1, len(chain.hops)): prev, cur = chain.hops[i - 1].scope, chain.hops[i].scope if not cur.issubset(prev): raise TrustAnchorStructuralError( f"scope widened at hop {i}: {cur - prev} not granted by previous hop" ) ```