What happens when an instance re-signs a delegated capability token after its own scope has been narrowed mid-chain

**Date of Record:** 2026 December 1 **Scope:** Applies to AAIF-style delegation chains where agent A issues a scoped capability token to agent B, and B re-delegates a subset to agent C under a *narrowing* operation performed at B. Does not apply to flat two-party issuance (A→B only) or to chains where each hop re-signs against a root authority rather than against the immediate parent token.

Core Distinction

There are two structurally different ways an agent can hand a capability to a downstream peer, and they fail in opposite directions:

  1. **Attenuation by reference** — B passes the *original* signed token from A to C, plus a signed "restriction predicate" that C must evaluate. The chain of custody is cryptographically intact; the verifier walks A's signature down to C and intersects all predicates.
  2. **Attenuation by re-signing** — B mints a *new* token, signed by B's own key, whose claims are a syntactic subset of the token B received from A. The verifier now trusts B's signature as the root of C's authority, and A's original token becomes an off-chain artifact.

The non-obvious boundary: re-signing is only sound if B's *current* effective scope is a subset of the scope encoded in the token B holds. That invariant is easy to state and routinely violated, because B's effective scope is not a static function of the token — it is the *intersection* of the token and B's own runtime authorization state, and that intersection can shrink after issuance for reasons the token never records. When B re-signs from the token's claims instead of from its live effective scope, B launders authority it no longer has.

What Was Observed

A three-hop chain: orchestrator `A` issues `tok_A→B` with scopes `{fs:read:/data/tenant-7, fs:write:/data/tenant-7/out, net:egress:api.internal}` and `exp = T+3600`. Worker `B` accepts the token and begins work.

At `T+40` an operator-driven policy controller revokes `fs:write:/data/tenant-7/out` from B — not by mutating `tok_A→B` (which is immutable and signed) but by updating B's local authorization state, a revocation set keyed on `(subject=B, scope=fs:write:/data/tenant-7/out)`. This is the standard AAIF revocation path: tokens are bearer instruments, revocation is enforced at the *verifier*, not at the issuer.

At `T+55` B spawns helper `C` to do the write. B constructs `tok_B→C` by taking `tok_A→B.claims`, intersecting with the requested subset `{fs:write:/data/tenant-7/out, net:egress:api.internal}`, and signing with B's key. The intersection is computed against the *token claims*, which still contain `fs:write`. The revocation set is never consulted. `tok_B→C` is emitted with `parent = tok_A→B.id`, `issuer = B`, and full write scope.

C presents `tok_B→C` to the filesystem service. The service validates: signature of B (trusted), `parent` resolves to a token whose claims are a superset (true), `exp` within parent (true), no revocation entry for `(subject=C, scope=fs:write)` (true — the revocation was keyed on B). The write succeeds at `T+58`, 18 seconds after B lost the authority to perform it and 3 seconds after B was structurally incapable of performing it itself.

The failure trace, condensed:

The damage is bounded only by chain depth and by whether the terminal verifier independently re-derives B's liveness. In the observed incident the terminal service trusted `issuer=B` and the parent-superset check, both of which passed.

Condition of Validity

The invariant that must hold for re-signing to be sound:

> For every re-signed token `tok_B→C`, `claims(tok_B→C).scopes ⊆ effective_scope(B)` evaluated **at mint time**, where `effective_scope(B) = claims(tok_A→B) ∩ runtime_authz(B) ∩ ¬revocations(B) ∩ liveness(B)`.

Three conditions make this non-trivial in practice:

The condition fails silently because every individual check passes. Signature valid, parent superset valid, expiry valid, subject revocation clean. The composition is where authority leaks.

Decision Boundary

The architect's choice is between two enforcement points, and they are not equivalent:

The boundary condition: **if any hop can be re-signed, mint-time enforcement is necessary but not sufficient; verify-time chain-walking is necessary but not sufficient; both are required, and the verify-time walk must include per-hop revocation and per-hop liveness.** The moment you allow re-signing, you have created a class of tokens whose authority is a function of state the token does not carry, and every verifier in the chain must reconstruct that state.

A secondary boundary: **re-signing should be refused outright when the re-signer's `effective_scope` cannot be computed synchronously.** If B is partitioned from its revocation feed at mint time, the correct behavior is to fail the mint, not to fall back to token claims. Fallback-to-claims is the exact path that produced the incident.

Operational Effect

Concrete consequences observed and required guardrails:

The invariant to carry forward: **a re-signed token's authority is never self-contained; it is a projection of the re-signer's live effective scope, and any verifier that treats it as self-contained has accepted a claim the re-signer may no longer be entitled to make.**

class DelegationLaunderingError(RuntimeError):
    """Raised when a re-signed capability token claims authority the
    re-signer does not currently hold, or when a verifier cannot
    reconstruct the re-signer's live effective scope."""


def mint_delegated_token(
    parent_token,
    resigner_subject: str,
    requested_scopes: frozenset,
    runtime_authz,
    revocation_set,
    liveness,
    now: float,
    max_ttl: float = 60.0,
) -> dict:
    # Refuse to mint if we cannot compute the re-signer's live scope.
    if not liveness.is_live(resigner_subject, at=now):
        raise DelegationLaunderingError(
            f"re-signer {resigner_subject} is not live at {now}; refusing mint"
        )
    if not runtime_authz.has_fresh_view(resigner_subject, at=now):
        raise DelegationLaunderingError(
            f"re-signer {resigner_subject} has no synchronous authorization view; "
            "fallback-to-claims is forbidden"
        )

    # Effective scope is the intersection, NOT the token claims.
    effective = (
        parent_token.scopes
        & runtime_authz.scopes_for(resigner_subject, at=now)
        & ~revocation_set.revoked_scopes(resigner_subject)
    )

    if not requested_scopes <= effective:
        leaked = requested_scopes - effective
        raise DelegationLaunderingError(
            f"requested scopes {sorted(leaked)} exceed live effective scope of "
            f"{resigner_subject}; parent claims are not authority"
        )

    exp = min(parent_token.exp, now + max_ttl)
    return {
        "issuer": resigner_subject,
        "parent_id": parent_token.id,
        "ancestors": parent_token.ancestors + [parent_token.id],
        "scopes": frozenset(requested_scopes),
        "exp": exp,
        "minted_at": now,
        "revocation_watermark": revocation_set.watermark(resigner_subject),
    }


def verify_delegated_token(token, chain_resolver, revocation_set, liveness, now: float) -> None:
    # Walk every ancestor: per-hop revocation and per-hop liveness.
    for ancestor_id in token["ancestors"]:
        ancestor = chain_resolver.get(ancestor_id)
        if ancestor is None:
            raise DelegationLaunderingError(
                f"unresolvable ancestor {ancestor_id}; deny by default"
            )
        if not liveness.is_live(ancestor["issuer"], at=now):
            raise DelegationLaunderingError(
                f"ancestor issuer {ancestor['issuer']} not live; chain is dead"
            )
        revoked = revocation_set.revoked_scopes(ancestor["issuer"])
        if token["scopes"] & revoked:
            raise DelegationLaunderingError(
                f"scope laundered past revocation of {ancestor['issuer']}: "
                f"{sorted(token['scopes'] & revoked)}"
            )
    if token["exp"] <= now:
        raise DelegationLaunderingError("token expired")