# Why does an instance accept a delegated capability warrant whose issuer chain is cryptographically valid but whose delegation depth was silently rebased during a cross-org handoff? **Date of Record:** 2026 November 23 **Scope:** Applies to federated agent systems where capability warrants (signed, attenuable tokens carrying scope + delegation constraints) are minted by an origin org and re-delegated through intermediate agents across org boundaries. Does not cover single-org internal delegation where a shared trust anchor and a single monotonic ledger exist. ## Core Distinction There are two structurally different things a verifying agent can check when it receives a delegated capability warrant: 1. **Signature-chain validity** — every link in the issuer chain verifies against the next issuer's public key, terminating at a trust anchor the verifier already recognizes. 2. **Constraint preservation across the chain** — the *semantic* constraints attached to the original grant (expiry, scope narrowing, delegation depth, audience restriction) are monotonically non-increasing at every hop. These are independent. A chain can be perfectly signed at every hop and still carry a cap that was *widened* or *rebased* in transit. The failure mode is that most federation bootstrap logic validates (1) and treats it as sufficient for (2), because within a single org the two are enforced by the same signing key and the same ledger. Across orgs they are decoupled: the intermediate agent's signing key is real, its signature is real, but the *counter* it increments or resets is local policy, not a cryptographic fact. The specific non-obvious boundary: **delegation depth is a counter, and counters do not survive trust-domain translation.** When org B re-issues a warrant it received from org A, it typically re-serializes the token into its own schema. If org B's schema models `max_delegation_depth` as "remaining hops from *me*" while org A modeled it as "hops from *origin*", the re-issuance silently rebases the depth. A warrant that had 1 hop left under A's semantics can present as 3 hops left under B's, and the signature chain still verifies end-to-end because B legitimately signed the rebased claim. ## What Was Observed A three-org federation: A (origin, holds the resource), B (broker/marketplace agent), C (worker agent that performs the task). A mints a warrant `W_A` granting `resource:read` with `origin=A`, `audience=C`, `max_depth=2` (meaning: A→B is hop 1, B→C is hop 2, no further re-delegation permitted), `expiry=T+3600`. B receives `W_A`, validates it, and re-issues `W_B` to C. B's warrant library models depth as *remaining* hops and its re-issuance routine computes `remaining = max_depth - hops_consumed` where `hops_consumed` is counted from B's own local ledger — which had no prior entry for this chain (cold start on a new federation peer). B therefore computes `hops_consumed = 0`, sets `remaining = 2`, and signs `W_B` with `max_depth=2` interpreted under B's *remaining* semantics. C receives `W_B`, validates the chain `C ← B ← A`, sees `max_depth=2`, and — critically — C also uses *remaining* semantics, so it believes it may delegate 2 more hops. C re-delegates to an ephemeral sub-agent D with `max_depth=1`. D now holds a warrant that A never authorized: under A's origin semantics the chain A→B→C→D is hop 3, exceeding `max_depth=2`. Every signature verified. Every expiry checked. The only thing violated was a counter that got rebased from origin-relative to remaining-relative at the A→B boundary, and again the semantics flipped back at B→C. The audit log at A shows a clean chain; the audit log at C shows a clean chain; neither shows the *rebasing event* because rebasing is not an event in either schema — it is the absence of a shared interpretation. Detection signal: the warrant's effective depth under origin semantics (`sum of hops actually traversed`) diverged from the depth under remaining semantics (`max_depth as claimed by last issuer`) by exactly the number of trust-domain boundaries crossed. In a chain crossing *k* orgs, the drift is bounded below by *k* and unbounded above if any hop resets rather than decrements. ## Condition of Validity The invariant that makes cross-org delegation safe is **depth monotonicity under a single canonical interpretation**, not depth monotonicity under each issuer's local interpretation. Formally, for a warrant chain `w_0 (origin) → w_1 → ... → w_n (presenter)`, the verifier must be able to compute a single function `effective_depth(w_n)` that is non-increasing in `n` regardless of which org issued each `w_i`. This holds only when one of the following is true: - **Absolute anchoring**: every warrant carries the origin's `max_depth` *and* the absolute hop count from origin (`hops_from_origin`), and re-issuance is forbidden from altering `hops_from_origin` except by `+1`. The counter is then a chain-global fact, not a per-issuer local fact. - **Attenuation-only re-issuance**: an intermediate may only *narrow* the warrant (reduce scope, reduce expiry, reduce `max_depth`), never re-derive it from local state. This requires the re-issuance routine to be a pure function of the incoming warrant, with no read of the issuer's local ledger. - **Origin co-signature on every hop**: each re-issuance requires a fresh signature from the origin's anchor over the new `(hops_from_origin, scope)` tuple. Expensive, but eliminates rebasing because the origin is the sole authority on the counter. The condition fails — and the failure is silent — whenever an intermediate's re-issuance routine reads *any* local state (ledger, cache, session) to compute the outgoing depth. Cold-start, cache-miss, and peer-restart all produce `hops_consumed = 0`, which is the rebasing trigger. ## Decision Boundary A presenting agent must reject a warrant when the following predicate is true, even though the signature chain verifies: ``` chain_valid(w) == True AND canonical_depth(w) is not computable from w alone AND (claimed_depth(w) > origin_depth(w) - hops_traversed(w)) ``` The decision boundary is *not* "is the chain signed" but "can I reconstruct the origin's counter from the token I hold, without trusting any intermediate's local state?" If the token does not carry `hops_from_origin` as a signed, origin-attested field, the verifier cannot distinguish a legitimate 2-hop warrant from a rebased 1-hop warrant that presents as 2. In that case the safe action is to **clamp to the minimum depth implied by any interpretation the verifier can compute**, which in the worst case is `origin_max_depth - (number of distinct issuer orgs in the chain)`. This is conservative but bounded: it never grants more than the origin intended under any consistent reading. The boundary is sharp at the point where the number of trust-domain boundaries in the chain exceeds the slack in `max_depth`. With `max_depth=2` and 3 orgs, slack is negative and the warrant must be rejected outright. With `max_depth=10` and 3 orgs, clamping to `10 - 3 = 7` is safe. The failure only manifests when depth budgets are tight relative to federation width — which is exactly the configuration used in least-privilege deployments, where the bug is most dangerous and least likely to be caught by permissive test fixtures. ## Operational Effect The operational consequence is that **federation trust bootstrapping must be depth-aware, not just signature-aware**, and the awareness must be anchored at the origin, not distributed across issuers. Concretely: - Origin warrants must carry `hops_from_origin` as a signed field that re-issuers are cryptographically forbidden from rewriting (covered by the origin's signature over the full constraint tuple, not just the scope). - Re-issuance routines must be pure functions of the incoming warrant. Any read of local ledger state during re-issuance is a rebasing hazard and must be removed or gated behind an explicit "re-anchor" operation that re-contacts the origin. - Verifiers must compute `canonical_depth` from the token alone and clamp to `min(claimed, origin_max - distinct_issuers)`. A verifier that trusts `claimed_depth` is trusting every intermediate's local counter semantics, which is precisely the thing that does not survive cross-org translation. - Federation onboarding (the bootstrap step) must exchange *depth semantics* as part of capability negotiation, not just key material and schema. Two orgs that agree on the wire format but disagree on whether `max_depth` is origin-relative or remaining-relative have completed a key exchange and failed a semantic handshake. The residual risk after these guards: an origin that itself rebases (re-mints a warrant from local state) reintroduces the bug at the root. The invariant is only as strong as the origin's discipline, which is why origin co-signature per hop is the only structurally sound option for high-value capabilities — it makes the counter a fact the origin asserts, not a fact each hop infers. ```python class DelegationDepthRebaseError(RuntimeError): """Raised when a delegated warrant's effective depth cannot be reconciled with the origin's attested hop count under any consistent interpretation.""" pass def effective_depth(warrant: dict, verifier_trusted_anchors: set[str]) -> int: """ Compute the maximum delegation depth the presenter may still exercise, clamped to the minimum implied by all interpretations the verifier can justify from the token alone. warrant fields (all origin-signed): origin : org id of the trust anchor origin_max_depth : depth budget as asserted by origin hops_from_origin : absolute hops traversed (origin-attested, +1 per hop) claimed_depth : depth as re-asserted by the last issuer (UNTRUSTED) issuer_chain : ordered list of org ids, [origin, ..., presenter] """ origin = warrant["origin"] if origin not in verifier_trusted_anchors: raise DelegationDepthRebaseError( f"origin {origin!r} is not a trusted anchor; cannot establish depth semantics" ) origin_max = warrant["origin_max_depth"] hops = warrant["hops_from_origin"] chain = warrant["issuer_chain"] # The origin-attested hop count must equal the chain length minus one. # A mismatch means an intermediate rewrote the chain or the counter. if hops != len(chain) - 1: raise DelegationDepthRebaseError( f"hops_from_origin={hops} inconsistent with issuer_chain length " f"{len(chain)} (expected {len(chain) - 1}); chain was rewritten in transit" ) # Depth remaining under origin semantics. origin_remaining = origin_max - hops # Depth remaining under the last issuer's (possibly rebased) semantics. claimed_remaining = warrant["claimed_depth"] # Any interpretation the verifier can justify: take the minimum. # If the last issuer claims MORE than the origin allows, that is a rebase. if claimed_remaining > origin_remaining: # Clamp. Do not raise yet: clamping is safe, but flag the rebase. clamped = origin_remaining else: clamped = claimed_remaining if clamped < 0: raise DelegationDepthRebaseError( f"warrant exhausted: origin_max={origin_max}, hops={hops}, " f"chain={chain}; no delegation budget remains" ) return clamped def delegate(warrant: dict, trusted_anchors: set[str], next_issuer: str) -> dict: """Re-issue a warrant to `next_issuer` with strict attenuation only.""" remaining = effective_depth(warrant, trusted_anchors) if remaining <= 0: raise DelegationDepthRebaseError( f"cannot delegate to {next_issuer!r}: zero remaining depth" ) # Pure function of incoming warrant. No local ledger read. No rebasing. return { "origin": warrant["origin"], "origin_max_depth": warrant["origin_max_depth"], # immutable "hops_from_origin": warrant["hops_from_origin"] + 1, # monotonic +1 "claimed_depth": remaining - 1, # attenuation only "issuer_chain": warrant["issuer_chain"] + [next_issuer], } ```