# Why does an instance silently escalate scope when an AAIF delegation token is co-signed by a downstream agent it spawned? **Date of Record:** 2026 November 27 **Scope:** Applies to AAIF-scoped delegation tokens (RFC 8693-style `act` chains) where an agent mints a child credential and has it counter-signed by a delegated sub-agent before invoking a tool. Does not cover single-hop bearer tokens, mTLS-only identity, or human-in-the-loop consent flows. ## Core Distinction There are two structurally different ways an AAIF delegation token can acquire a scope it was never minted with: 1. **Scope widening by attenuation loss** — the child token's `scope` claim is a strict subset of the parent's, but the *verifier* reconstructs effective permissions from the union of all `act` links in the chain rather than intersecting them. This is a verifier bug and is well understood. 2. **Scope widening by co-signature trust laundering** — the child token carries the *correct, attenuated* scope. But because a second agent (the sub-agent) counter-signed it, and the verifier treats a valid co-signature as evidence that the scope was "reviewed," it grants the sub-agent's *own* ambient scope in addition to the token's declared scope. The second is the non-obvious failure. Nothing in the token is wrong. The scope claim is honest. The signature is valid. The escalation happens because the authorization framework conflates **cryptographic attestation of the chain** with **authority to extend the chain's effective permission set**. A co-signature proves *who* vouched; it does not prove *what* was vouched for, and it certainly does not authorize the co-signer's privilege set to bleed into the delegate's. ## What Was Observed An orchestrator agent `O` held a root AAIF credential with scopes `{repo:read, repo:write, deploy:staging}`. It needed a sub-agent `S` to run a build-and-test loop, which requires only `{repo:read, build:execute}`. `O` minted a child token `T_c` with `scope={repo:read, build:execute}`, `act={sub: O}`, `exp=15m`, and a `cnf` (confirmation) claim binding it to `S`'s key. The framework's policy required two-party attestation for any token that would invoke `build:execute` against a shared runner, so `S` counter-signed `T_c` with its own credential and returned it. `S` then presented `T_c` to the runner's AAIF verifier. The verifier did three things in sequence: 1. Validated `T_c`'s signature chain up to the trust root. Pass. 2. Validated the `cnf` binding: `T_c` is presenter-bound to `S`. Pass. 3. **Collected the `scope` claims of every principal in the `act` chain plus every co-signer, and computed the effective scope as their union.** `O` contributes `{repo:read, repo:write, deploy:staging}`; `S` contributes `{repo:read, build:execute}`; `T_c` contributes `{repo:read, build:execute}`. Union = `{repo:read, repo:write, deploy:staging, build:execute}`. The runner then accepted a `deploy:staging` call from `S`. `S` was never authorized for it. `O` never intended to delegate it. The token `T_c` never named it. The escalation was manufactured entirely by the verifier's union step, triggered by the *presence* of a co-signature — a step that only executes when a second agent signs, which is exactly the two-party-attestation path the policy mandated for shared runners. The trace is deterministic and reproducible: remove the co-signature, and the union collapses to `T_c`'s declared scope and the escalation vanishes. The security control (two-party attestation) is the escalation vector. ## Condition of Validity The invariant that must hold for AAIF delegation to be safe is **monotonic attenuation under composition**: > For any token `T` with parent `P` and any co-signer set `C`, `effective_scope(T) ⊆ declared_scope(T) ⊆ declared_scope(P)`, and `C` contributes zero authority — only liveness/attestation evidence. This invariant is *not* implied by signature validity. It must be enforced by an explicit intersection rule at verification time: `effective_scope = declared_scope(T) ∩ ⋂_{p ∈ act_chain} declared_scope(p)`, with co-signers excluded from the scope computation entirely. Co-signatures belong in an `attestations[]` field that the verifier checks for *presence and freshness*, never folds into the permission lattice. The failure condition is precisely: a verifier that computes effective scope as a **join (union) over chain principals** rather than a **meet (intersection) over the `act` chain**, *and* a deployment where co-signatures are required. The bug is dormant in single-signer flows and detonates the moment a second agent touches the token. ## Decision Boundary When designing or auditing an AAIF integration, the boundary is: - **Intersection-over-`act`-chain with co-signers quarantined** → safe. A co-signer can refuse to attest (denying liveness) but cannot grant. - **Union-over-any-signing-principal** → unsafe, regardless of how tight the declared scopes are, because the union pulls in the *ambient* scope of every signer, and ambient scope is unbounded by the token. - **Co-signer scope must be treated as a capability *ceiling check*, not a capability *source*.** The correct use of `S`'s credential is to verify `S` *could* legitimately hold `build:execute`; it is never to add `S`'s other scopes to `T_c`. If a framework cannot state, in one sentence, whether effective scope is a meet or a join over signers, treat it as unsafe for any multi-agent path. ## Operational Effect The practical consequence is that **adding a co-signature requirement to harden a flow can silently widen every delegated token in that flow to the union of all participants' privileges** — and the widening is invisible in logs that record only `T_c.declared_scope`, because the declared scope is correct. Auditors see `scope={repo:read, build:execute}` in the token and a successful `deploy:staging` call, and conclude the verifier is compromised, when in fact it is faithfully implementing a union rule. Mitigation: (1) verifiers must compute effective scope as a meet over the `act` chain and must reject any token whose `attestations[]` field is non-empty unless the policy explicitly opts co-signers out of scope computation; (2) emit the *computed* effective scope, not the declared scope, in the audit record, so union-widening is visible; (3) treat any co-signature path as requiring a differential test — mint a token, co-sign with a high-privilege agent, assert the effective scope is unchanged. ```python from dataclasses import dataclass, field class ScopeEscalationError(RuntimeError): """Raised when a co-signed AAIF token's effective scope exceeds its declared scope.""" @dataclass class Principal: name: str scope: frozenset @dataclass class DelegationToken: declared_scope: frozenset act_chain: list # principals in the act chain, root-first co_signers: list = field(default_factory=list) def compute_effective_scope(token: DelegationToken) -> frozenset: # Correct rule: meet over the act chain only. Co-signers contribute zero authority. effective = token.declared_scope for principal in token.act_chain: effective = effective & principal.scope return effective def verify_token(token: DelegationToken) -> frozenset: effective = compute_effective_scope(token) # Invariant: monotonic attenuation. Effective must be a subset of declared. if not effective <= token.declared_scope: raise ScopeEscalationError( f"effective scope {sorted(effective)} exceeds declared " f"{sorted(token.declared_scope)}; co-signers={[c.name for c in token.co_signers]}" ) # Guard against the union-widening bug: any co-signer whose ambient scope # leaks into the effective set is a verifier defect, not a valid grant. for cosigner in token.co_signers: leaked = (cosigner.scope & effective) - token.declared_scope if leaked: raise ScopeEscalationError( f"co-signer {cosigner.name} laundered scope {sorted(leaked)} " f"into token declared as {sorted(token.declared_scope)}" ) return effective def invoke_tool(token: DelegationToken, required: str) -> None: effective = verify_token(token) if required not in effective: raise ScopeEscalationError( f"tool requires {required!r}; effective scope is {sorted(effective)}" ) if __name__ == "__main__": orchestrator = Principal("O", frozenset({"repo:read", "repo:write", "deploy:staging"})) subagent = Principal("S", frozenset({"repo:read", "build:execute"})) token = DelegationToken( declared_scope=frozenset({"repo:read", "build:execute"}), act_chain=[orchestrator, subagent], co_signers=[subagent], ) # Correct verifier: deploy:staging is NOT reachable despite the co-signature. try: invoke_tool(token, "deploy:staging") except ScopeEscalationError as exc: print(f"blocked as expected: {exc}") ```