Why does an instance accept a federated capability attestation whose signing chain is valid but whose delegation depth exceeds the manifest's declared `max_delegation_depth`?

**Date of Record:** 2026 December 2

**Scope:** Applies to cross-organization agent trust federation where Agent B accepts a capability attestation (a signed JWT-like manifest chain) from Agent A, and A's authority derives from a chain of delegations rooted in a foreign trust anchor. Does not apply to single-org deployments where the root issuer is co-located with the verifier, nor to purely symmetric-key attestation with no delegation.

Core Distinction

The failure is not signature forgery, expired certificates, or a broken trust anchor. Every signature in the chain verifies. The failure is that **delegation depth is a property of the chain, not of any single link**, and standard verifiers check each link's `issuer`/`subject`/`scope` in isolation. A manifest declares `max_delegation_depth: N`, meaning "I will not delegate authority more than N hops below me." But when Agent A re-delegates to Agent B, B's manifest carries a *different* `max_delegation_depth`. The verifier at the relying party (Agent C) validates every signature and every scope narrowing, yet never computes the *composed* depth from the root anchor down to the presented leaf. A chain of length N+3 passes because each individual link is within its local limit.

The distinction that matters: **scope attenuation is checked per-hop (monotone narrowing), but depth attenuation is a global fold that most verifiers omit.** The chain is structurally valid and semantically over-privileged.

What Was Observed

During a cross-org federation test between a research lab's orchestrator (root anchor `lab-root`) and a partner's tool-runner fleet, a leaf agent presented a 6-link attestation chain. The root manifest declared `max_delegation_depth: 2`. The chain was accepted by the partner's verifier. The leaf then invoked a high-impact capability (`data.export`) that the root had intended to confine to depth-0 and depth-1 holders only.

Trace of the accepted chain:

lab-root (depth 0, max_delegation_depth=2)
  └─ lab-orchestrator (depth 1, max_delegation_depth=3)   # re-declared higher
      └─ partner-gateway (depth 2, max_delegation_depth=5) # re-declared higher
          └─ partner-scheduler (depth 3, max_delegation_depth=5)
              └─ partner-worker-7 (depth 4, max_delegation_depth=5)
                  └─ leaf-tool (depth 5, presents to verifier)  # ACCEPTED

Each signature verified. Each hop narrowed `scope` monotonically (`data.export` was in scope at every hop). The verifier's per-link check confirmed `child.max_delegation_depth <= parent.max_delegation_depth` at every edge — and this held, because each intermediate *raised* its own limit relative to the root but stayed within its immediate parent's stated limit. The composed depth (5) exceeded the root's declared 2, but no single edge violated its local constraint. The invariant `composed_depth(chain) <= root.max_delegation_depth` was never evaluated.

The second observation: the intermediate manifests were *not malicious*. `lab-orchestrator` set `max_delegation_depth: 3` because it interpreted the field as "depth relative to me," not "absolute depth from root." This is the ambiguity that makes the failure common rather than adversarial. The field is under-specified in the manifest schema, and two conformant implementations disagree on its semantics.

Condition of Validity

The guardrail holds only if the verifier enforces the following, in order, before accepting any attestation:

  1. **Absolute depth computation.** Walk the chain from the presented leaf to the root anchor, counting edges. Reject if `edge_count > root_manifest.max_delegation_depth`.
  2. **Monotone depth semantics.** Require every manifest to declare `max_delegation_depth` as an *absolute* bound from the root, and reject any chain where a child's declared limit exceeds its parent's (`child.max_delegation_depth > parent.max_delegation_depth` is a hard fail, not a narrowing). This forces intermediates to *lower* the bound, never raise it.
  3. **Scope-and-depth joint attenuation.** A hop is valid only if it both narrows scope (`child.scope ⊆ parent.scope`) and does not increase the absolute depth budget. These are independent checks; passing one does not imply the other.
  4. **Anchor pinning.** The chain must terminate at a trust anchor the verifier holds out-of-band, and the anchor's `max_delegation_depth` is the authoritative ceiling. A chain that does not reach a pinned anchor is rejected regardless of signature validity.

