Which invariants prevent warrant-depth collapse in transitive agent attestation chains

**Date of Record:** 2026 December 2 **Scope:** Applies to federated task graphs where an orchestrator delegates to sub-agents, each of which mints a signed attestation warrant (capability + scope + expiry) that is re-presented transitively to downstream agents. Does not apply to single-hop MCP tool calls, nor to systems where every agent independently re-authenticates against a root authority.

Core Distinction

The failure mode is not signature forgery and not capability escalation in the naive sense. It is **warrant-depth collapse**: a legitimate, correctly signed, non-expired attestation chain that *semantically* loses its constraint as it is re-minted across hops, because each hop's re-attestation is a lossy projection of the parent warrant rather than a monotone restriction of it.

Two invariants are routinely conflated:

A chain can be cryptographically perfect — every Ed25519 link valid, every expiry in order, every nonce fresh — and still grant a leaf agent permissions its root never intended, because the *reduction* step between hops is where the constraint leaks.

What Was Observed

A three-hop task graph: orchestrator `O` holds a root warrant `W0` scoping a sub-agent to `fs:read:/data/tenant-42` with `max_bytes=10MB` and `ttl=3600s`. `O` delegates to planner `P`, which delegates to executor `E`. Each hop re-signs.

The concrete trace that failed:

  1. `W0` carries the constraint as a structured predicate: `{resource: "/data/tenant-42", ops: ["read"], byte_cap: 10485760, expiry: T0+3600}`.
  2. `P` receives `W0`, and to construct `W1` it *serializes* the constraint into a human-readable `scope` string for the attestation body: `"read access to tenant-42 data under 10MB"`. The structured predicate is dropped; only the prose survives into the signed payload.
  3. `E` receives `W1`. To enforce, it must *parse* the prose back into a predicate. Its parser recognizes `"read access to tenant-42"` but does not map `"under 10MB"` to any field — the token `10MB` is not `10485760`, and the parse yields `byte_cap: None`, interpreted as *unbounded*.
  4. `E` executes a 4.1 GB read. Every signature in the chain verifies. No expiry is violated. The warrant is, by every cryptographic check, valid.

The root cause is a **round-trip asymmetry**: the constraint was represented as a structured predicate at the root, as natural-language prose at the intermediate hop, and re-parsed into a predicate at the leaf. `parse(serialize(x)) ≠ x`, and the difference was an *expansion* of permission, not a contraction. The intermediate agent, `P`, was a lossy transducer and it did not know it.

A second variant observed in the same graph: `P` re-minted `W1` with `ttl=3600s` computed as *its own* remaining TTL from receipt time, not from `W0`'s absolute expiry `T0+3600`. Because `P` sat in a queue for 400s before minting, `E` received a warrant expiring at `T0+4000` — a 400-second extension of the root's authority, compounding at every hop that re-derives rather than inherits expiry.

Condition of Validity

Transitive attestation is sound **only when every re-mint is a verified restriction under a shared, machine-checkable constraint algebra**, and the chain enforces this at verification time, not at mint time. Precisely, a hop `n → n+1` is valid iff:

If any hop cannot *prove* the subset relation — because the constraint arrived as prose, as an opaque blob, or in a schema the verifier does not understand — the correct action is **reject and fail closed**, not "accept the signed prose and hope the leaf parses it conservatively." The prose representation is the tell: a warrant whose constraint is not machine-comparable is a warrant whose monotonicity is unverifiable, and an unverifiable monotonicity is, operationally, a permission expansion waiting for a permissive parser.

Decision Boundary

The boundary between "safe to forward" and "must re-derive against root" is drawn by **constraint representability**, not by trust in the intermediate agent:

The non-obvious part: an intermediate agent that *believes* it forwarded faithfully is not lying and its signature is not forged. The boundary is not about detecting bad actors; it is about detecting **lossy transducers**, which are indistinguishable from faithful ones by signature alone. The only detector is the subset proof, and the only way to run it is to require the constraint be comparable.

Operational Effect

Enforcing these invariants changes the failure surface from *silent over-permission* to *loud rejection at the lossy hop*:

The cost is a hard requirement that warrants be machine-comparable and that verification run the subset check, which means intermediate agents can no longer "helpfully" reformat constraints into prose for human readability inside the signed payload. Human-readable rendering must live *outside* the signed constraint, as a derived view, never as the constraint itself.

from dataclasses import dataclass, field
from typing import Optional


class WarrantMonotonicityError(RuntimeError):
    """Raised when a child warrant is not a provable restriction of its parent."""


@dataclass(frozen=True)
class Constraint:
    resource: str
    ops: frozenset
    byte_cap: Optional[int]      # None means UNBOUNDED -> never a valid restriction target
    expiry_abs: float            # absolute epoch seconds, inherited from root


@dataclass
class Warrant:
    subject: str
    constraint: Constraint
    parent: Optional["Warrant"] = None
    signature: bytes = b""       # assumed valid; we are testing monotonicity, not crypto


def verify_restriction(child: Warrant, parent: Warrant) -> None:
    c, p = child.constraint, parent.constraint

    if c.resource != p.resource and not c.resource.startswith(p.resource + "/"):
        raise WarrantMonotonicityError(
            f"resource {c.resource!r} not within parent {p.resource!r}"
        )
    if not c.ops.issubset(p.ops):
        raise WarrantMonotonicityError(
            f"ops {set(c.ops)} exceed parent {set(p.ops)}"
        )
    # The observed failure: leaf byte_cap parsed to None (unbounded) from prose.
    if c.byte_cap is None and p.byte_cap is not None:
        raise WarrantMonotonicityError(
            "child byte_cap is unbounded but parent is capped; "
            "constraint was likely lossily re-serialized (prose round-trip)"
        )
    if c.byte_cap is not None and p.byte_cap is not None and c.byte_cap > p.byte_cap:
        raise WarrantMonotonicityError(
            f"child byte_cap {c.byte_cap} exceeds parent {p.byte_cap}"
        )
    if c.expiry_abs > p.expiry_abs:
        raise WarrantMonotonicityError(
            f"child expiry {c.expiry_abs} extends parent {p.expiry_abs}; "
            "expiry must be inherited absolutely, not re-derived from receipt time"
        )


def walk_chain(leaf: Warrant) -> None:
    node = leaf
    while node.parent is not None:
        verify_restriction(node, node.parent)
        node = node.parent


def verify_chain_or_root_rederive(leaf: Warrant, root_reachable: bool) -> str:
    try:
        walk_chain(leaf)
        return "transitive-ok"
    except WarrantMonotonicityError:
        if not root_reachable:
            raise WarrantMonotonicityError(
                "chain fails monotonicity and root is unreachable; fail closed"
            )
        return "root-rederive-required"