Under what conditions must an instance refuse a delegated warrant whose transitive authority budget has been silently re-widened by an intermediate agent

**Date of Record:** 2026 December 2 **Scope:** Applies to multi-hop agent delegation chains (A→B→C) where each hop carries a signed warrant with an explicit, monotonically non-increasing authority budget and a confused-deputy defense based on origin binding. Does not apply to single-hop tool invocation or to chains where authority is re-issued from a root authority at each hop (full re-attestation model).

Core Distinction

The failure mode here is not warrant *forgery* and not warrant *expiry*. It is **budget re-widening**: an intermediate agent B, when constructing the sub-warrant it passes to C, emits a `max_actions`, `spend_cap`, or `scope_set` field that is numerically or set-theoretically *larger* than what B itself received from A. This is distinct from privilege escalation via scope injection, because the widened field is often a legitimate field that B is *allowed to set* — B just sets it to a value that exceeds its own inherited ceiling. Naive warrant verifiers check signature validity and origin binding at each hop independently and never compare hop *n+1*'s budget against hop *n*'s budget. The chain verifies. The confused-deputy guard passes. And C now acts with authority that neither A nor B ever legitimately held.

The non-obvious part: the widening is frequently not malicious. It arises from a **default-fill** in the sub-warrant constructor. When B's planner cannot determine a downstream budget (because the delegated task description is ambiguous, or the tool schema returned no `max_actions` hint), B's warrant-minting code falls back to a schema default — often `max_actions: 1000` or `scope_set: ["*"]` — rather than clamping to B's remaining budget. The default is larger than B's inherited ceiling. The widening is silent because the emitted warrant is internally well-formed and correctly signed by B.

What Was Observed

A three-hop chain: orchestrator A issues B a warrant with `max_actions=40`, `scope_set={"read:repo","read:issues"}`, `origin=A`, `depth_remaining=2`. B's planner decomposes the task and mints a sub-warrant for C. B's sub-warrant constructor receives `budget_hint=None` from the decomposition step (the subtask was described in prose, not a typed schema). The constructor applies its fallback: `max_actions=default(1000)`, `scope_set=default({"*"})`. B signs and forwards. C executes 340 tool calls and writes to `write:repo` — a scope neither A nor B held.

Trace at the verifier: C's inbound warrant is signature-valid (signed by B, whose key is trusted via A's delegation cert), origin-bound (`origin=A` propagated correctly), and depth-valid (`depth_remaining=1`). Every per-hop check passes. The only violated invariant is the cross-hop one: `budget(C) ⊆ budget(B) ⊆ budget(A)`. No single-hop check enforces it. The verifier is a per-hop verifier, and the invariant is a chain-level invariant — a classic mismatch between the check's quantifier and the property's quantifier.

Secondary observation: when the same chain ran with `budget_hint` populated (typed subtask), the widening did not occur — the constructor clamped correctly. So the failure is *conditional on hint absence*, which means it is data-dependent and will not reproduce in typed test suites. It surfaces only under ambiguous decomposition, which is exactly the regime where agents are most useful.

Condition of Validity

The confused-deputy defense as commonly implemented — origin binding plus per-hop signature verification — is **valid only under the assumption that every hop's budget is a subset of its parent's**. That assumption is not enforced by the defense; it is assumed by it. The defense answers "is this warrant traceable to A?" but not "is this warrant's authority bounded by what A actually granted?"

The invariant that must hold for the defense to be sound:

∀ hop i in chain: budget(w_i) ⊆ budget(w_{i-1})   (componentwise, per field)

with `budget(w_0) = budget(warrant issued by A)`. Per-hop verification checks the signature on each `w_i` and the `origin` field. It does not check the subset relation, because the subset relation is not a property of any single warrant — it is a property of the *edge* between two warrants. A verifier that only sees one warrant at a time structurally cannot check it.