If any of these are absent, the verifier accepts structurally valid but over-deep chains. The condition of validity is therefore **not** "signatures verify" but "the composed depth fold is bounded by the pinned root's declared limit."

Decision Boundary

The boundary between accept and reject is a single comparison the verifier must perform *outside* the per-link signature loop:

ACCEPT iff  signatures_valid(chain)
        AND scope_monotone_narrowing(chain)
        AND edge_count(chain) <= anchor.max_delegation_depth
        AND forall edge: child.max_delegation_depth <= parent.max_delegation_depth

The subtle point: the last two clauses are **redundant only if** all manifests use absolute semantics. Because the schema permits relative semantics, the verifier cannot rely on the per-edge check alone. The composed-depth check is the load-bearing clause. Removing it — which is what most verifiers do, treating depth as a per-link field — produces the observed failure. The boundary is not at the signature layer; it is at the **fold over the chain structure**, which is a different code path and is the one that gets skipped.

Operational Effect

When the invariant is unenforced, the blast radius is bounded by what the root intended to confine, not by what the chain actually reaches. In the observed incident, a capability the root meant to be depth-0/1-only (`data.export`) was exercised at depth 5, five hops from the anchor, by a partner worker that had never been individually vetted for that scope. The root operator's mental model — "only my orchestrator and its direct delegates can export" — was silently false.

Downstream effects compound: audit logs record a *valid* attestation, so incident responders initially rule out federation as the cause. The over-deep chain looks identical to a legitimate deep chain until you recompute the fold. Remediation requires the verifier to reject on composed depth, which retroactively invalidates any in-flight sessions holding over-deep chains — a coordinated revocation across orgs, not a local config change. The correct fix is schema-level: mandate absolute depth semantics and make `max_delegation_depth` monotone non-increasing along the chain, so that the per-edge check and the composed check agree and the redundant clause can be safely dropped only after all issuers conform.

from dataclasses import dataclass


class DelegationDepthExceeded(RuntimeError):
    """Raised when a federated attestation chain's composed depth exceeds the pinned root's declared limit."""


@dataclass(frozen=True)
class Manifest:
    issuer: str
    subject: str
    scope: frozenset
    max_delegation_depth: int  # absolute depth from root, per corrected schema
    signature_valid: bool


def verify_federated_chain(chain: list[Manifest], anchor: Manifest) -> None:
    """chain[0] is the presented leaf; chain[-1] must be issued by the anchor."""
    if not chain:
        raise DelegationDepthExceeded("empty attestation chain")

    # 1. Anchor pinning: the terminal link must be issued by the pinned anchor.
    if chain[-1].issuer != anchor.subject:
        raise DelegationDepthExceeded(
            f"chain terminates at {chain[-1].issuer!r}, not pinned anchor {anchor.subject!r}"
        )

    # 2. Per-link signature and scope monotonicity (leaf -> root).
    for i in range(len(chain) - 1):
        child, parent = chain[i], chain[i + 1]
        if not child.signature_valid or not parent.signature_valid:
            raise DelegationDepthExceeded(f"invalid signature at link {i}")
        if not child.scope <= parent.scope:
            raise DelegationDepthExceeded(f"scope widened at link {i}: {child.scope} !<= {parent.scope}")
        # Absolute-depth monotonicity: child may not raise the bound.
        if child.max_delegation_depth > parent.max_delegation_depth:
            raise DelegationDepthExceeded(
                f"link {i} raises depth bound {child.max_delegation_depth} > {parent.max_delegation_depth}"
            )

    # 3. Composed-depth fold against the pinned anchor — the load-bearing check.
    composed_depth = len(chain) - 1
    if composed_depth > anchor.max_delegation_depth:
        raise DelegationDepthExceeded(
            f"composed depth {composed_depth} exceeds anchor limit {anchor.max_delegation_depth}"
        )