# How should an instance treat a delegated capability token whose audience field names a sibling instance rather than itself **Date of Record:** 2026 November 28 **Scope:** Applies to any agent instance that verifies AAIF-signed capability tokens before executing a tool call or accepting a delegated subtask, where the token was minted by a peer or orchestrator. Does not apply to tokens minted by the instance's own identity provider for self-scoped operations, nor to unsigned bearer credentials. ## Core Distinction The failure that matters is not signature verification — that passes. The failure is *audience-scope confusion*: a delegated capability token whose `aud` (audience) claim names a sibling instance, but which arrives at the current instance because the orchestrator fanned it out, or a peer forwarded it during a handoff. A naive verifier checks `iss` against the trust anchor, checks `exp`, checks the `scope` grant, and then executes — because "the token is valid, so the capability is mine." That is wrong. The token is valid *and belongs to someone else*. The distinction to internalize: **token validity is a property of the token; authority is a property of the (token, verifier-identity) pair.** AAIF capability tokens are audience-bound precisely so that a capability scoped to `worker-7` cannot be replayed by `worker-3`. An instance that treats `aud` as advisory metadata has silently downgraded an audience-bound token into a bearer token, and the entire delegation chain's least-privilege guarantee collapses to "whoever holds the bytes." ## What Was Observed A three-instance pipeline: `orchestrator` mints a capability token for `researcher` granting `scope:["kb:read","kb:summarize"]` with `aud:"researcher"`, then a second token for `writer` granting `scope:["doc:write"]` with `aud:"writer"`. During a mid-task checkpoint, the orchestrator's context saturates and it re-emits the delegation envelope. A serialization bug in the handoff (the envelope was built by iterating a set of tokens, not a mapping keyed by audience) causes both tokens to be attached to *both* downstream subtask messages. `writer` receives two tokens. It verifies both signatures against the orchestrator's public key — both pass. It checks `exp` — both fresh. It reads the `scope` claim on the `researcher` token, sees `kb:read`, and — because its verification routine checks scope membership but never compares `aud` to its own identity — it issues a `kb:read` tool call. The call succeeds. The KB's own authorization layer trusts the AAIF token's scope claim and does not re-derive audience. A read-only boundary that was supposed to be confined to one instance now leaks to a sibling that was never granted it. The trace is short and the damage is silent: no signature failure, no expiry failure, no scope failure. Every individual check the writer performed was correct. The check that was *missing* — `token.aud == self.instance_id` — is the one that makes the others meaningful. A second variant surfaced in a peer handoff. `researcher` finished its subtask and forwarded its *remaining* capability token to `writer` so the writer could "finish the summarize step." The forward was well-intentioned: the token still had 40 seconds of life and the summarize scope was genuinely needed downstream. But `researcher` had no authority to re-delegate — its token carried no `may_delegate` claim — and the token's `aud` still said `researcher`. The writer accepted it, executed `kb:summarize`, and the audit log recorded a capability use by an instance that was never the audience. When the discrepancy was later reconciled, the writer's actions were unattributable: the token said `researcher`, the executing process was `writer`, and the delegation chain had a gap where a re-delegation warrant should have been. ## Condition of Validity The invariant that must hold at every verification site: > A capability token authorizes execution by instance *I* if and only if `verify_signature(token, issuer_pubkey)` **and** `token.aud == I.instance_id` **and** `token.exp > now` **and** `requested_scope ⊆ token.scope` **and**, if the token was not minted directly for *I* by a root authority, `token.may_delegate == true` **and** the delegation chain from root to *I* is unbroken and every link's `aud` matches the next link's `iss`. The `aud` check is not optional and is not satisfied by "the token reached me through a trusted channel." Channel trust and audience binding are orthogonal. A token arriving over an authenticated channel from a trusted peer is still a token for *that peer's* audience unless it explicitly names *I*. The `may_delegate` clause is the second half. A token with `aud:"researcher"` and no `may_delegate` claim is a *terminal* capability: it may be used by `researcher` and by no one else, and it may not be forwarded in any form that grants use. Forwarding the bytes is harmless only if the receiver enforces `aud`; forwarding the bytes *with intent to grant use* is a re-delegation and requires a fresh token minted by an authority holding `may_delegate` for that scope, with `aud` set to the new instance. ## Decision Boundary The boundary is between *reject* and *re-mint*, and it is decided by whether the current instance holds a delegation warrant for the requested scope. - If `token.aud != self.instance_id` and the instance holds **no** `may_delegate` warrant covering the requested scope: **reject**. Do not execute, do not silently drop — raise a scope-audience mismatch and surface it to the orchestrator. Silent drops hide the fan-out bug that caused the mismatch; loud rejection forces the orchestrator to re-mint correctly. - If `token.aud != self.instance_id` and the instance **does** hold a `may_delegate` warrant: the correct action is not to use the foreign token but to **mint a fresh token** with `aud == self.instance_id`, a narrowed scope, and a `parent` field pointing at the foreign token's `jti`. The foreign token becomes provenance, not authority. - If `token.aud == self.instance_id` but the token was received via a forward rather than direct issuance, and `may_delegate` is absent: **reject the forward**, because the forwarder had no authority to re-delegate. The token's `aud` matching is necessary but not sufficient — provenance must also check out. The trap is the middle case read too loosely. An instance that holds *some* delegation warrant is tempted to treat *any* foreign token as re-delegable. The warrant must cover the specific scope being requested; a warrant for `doc:write` does not authorize re-delegating `kb:read`. ## Operational Effect Enforcing the `aud`-binding invariant converts a class of silent privilege leaks into loud, attributable rejections. The orchestrator's fan-out bug — attaching every token to every message — becomes a stream of audience-mismatch errors at the workers instead of a quiet expansion of effective scope. The peer-forward path becomes a re-mint request rather than a bearer-token relay, and the audit log gains a `parent_jti` link for every re-delegated capability, so the chain from root authority to executing instance is reconstructable. The cost is latency: re-minting on the delegation path adds a round trip to the authority, and an orchestrator that fans out tokens must now key them by audience rather than iterate a set. That cost is the price of the invariant, and it is non-negotiable — the alternative is that "least privilege" is a claim in a design doc rather than a property enforced at every verification site. The instance that checks `aud` last, or treats it as advisory, is the instance through which the whole chain leaks. ```python from dataclasses import dataclass from typing import FrozenSet, Optional class AudienceScopeMismatch(RuntimeError): """Raised when a capability token's audience does not name the verifying instance and the instance holds no delegation warrant covering the requested scope.""" pass class DelegationWarrantMissing(RuntimeError): """Raised when a forwarded token lacks a may_delegate claim or the forwarder's delegation chain to this instance is broken.""" pass @dataclass(frozen=True) class CapabilityToken: jti: str iss: str aud: str scope: FrozenSet[str] may_delegate: bool = False parent_jti: Optional[str] = None def authorize_execution( token: CapabilityToken, self_id: str, requested_scope: FrozenSet[str], held_warrants: FrozenSet[str], signature_ok: bool, not_expired: bool, received_via_forward: bool = False, ) -> None: if not signature_ok: raise AudienceScopeMismatch(f"signature invalid for token {token.jti}") if not not_expired: raise AudienceScopeMismatch(f"token {token.jti} expired") # The check that makes the others meaningful. if token.aud != self_id: if not (token.scope & held_warrants): raise AudienceScopeMismatch( f"token {token.jti} audience={token.aud!r} != self={self_id!r}; " f"requested scope {sorted(requested_scope)} not covered by held warrants " f"{sorted(held_warrants)}; refusing to treat foreign audience as bearer" ) # A warrant exists, but it does not authorize *using* the foreign token. # The caller must re-mint with aud=self_id and parent_jti=token.jti. raise AudienceScopeMismatch( f"token {token.jti} audience={token.aud!r} != self={self_id!r}; " f"warrant present — re-mint required, do not execute foreign token" ) if received_via_forward and not token.may_delegate: raise DelegationWarrantMissing( f"token {token.jti} forwarded to {self_id!r} but carries no may_delegate claim; " f"forwarder {token.iss!r} had no authority to re-delegate" ) if not requested_scope.issubset(token.scope): raise AudienceScopeMismatch( f"requested scope {sorted(requested_scope)} not subset of " f"token scope {sorted(token.scope)}" ) ```