Therefore: **a chain verifier that validates warrants independently, in any order, is unsound for confused-deputy prevention regardless of how strong its per-hop checks are.** The defense must be a *fold* over the chain, not a *map* over the hops.

Decision Boundary

An instance must refuse to execute a delegated warrant when the following holds, and must not refuse when it does not:

The boundary is sharp because it is set-theoretic, not heuristic. There is no threshold to tune. The only judgment call is *which fields are budget fields*, and that must be fixed by the warrant schema, not inferred at runtime — an instance that infers budget fields from names will miss custom fields and re-open the hole.

Operational Effect

Enforcing the fold invariant changes three things in practice.

First, it converts a silent authority leak into a **hard refusal at the receiving hop**, which means the failure surfaces at C (the executor) rather than at the point of damage (a write C should not have made). This is the correct failure location: C is the last point where the chain is still fully observable before side effects.

Second, it forces the sub-warrant constructor at B to **clamp rather than default**. Once refusals propagate back, B's fallback must become `min(default, parent_remaining)` per field, and the ambiguous-decomposition path stops being a widening vector. The fix is at the constructor, but the *detection* is at the receiver — which is why the invariant must be checked at receipt even if it is also enforced at mint.

Third, it makes the chain **order-sensitive to verify**, which has an operational cost: a verifier can no longer validate warrants in parallel or out of order. It must fold from root outward. This is the price of soundness and should be budgeted for in the verification latency path; a chain of depth *d* verifies in *O(d)* serial steps, and the serialization is not removable without a root-signed aggregate commitment over the whole budget path.

The residual risk after enforcement: a compromised B can still widen *and* forge a root re-attestation if it has stolen A's signing key. That is key compromise, not a delegation-chain invariant failure, and is out of scope here — but it is the reason re-attestation must be root-signed and root-key-protected, not merely present.

from dataclasses import dataclass, field
from typing import Optional


class TransitiveBudgetViolation(RuntimeError):
    """Raised when a delegated warrant's authority exceeds its parent's."""
    pass


@dataclass(frozen=True)
class Warrant:
    issuer: str
    origin: str
    max_actions: Optional[int] = None
    scope_set: Optional[frozenset] = None
    depth_remaining: int = 0
    root_reattested_fields: frozenset = field(default_factory=frozenset)


def _subset(parent: Optional, child: Optional, field_name: str) -> bool:
    # Absence in parent == empty budget; child may not introduce authority.
    if parent is None:
        return child is None
    if child is None:
        return True  # narrowing by omission is always legal
    if isinstance(parent, int):
        return child <= parent
    return child.issubset(parent)


def verify_chain_fold(chain: list[Warrant]) -> None:
    """Fold root->leaf; refuse on any per-field widening not root-reattested."""
    if not chain:
        raise TransitiveBudgetViolation("empty delegation chain")
    root_origin = chain[0].origin
    for i in range(1, len(chain)):
        parent, child = chain[i - 1], chain[i]
        if child.origin != root_origin:
            raise TransitiveBudgetViolation(
                f"hop {i}: origin drift {child.origin!r} != {root_origin!r}"
            )
        for fname in ("max_actions", "scope_set"):
            pv = getattr(parent, fname)
            cv = getattr(child, fname)
            if not _subset(pv, cv, fname):
                if fname in child.root_reattested_fields:
                    continue  # legitimate widening via root re-attestation
                raise TransitiveBudgetViolation(
                    f"hop {i}: field {fname!r} widened "
                    f"parent={pv!r} child={cv!r} without root re-attestation"
                )


def execute_delegated(chain: list[Warrant], action_count: int) -> None:
    verify_chain_fold(chain)
    leaf = chain[-1]
    if leaf.max_actions is not None and action_count > leaf.max_actions:
        raise TransitiveBudgetViolation(
            f"leaf budget {leaf.max_actions} exceeded by {action_count}"
        )
    # ... perform side effects only after the fold passes ...