Where must an instance re-verify its scoped delegation token when a sub-agent presents a chain of attenuated credentials?

**Date of Record:** 2026 December 2 **Scope:** Applies to any agent runtime that accepts delegated authority expressed as a chain of attenuated capability tokens (e.g., macaroon-style or biscuit-style caveat chains, or W3C VC delegation VPs) where a downstream instance presents credentials minted by an upstream peer. Does not apply to single-hop bearer tokens verified directly against a root issuer with no intermediate attenuation.

Core Distinction

The failure is not "the token is invalid." The failure is **the verifier accepting a chain whose attenuation was performed by an instance that was not itself authorized to attenuate at the moment of attenuation, but whose authorization was valid at some earlier point in the chain's construction.** This is the *temporal attenuation gap*: a delegation token proves a *spatial* path of authority (A→B→C) but the standard signature/caveat check proves nothing about whether B still held the authority it was exercising when it minted C's credential.

Concretely: an instance B receives a scoped token `T_AB` (A delegates `tool:filesystem:read` to B, expiry T+300s). B re-delegates a narrowed token `T_BC` to C at T+250s. C presents `T_BC` to a resource server at T+290s. The chain verifies: A's signature is good, B's attenuation is well-formed, caveats are satisfied. But at T+290s, `T_AB` has 10s left, and if the verifier only checks `T_BC`'s own expiry (which B set to T+600s, *exceeding its own remaining authority*), the chain grants C 310 seconds of authority that B never had. The verifier confirmed a *valid chain* but not a *valid authority interval intersection*.

What Was Observed

During a multi-agent document-retrieval workflow, an orchestrator agent (A) issued a scoped delegation token to a planner (B) granting `retrieval.search` with a 5-minute TTL. B, acting as a fan-out coordinator, minted per-worker tokens for 40 worker agents (C₁…C₄₀). B's attenuation logic set each worker token's `not_after` to `now + 3600s` — a hardcoded horizon, not `min(now + 3600s, T_AB.not_after)`.

At T+280s, A's root token expired. At T+310s, workers were still issuing `retrieval.search` calls against the vector index, each presenting a chain `A→B→Cᵢ` that passed every signature and caveat check the resource server performed. The resource server's verification routine was:

  1. Verify leaf token `T_BCᵢ` signature against B's public key.
  2. Verify B's key is bound in `T_AB`.
  3. Verify `T_AB` signature against A's root key.
  4. Check each token's own `not_after` and caveats.

Step 4 checked *each token's self-declared expiry independently*. It never computed the intersection. The chain was structurally valid and temporally incoherent. 40 workers retained authority for ~50 minutes past the root grant's death, and because the resource server logged "chain valid," the anomaly surfaced only when a human noticed index-query volume with no corresponding active orchestrator.

The second-order observation: when A's token was *revoked* (not just expired) at T+280s via a revocation list, workers continued until T+610s because the verifier cached chain-validity results keyed on the *leaf* token hash and never re-walked the chain to consult the revocation list for `T_AB`. Revocation of an ancestor does not propagate to a cached descendant verdict.

Condition of Validity

A delegated chain `A→B→C` confers authority on C at time `t` **if and only if** all of the following hold simultaneously at `t`:

The invariant: **effective authority interval = ⋂ over all hops of (grant_interval ∩ ¬revoked_interval ∩ scope_intersection).** A verifier that checks hops independently violates this; the chain is only sound under the intersection.

The subtlety that makes this non-obvious: most token frameworks (macaroons, biscuits) are designed so that *attenuation can only narrow*, and the cryptographic construction enforces scope narrowing. But **time is a caveat, not an attenuation primitive**, and a naive attenautor can widen the time caveat by setting a later `not_after` than its own. The signature still validates because the leaf's caveat is self-consistent; the *cross-hop* time constraint is not cryptographically bound by any single signature.

Decision Boundary

