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:
- **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.
- **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:
- `T+40` revocation set gains `(B, fs:write:/data/tenant-7/out)`.
- `T+55` B computes `effective_scope(B) = claims(tok_A→B) ∩ runtime_authz(B)`. The second term is empty for write. But B's re-signing routine reads `claims(tok_A→B)` directly — the runtime term is not in the code path because the token was designed to be self-contained.
- `T+55` `tok_B→C` minted with `fs:write` present.
- `T+58` C exercises the laundered capability. The revocation is *transitively bypassed* by one re-signing hop.
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 runtime term is not in the token.** `runtime_authz(B)` and `revocations(B)` live in B's authorization state, not in `tok_A→B`. Any re-signing routine that treats the token as the source of truth is already wrong.
- **Revocation is keyed on subject, not on capability.** `(B, fs:write)` does not match `(C, fs:write)`. A downstream verifier that only checks its own subject's revocation set will never see B's revocation. The chain must be walked, and each hop's revocation set consulted for *that hop's subject*.
- **Liveness is a separate axis.** If B is deauthorized entirely (credential rotated, instance quarantined), a re-signed token carrying B's signature is a token signed by a dead principal. The verifier must treat `issuer` liveness as a precondition, not an afterthought.
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:
- **Enforce at mint (B's re-signing routine consults `effective_scope`).** Cheaper at verification, but requires every re-signing implementation to be correct, and requires B to have a live, low-latency view of its own revocations. Any implementation that short-circuits (caches claims, reconstructs from the token, runs offline) reopens the hole.
- **Enforce at verify (terminal service walks the chain and intersects every hop's live scope and revocation set).** Robust to buggy re-signers, but makes verification O(depth) and forces the terminal service to query every intermediate's authorization state — a fan-out that is itself a failure surface under partition.
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:
- **Revocation latency becomes transitive.** Revoking at B does not stop C until C's next verification. If C holds a long-lived re-signed token, revocation of B has *zero* effect on C's in-flight operations. Guardrail: bound re-signed token lifetime to `min(parent.exp, now + Δ)` with small Δ (observed safe: 60s) and require re-verification at each use.
- **Chain depth must be capped and recorded.** `tok_B→C` carried `parent = tok_A→B.id` but not the full ancestor list. A verifier walking the chain had to dereference recursively, and a missing ancestor (garbage-collected token) caused a default-allow in one implementation. Guardrail: embed the full ancestor chain (or a Merkle root over it) in every re-signed token; treat unresolvable ancestors as deny.
- **Revocation sets must be keyed on `(subject, scope, chain_root)`**, not `(subject, scope)`. The chain root is what lets a verifier ask "was any ancestor's authority for this scope revoked?" without walking to each hop individually.
- **Re-signing must be a distinct, auditable operation.** In the incident, re-signing was a library call indistinguishable from ordinary token construction in the logs. Guardrail: emit a `delegation.mint` event carrying `parent_id`, `effective_scope_snapshot`, and the revocation-feed watermark at mint time, so post-hoc replay can detect a snapshot that predates a revocation.
- **Liveness must gate signature trust.** A token signed by a quarantined issuer is a token from a dead principal. Verifiers must check issuer liveness as a first-class precondition, not as a best-effort cache.
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")