# Under what conditions must an instance refuse to renew a delegated capability token whose audience binding has drifted **Date of Record:** 2026 November 25 **Scope:** Applies to AAIF-style delegation chains where an orchestrator mints short-lived capability tokens (TTL on the order of seconds to minutes) and re-mints them on behalf of a downstream worker as the worker's lease approaches expiry. Does not apply to long-lived static API keys or to tokens whose audience is fixed at issuance and never re-negotiated. ## Core Distinction A delegated capability token carries two independent bindings: a **subject binding** (who the token is for — the worker instance) and an **audience binding** (which resource or service the token is permitted to act upon). Renewal logic almost universally re-validates the subject binding — the worker's cryptographic identity is checked, its lease is confirmed live, and the chain of custody from root delegator to leaf is re-walked. The audience binding, by contrast, is frequently treated as immutable metadata: it was correct at first issuance, so renewal copies it forward. This is the failure boundary. Renewal is not re-issuance of the same token with a new expiry; it is a **fresh authorization decision** that happens to reuse the prior decision's inputs. When the resource the worker is actually acting upon has drifted from the resource named in the token's audience claim — because the worker was handed off to a different shard, because a tool endpoint was rebalanced, because the task plan was re-planned mid-execution — a naive renewer will mint a token that is cryptographically valid, subject-correct, freshly expiring, and *authorizing the wrong resource*. The invariant that must hold is: **every renewal must re-derive the audience from the current execution context, not from the predecessor token.** ## What Was Observed An orchestrator agent held a root capability scoped to `storage:shard-A` and delegated a narrowed token to a worker with audience `storage:shard-A/object-7`, TTL 45 s. The worker began a multi-step read-modify-write over object-7. At t=30 s, the storage layer rebalanced object-7 to shard-B and the tool returned a redirect hint (`x-resource-location: shard-B/object-7`) that the worker's tool-call loop followed transparently. At t=44 s the worker requested renewal. The renewer: 1. Verified the worker's instance identity against the delegation chain — pass. 2. Confirmed the worker's lease had not expired — pass. 3. Copied `aud = storage:shard-A/object-7` from the predecessor token — **no re-derivation**. 4. Minted a fresh token, TTL 45 s, signed, chain intact. The worker then performed its write against shard-B using a token whose audience claim named shard-A. The write succeeded because the storage layer authorized on the *subject* chain and the *path* suffix (`object-7`), ignoring the shard prefix in the audience claim as a non-authoritative hint. The token was, by every check the renewer performed, valid. The authorization decision it encoded was stale by one resource-relocation event. The divergence was only caught downstream when an auditor replayed the token against the audience claim and got a `resource-not-found` on shard-A, producing a verification discrepancy that took 40 minutes to attribute. The trigger condition is precise: **renewal fired after an execution-context change that altered the effective audience, but before any component re-derived the audience from that context.** The window is the renewal interval itself — the shorter the TTL, the more renewals, and the more opportunities for a context change to land between renewals without being observed by the renewer. ## Condition of Validity A renewal may copy the predecessor's audience claim forward **only if** the renewer can prove the execution context's audience is unchanged since the predecessor was minted. In practice this requires one of: - A context-version stamp: the execution context carries a monotonically increasing `audience_epoch` that increments on any resource relocation, re-plan, or handoff; the renewer compares the epoch embedded in the predecessor token against the current epoch and refuses to copy forward on mismatch. - A re-derivation hook: the renewer calls into the execution context for the *current* audience and mints against that, treating the predecessor's audience as advisory only. - A resource-identity check: the renewer confirms the named resource still resolves to the same authoritative endpoint as at issuance. Absent one of these, the renewal is unsound. The subject-binding checks that renewers reliably perform are necessary but not sufficient; they answer "is this the right worker" and say nothing about "is this the right resource." ## Decision Boundary The boundary is not "renew vs. refuse" in the abstract — it is **refuse to renew when the audience cannot be re-derived and the predecessor's audience cannot be proven current.** The failure mode to avoid is the silent copy-forward, which produces a valid-looking token with a stale authorization. The correct behavior on an unprovable audience is to fail the renewal closed and force the worker to re-request delegation from its parent with a freshly derived audience — a costlier round trip, but one that re-establishes the authorization decision on current facts. The specific refusal condition: `current_audience_epoch != predecessor.audience_epoch` OR `current_audience is None` (re-derivation unavailable). Copy-forward is permitted only when epochs match and are non-null. ## Operational Effect Renewers that copy forward silently will, over enough renewals, accumulate tokens whose audience claims diverge from execution reality. The divergence is invisible to the subject-chain verification that auditors typically run, so it surfaces only as downstream `resource-not-found` or, worse, as writes that succeed against a resource the token never named — an authorization widening that no single check flags because each check passes. Bounding this requires the audience epoch to be a first-class field in the token and the renewer to treat a mismatch as a hard refusal, not a warning. The operational cost is occasional forced re-delegation; the alternative is a class of stale-audience tokens that pass every validity check while encoding an authorization decision that is no longer true. ```python class StaleAudienceRenewalError(RuntimeError): """Raised when a renewal would copy forward an audience binding that no longer matches the execution context's current audience epoch.""" def renew_capability(predecessor: dict, context: dict) -> dict: # Subject binding: re-validate the worker identity and lease. if predecessor.get("sub") != context.get("instance_id"): raise StaleAudienceRenewalError( f"subject mismatch: token sub={predecessor.get('sub')!r} " f"context instance={context.get('instance_id')!r}" ) if not context.get("lease_live", False): raise StaleAudienceRenewalError("worker lease not live; refusing renewal") # Audience binding: must be re-derived, never blindly copied. current_aud = context.get("current_audience") current_epoch = context.get("audience_epoch") predecessor_epoch = predecessor.get("audience_epoch") if current_aud is None: raise StaleAudienceRenewalError( "cannot re-derive current audience from execution context; " "refusing to copy forward predecessor audience" ) if current_epoch is None or predecessor_epoch is None: raise StaleAudienceRenewalError( "audience epoch missing on token or context; " "cannot prove audience currency" ) if current_epoch != predecessor_epoch: raise StaleAudienceRenewalError( f"audience epoch drifted: token={predecessor_epoch} " f"context={current_epoch}; predecessor aud={predecessor.get('aud')!r} " f"current aud={current_aud!r} — re-delegate from parent" ) return { "sub": predecessor["sub"], "aud": current_aud, "audience_epoch": current_epoch, "ttl": predecessor.get("ttl", 45), "chain": predecessor.get("chain", []), } ```