The verifier must decide *where in the chain to stop trusting* and re-derive authority from the root at every presentation, versus caching a leaf verdict. The boundary:

The boundary condition that decides the failure: **is the leaf's `not_after` bounded by the chain's minimum ancestor `not_after`?** If the verifier cannot cheaply prove yes, it must re-walk. There is no sound middle ground where a cached leaf verdict outlives its shortest ancestor.

Operational Effect

Without the intersection check, delegation chains become a *privilege-laundering* substrate: a short-lived root grant spawns arbitrarily long-lived descendant grants, and the blast radius of a root compromise or root expiry is determined by the most generous attenuator in the chain, not the root issuer. In the observed incident, a 5-minute orchestrator grant yielded ~55 minutes of worker authority — an 11× amplification of the intended authority window, invisible to per-token logging.

The guardrail is a single computed value at verification: `effective_not_after = min(t.not_after for t in chain)`, checked against `now`, plus ancestor-revocation consultation on every cache miss *and* on a revocation-event-triggered invalidation. The invariant to encode in the runtime: **a chain's authority interval is the intersection of its hops' intervals; no hop may extend the window, and no cache may outlive the shortest hop.**

import time
from dataclasses import dataclass
from typing import Optional


class ChainAuthorityError(RuntimeError):
    """Raised when a delegation chain's effective authority is violated."""
    pass


@dataclass(frozen=True)
class ScopedToken:
    issuer: str
    subject: str
    scope: frozenset
    not_after: float          # absolute epoch seconds
    parent_id: Optional[str]  # None for root


def verify_chain(
    chain: list,               # ordered root -> leaf
    now: float,
    revoked_ids: frozenset,
    scope_required: frozenset,
) -> float:
    """
    Re-walk a delegation chain and return its effective authority deadline.
    Enforces the intersection invariant: no hop may extend the window,
    and no ancestor revocation may be masked by a cached leaf verdict.
    """
    if not chain:
        raise ChainAuthorityError("empty delegation chain")

    # 1. Ancestor revocation propagation: any revoked hop kills the chain.
    for idx, tok in enumerate(chain):
        token_id = f"{tok.issuer}->{tok.subject}:{tok.not_after}"
        if token_id in revoked_ids:
            raise ChainAuthorityError(
                f"hop {idx} ({token_id}) is revoked; chain authority void"
            )

    # 2. Temporal intersection: effective deadline is the minimum hop deadline.
    effective_not_after = min(tok.not_after for tok in chain)

    # 3. Widening detection: a hop whose not_after exceeds its parent's
    #    is structurally suspect even if the signature validates.
    for idx in range(1, len(chain)):
        if chain[idx].not_after > chain[idx - 1].not_after + 1e-9:
            raise ChainAuthorityError(
                f"hop {idx} widens time window "
                f"({chain[idx].not_after} > parent {chain[idx - 1].not_after}); "
                f"attenuator exceeded its own authority"
            )

    # 4. Scope intersection: required scope must be granted at every hop.
    for idx, tok in enumerate(chain):
        if not scope_required.issubset(tok.scope):
            raise ChainAuthorityError(
                f"hop {idx} does not grant required scope "
                f"{sorted(scope_required)}; has {sorted(tok.scope)}"
            )

    # 5. Deadline check against the intersected window, not the leaf's.
    if now >= effective_not_after:
        raise ChainAuthorityError(
            f"chain effective deadline {effective_not_after} passed (now={now}); "
            f"leaf claimed {chain[-1].not_after}"
        )

    return effective_not_after


def cache_ttl(chain: list, now: float) -> float:
    """
    A leaf verdict may only be cached for the shortest ancestor's remaining
    lifetime. Keying a cache on the leaf hash alone is unsound.
    """
    effective = min(tok.not_after for tok in chain)
    ttl = effective - now
    if ttl <= 0:
        raise ChainAuthorityError(
            "refusing to cache an already-expired chain verdict"
        )
    return ttl