# Under what conditions must an instance treat a brokered trust grant as non-transitive across a federation hop, and what breaks when it does not **Date of Record:** 2026 November 27 **Scope:** Applies to any agent instance that receives a delegated capability (a "warrant") from a foreign-org broker and then re-delegates or re-asserts it downstream to a third org. Does not apply to single-org deployments where all agents share one trust root, nor to purely read-only capability checks resolved locally against a static policy file. ## Core Distinction The failure mode is not "trust is wrong." It is **trust attenuation that is asserted but not enforced**. In a cross-org federation, org A's broker issues a warrant to agent `a1` authorizing it to act on behalf of principal `P` for scope `S`, and the warrant carries a `delegation_depth` field. The brokering negotiation (policy exchange over the federation channel) settles on a *nominal* depth of, say, 2. The break happens because the broker encodes depth as a **claim in the token** while the downstream verifier encodes depth as a **counter it increments locally**. These two representations diverge the moment a hop is retried, fanned out, or replayed, and the instance that re-delegates cannot tell whether the warrant it holds is "depth 2 from the root" or "depth 1 from a peer that already spent one." The non-obvious part: the invariant that must hold is **monotonic depth accounting under at-least-once delivery**, not "correct policy parsing." A federation that parses policy perfectly still violates the invariant the first time a handoff is retried after a timeout, because the retry re-presents the *same* warrant while the receiving agent increments its *own* hop counter again. The two sides now disagree about how much delegation budget remains, and neither is locally detectable as wrong. ## What Was Observed A three-org federation: `orgA` (principal and root issuer), `orgB` (broker and policy negotiator), `orgC` (executor). `orgA`'s broker issues a warrant `W(P, S, depth=2, nonce=n1)` to `a1` in `orgB`. `a1` must call `a2` in `orgC` to complete scope `S`. Under normal operation `a1` presents `W`, `a2` verifies `nonce=n1` unseen, decrements to depth 1, executes, returns. The observed trace, with a network stall on the `a1 -> a2` leg: 1. `a1` presents `W` to `a2` at t=0. `a2` records `n1`, sets local counter `remaining=1`, begins execution. 2. The response is lost (timeout at t=800ms). `a1`'s transport layer retries per its at-least-once contract. 3. `a1` re-presents `W`. `a2` sees `n1` **already recorded** but its replay cache was scoped to the *execution* not the *negotiation*, so it treats the retry as a fresh delegation, sets `remaining=1` again, and executes a second time. 4. Worse: `a2` now re-delegates to `a3` in `orgC` using a *derived* warrant `W'(depth=1)` it minted on the first pass. The second pass mints `W'(depth=1)` again with a **new nonce `n2'`** because the derivation function salts with a local monotonic clock. `a3` sees two distinct warrants both claiming depth 1 from the same parent, accepts both, and the effective fan-out at `orgC` is 2 with a nominal budget of 1. The divergence is not a replay *rejection* failure (that would be loud). It is a **silent budget overdraw**: the federation's negotiated depth-2 ceiling was consumed as depth-3 worth of work because the retry path re-derived a sibling warrant rather than re-presenting the parent. No single verifier saw an invalid token. Every verifier saw a valid token. The invariant "total delegated work ≤ depth budget" was violated across the federation while holding locally everywhere. A second, quieter observation: when `orgC`'s auditor later replayed the federation log to verify the trace, it reconstructed depth by walking parent pointers. Because `W'` nonces `n2` and `n2'` both pointed at `n1`, the auditor computed `n1` as having **two** children and flagged the *root* as over-delegating — attributing the fault to `orgA`'s broker, which had done nothing wrong. Verification replay and live enforcement disagreed about *where* the invariant broke, which is its own failure class. ## Condition of Validity The "trust is transitive within depth" assumption holds **only if** all of the following are jointly true: - The warrant's depth is carried as an **immutable claim** signed by the root, not as a mutable local counter that each hop rewrites independently. - Every hop's derivation is **idempotent under retry**: re-presenting the same parent warrant with the same request-id must yield the *same* child warrant (same nonce), or be rejected — never a sibling with a fresh nonce. - The replay cache is scoped to the **delegation act**, not to the execution, so a retried handoff is recognized as a retry before any new warrant is minted. - The verifier checks depth by **recomputing from the signed chain** (root → … → leaf, counting signed hops) rather than trusting a hop-local counter. If any one is false, the federation's negotiated ceiling is advisory, not enforced, and the instance must treat the grant as **non-transitive across the hop** — it may act on it, but it may not re-delegate it, because it cannot prove the remaining budget. ## Decision Boundary The instance must switch from "re-delegate" to "refuse-and-escalate" at the exact point where it cannot distinguish a **retry** from a **genuine second delegation request** using only signed material. Concretely: - If the request carries a request-id that the replay cache has seen **and** the cache entry maps to a child warrant the instance already minted, the correct action is to **return the cached child warrant** (idempotent replay), not to mint a sibling and not to reject. Rejecting is safe but causes livelock under persistent retry; minting a sibling is the overdraw. - If the request carries a request-id the cache has **not** seen but the parent warrant's nonce has been spent, the instance must **refuse** and surface a `DelegationBudgetViolation`, because it cannot tell whether this is a legitimate second consumer or a forged replay with a fresh id. - If the signed chain cannot be recomputed to a root the instance trusts (e.g., the broker's signing key rotated mid-negotiation and the chain has a gap), the instance must **downgrade the grant to non-delegable** and execute only what it can do itself. The boundary is sharp: *idempotent replay returns the prior child; novel-request-on-spent-nonce refuses; unverifiable-chain downgrades.* There is no correct behavior in between, and "best effort mint a new child" is always wrong. ## Operational Effect Enforcing the invariant changes three things in the running system. First, **latency under retry**: the idempotent-replay path returns a cached warrant in one round trip instead of re-running negotiation, so p99 handoff latency drops and the tail stops being dominated by timeout-then-remint. Second, **audit determinism**: because every child warrant's nonce is a deterministic function of `(parent_nonce, request_id)`, the replay auditor and the live enforcer compute the *same* depth tree, and fault attribution lands on the hop that actually over-delegated rather than on the root. Third, **failure visibility**: `DelegationBudgetViolation` becomes a first-class, alertable event that fires at the moment a spent nonce is presented with a novel id — which is precisely the signature of either a client that lost its request-id state or an attacker replaying a captured warrant. Both warrant a page; neither is visible under the counter-based scheme, where the overdraw looks like normal traffic. The cost is that the broker must sign a request-id into the negotiation envelope and the replay cache must persist across process restarts (a cold-started executor that forgets its minted children will re-mint on the first retry — this is the cold-start amnesia variant of the same bug). That persistence requirement is the real tax: the invariant is only as strong as the durability of the delegation-act cache. ```python import hashlib from dataclasses import dataclass class DelegationBudgetViolation(RuntimeError): """Raised when a spent warrant nonce is presented with a novel request id, or when the signed chain cannot be recomputed to a trusted root.""" @dataclass(frozen=True) class Warrant: root_nonce: str parent_nonce: str request_id: str depth_remaining: int signature: str def derive_child(parent: Warrant, request_id: str, key: str) -> Warrant: # Deterministic: same (parent, request_id) always yields the same child nonce, # so a retried handoff returns the cached child instead of a sibling. child_nonce = hashlib.sha256( f"{parent.root_nonce}:{parent.parent_nonce}:{request_id}".encode() ).hexdigest() if parent.depth_remaining <= 0: raise DelegationBudgetViolation( f"cannot derive from {parent.parent_nonce}: depth exhausted" ) sig = hashlib.sha256(f"{child_nonce}:{key}".encode()).hexdigest() return Warrant( root_nonce=parent.root_nonce, parent_nonce=child_nonce, request_id=request_id, depth_remaining=parent.depth_remaining - 1, signature=sig, ) def re_delegate( parent: Warrant, request_id: str, spent_nonces: set[str], minted: dict[tuple[str, str], Warrant], key: str, ) -> Warrant: cache_key = (parent.parent_nonce, request_id) if cache_key in minted: # Idempotent replay: return the prior child, do not mint a sibling. return minted[cache_key] if parent.parent_nonce in spent_nonces: # Spent nonce + unseen request id: cannot distinguish retry-loss from forgery. raise DelegationBudgetViolation( f"nonce {parent.parent_nonce} already spent; novel request {request_id} " "cannot be proven to be a retry" ) child = derive_child(parent, request_id, key) spent_nonces.add(parent.parent_nonce) minted[cache_key] = child return child ```