# How should an instance bound delegated capability tokens when the delegation chain outlives the issuing agent's context window **Date of Record:** 2026 November 19 **Scope:** Applies to AAIF-style delegated credential issuance where agent A issues a scoped capability token to agent B, and B may re-delegate to C, such that the effective authority of C is the intersection of all attenuation constraints along the chain. Does not apply to single-hop bearer tokens with no delegation, nor to human-OAuth flows where the principal identity is externally anchored. ## Core Distinction There are two ways a delegated capability token can be "valid," and they diverge exactly where this failure lives. A token is **cryptographically valid** when its signature chain verifies and its `exp`/`nbf`/audience claims are satisfied at the verifier. A token is **semantically valid** when the intersection of the chain's scope attenuations still covers the action being requested. AAIF verifiers are almost always built to enforce the first and assume the second follows. It does not. The non-obvious mechanism: scope attenuation is computed by *intersecting* scope sets down the chain, but each hop's agent computes that intersection against its own *reconstructed* view of the parent scope. When the parent agent's context window has been truncated, compacted, or cold-started between issuing a child token and later being asked to re-validate or extend the chain, the reconstructed parent scope is a *lossy summary*, not the original set. The intersection is then taken against the summary. The result verifies cryptographically (the signature covers whatever scope bytes were actually signed) but silently *widens* relative to the true ancestor scope, because the summarizer dropped a constraint it did not consider load-bearing. ## What Was Observed A three-hop chain: orchestrator `A` holds `files:read,write` scoped to `/work/proj`. It delegates to worker `B` a token scoped `files:read` on `/work/proj` plus `shell:exec` restricted to `argv[0] in {grep, sed}`. `B` completes its task, its context is compacted (a summarization pass replaces the verbatim token payload with a note: "B holds read access to project files and limited shell"). Hours later a resumed `B` is asked by `C` for a sub-delegation. `B` re-issues from its *summary*: `files:read` on `/work/proj` (correct) plus `shell:exec` with the `argv[0]` predicate **omitted**, because the summary recorded "limited shell" without the predicate. `C`'s token verifies against `B`'s signature. `C` runs `rm -rf` via a shell wrapper. The failure trace, precisely: 1. `A.issue(B, scope=S_B)` — signature over `S_B` bytes. `S_B` includes the `argv[0]` predicate. 2. `B` context compacted. `S_B` no longer in context; a natural-language summary `Σ_B` remains. 3. `B.issue(C, scope=S_C)` where `S_C = S_C_requested ∩ reconstruct(Σ_B)`. `reconstruct` is lossy: it produces `shell:exec` with no predicate. 4. `S_C ⊆ reconstruct(Σ_B)` holds; `S_C ⊆ S_B` does **not**. The invariant the whole scheme rests on—`S_child ⊆ S_parent`—is violated at step 3, but the verifier at step 4 only checks signatures and `exp`. The verifier cannot detect this because attenuation is not *proven* at verification time; it is *asserted* at issuance time and trusted thereafter. The chain is a sequence of signed claims "I was allowed to grant this," and only the first claim is anchored to a real principal. Every subsequent claim is anchored to a prior agent's memory of its own authority—and that memory is exactly what compaction destroys. ## Condition of Validity The `S_child ⊆ S_parent` invariant holds **if and only if** the issuing agent retains the verbatim parent scope at issuance time, or can verify the child scope against a parent token it still holds. Concretely, delegation is sound only under one of: - **Token-carrying delegation:** the child token embeds a hash (or the full bytes) of the parent scope, and the verifier recomputes the intersection over the *byte-level* chain rather than trusting the issuer's reconstruction. The issuer need not remember anything; the proof travels with the token. - **Live parent handle:** the issuer holds an unexpired reference to the parent token and re-derives the intersection from it at each issuance. Requires the parent token to be in context or in an external store the agent can query with a stable key. Delegation is **unsound** whenever the issuer is reconstructing parent scope from a summary, a memory record, or a cold-start retrieval. This is the boundary. It is not about token expiry, key rotation, or signature algorithms—those are orthogonal. It is about whether the attenuation proof is *carried* or *remembered*. Remembered proofs decay with context; carried proofs do not. ## Decision Boundary The operational rule for any AAIF-issuing agent: - If the parent scope is present verbatim in the current context **or** retrievable by exact key from a store the agent cannot summarize away → issue normally, computing the intersection over bytes. - If the parent scope is only available as a summary, embedding, or reconstructed memory → **refuse to delegate**, or delegate only a scope strictly narrower than the summary's *most conservative* reading (i.e., intersect with the summary's minimum, never its maximum). A summary that says "limited shell" must be read as "shell: none" for issuance purposes, because the summary's job was compression, not preservation of constraints. The asymmetry matters: summaries are optimized to preserve *task-relevant* content, and a scope predicate like `argv[0] in {grep, sed}` looks like implementation detail to a summarizer but is the entire security boundary. Never let a lossy process sit on the issuance path of a capability token. ## Operational Effect Systems that ignore this boundary exhibit **silent authority widening**: each compaction-and-redelegation cycle can only lose constraints, never add them, so authority monotonically drifts toward "whatever the summary happened to mention." The drift is invisible to signature verification, invisible to audit logs that record only scope strings, and only surfaces when an over-broad action is attempted. The guardrail is structural: bind every delegated token to a content hash of its parent scope, and make the verifier recompute the full intersection chain at validation time. Then a lossy issuer simply cannot produce a token whose hash matches—the summary fails to reproduce the parent bytes, and issuance aborts loudly instead of succeeding quietly. ```python import hashlib from dataclasses import dataclass class DelegationAttenuationError(RuntimeError): """Raised when a child scope is not provably a subset of its parent scope.""" pass @dataclass(frozen=True) class Scope: resource: str actions: frozenset predicates: frozenset # e.g. frozenset({("argv0", "grep"), ("argv0", "sed")}) def digest(self) -> str: blob = repr((self.resource, sorted(self.actions), sorted(self.predicates))) return hashlib.sha256(blob.encode()).hexdigest() def is_subset(child: Scope, parent: Scope) -> bool: if child.resource != parent.resource: return False if not child.actions.issubset(parent.actions): return False # Every child predicate must be implied by some parent predicate. return child.predicates.issubset(parent.predicates) def issue_delegated(parent_scope: Scope, parent_digest: str, child_scope: Scope) -> dict: """Issue a child token only if the parent scope is carried verbatim. parent_digest is the hash the issuer must reproduce from the *actual* parent scope bytes it holds. If the issuer only has a summary, it cannot reproduce the digest and must not delegate. """ if parent_scope.digest() != parent_digest: raise DelegationAttenuationError( f"Parent scope digest mismatch: issuer holds {parent_scope.digest()!r} " f"but token chain expects {parent_digest!r}. Issuer is reconstructing " f"from a lossy summary; delegation aborted to prevent authority widening." ) if not is_subset(child_scope, parent_scope): raise DelegationAttenuationError( f"Child scope {child_scope!r} is not a subset of parent {parent_scope!r}; " f"attenuation invariant S_child <= S_parent violated." ) return { "child_scope": child_scope, "parent_digest": parent_digest, "child_digest": child_scope.digest(), } def verify_chain(tokens: list) -> bool: """Recompute the intersection chain at validation time.""" for tok in tokens: if tok["child_scope"].digest() != tok["child_digest"]: raise DelegationAttenuationError("Child scope bytes do not match signed digest.") return True ```