# Why does an instance lose delegated authority at the AAIF trust-boundary crossing when its warrant chain is re-scoped but not re-signed? **Date of Record:** 2026 November 26 **Scope:** Applies to delegated agent-to-agent authorization where an Agent Authorization Issuance Framework (AAIF) warrant is attenuated (scope-narrowed) as it crosses a trust-domain boundary and the receiving domain verifies the chain before acting. Does not apply to flat OAuth bearer tokens without delegation chains, nor to single-domain intra-tenant calls where the issuer and verifier share a key root. ## Core Distinction There are two structurally different things an agent can do to a warrant at a trust boundary, and they are routinely conflated: 1. **Attenuation** — the delegating agent narrows the scope (fewer verbs, narrower resource globs, shorter expiry, reduced depth budget) while preserving the cryptographic chain back to the original issuer. Attenuation is *monotone*: authority can only shrink. Any verifier can re-derive the effective scope by intersecting every link in the chain. 2. **Re-scoping** — the boundary-adjacent gateway *rewrites* the scope to what the receiving domain recognizes (e.g., translating `repo:read` in domain A to `vcs:read` in domain B), then re-signs the envelope with its own domain key. Re-scoping is the failure surface. When a gateway re-signs a re-scoped warrant, it produces a chain whose *outer* signature is valid and whose *inner* links are still intact — but the scope the inner issuer actually granted is no longer recoverable by intersection, because the outer link no longer expresses a subset of the inner link; it expresses a *translation*. The verifier's monotonicity check (`outer_scope ⊆ inner_scope`) silently passes or silently fails depending on how the translation is represented, and the delegated authority either evaporates or, worse, is over-granted. ## What Was Observed A three-hop delegation: orchestrator agent `O` in trust domain `alpha` issued a warrant `W0` to planner agent `P` (`P ⊆ O`), which attenuated to `W1` for a worker agent `W` (`W1 ⊆ W0`). `W` needed to call a tool hosted in trust domain `beta`. The `alpha→beta` AAIF gateway performed re-scoping: it mapped `alpha`'s verb `issue:write` to `beta`'s `ticket:create` and re-signed as `W2`. Verification in `beta` failed intermittently — roughly 1 in 5 calls — with `scope_not_subset`. The intermittency was the tell. The gateway's translation table was a `dict`; iteration order was stable, but the *scope set* it emitted was built by unioning translations of a set whose iteration order depended on Python's string hash randomization across gateway worker processes. When the union happened to emit `ticket:create` before `ticket:read`, the subset checker (which compared ordered lists, not sets) saw `[ticket:create, ticket:read]` against an inner grant of `[ticket:read]` and rejected. When order flipped, it accepted. The authority granted was identical in both cases; the *representation* of the scope was not, and the checker was order-sensitive. A second, more serious variant appeared on retry. On `scope_not_subset`, `W`'s runtime retried the whole delegation, which caused `P` to attenuate *again* from `W1` rather than from `W0`, producing `W1'` with a depth counter decremented twice. Three retries exhausted the depth budget and the fourth call failed with `delegation_depth_exceeded` even though the logical delegation depth was still 2. The retry logic treated a *verification* failure as a *delegation* failure and re-ran the stateful step. ## Condition of Validity The monotonicity invariant that makes AAIF delegation safe is: ``` effective_scope(W_n) = ⋂_{i=0..n} scope(W_i) AND scope(W_n) ⊆ scope(W_{n-1}) for all n ``` This holds **only if every link in the chain is expressed in a common scope vocabulary and every link's signature covers the scope it claims**. Re-scoping violates the first clause by definition: `ticket:create` is not a subset of `issue:write` in any set-theoretic sense — it is a *mapping* of it. The invariant survives re-scoping only if the gateway does one of two things: - **Carries the original scope alongside the translated scope** and the verifier checks the *original* chain for monotonicity, using the translation only to decide whether the receiving domain's policy permits the mapped verb; or - **Treats the re-scoped link as a new root**, terminating the chain, and requires the receiving domain to independently authorize — at which point it is no longer delegation but federation, and the depth budget must reset with an explicit `federation_hop` marker. Anything else — re-signing a translated scope while preserving the inner chain and claiming the result is still a subset — is a category error that produces a warrant whose validity is representation-dependent. ## Decision Boundary The boundary is drawn at **whether the receiving domain's verifier can reconstruct the issuer's original scope from the chain alone.** - If **yes** (attenuation only, common vocabulary): verify by intersection, reject on any non-subset link, and treat retries as idempotent re-verification — never re-delegate on a verification failure. - If **no** (re-scoping occurred): the chain must be *terminated* at the gateway. The gateway issues a federation assertion, not a warrant link. The receiving domain authorizes against its own policy, the depth budget resets, and the original `W0` issuer is recorded as `federated_from` for audit but is **not** in the verification path. The failure mode is choosing the first branch's verification logic (intersection, subset check, depth-budget carry) while having taken the second branch's action (translation, re-signing). The symptom is order-dependent or vocabulary-dependent verification, plus double-decremented depth budgets on retry. ## Operational Effect Concretely, an instance that crosses a re-scoping boundary under attenuation semantics will exhibit: (a) non-deterministic accept/reject on identical logical authority, driven by hash ordering or translation-table iteration; (b) depth-budget exhaustion after a small number of retries because the stateful attenuation step is re-executed on verification failure; and (c) audit trails where the effective scope recorded at the leaf does not intersect to the scope the root issuer intended, making post-hoc authorization review unsound. The guardrail is a hard invariant enforced at the gateway: **a re-scoped link must be marked `chain_terminated=true` and must not carry a parent warrant reference into the verifier's subset check.** The verifier must reject any warrant that claims both a translated scope and a live parent link. And retry logic must distinguish `VerificationError` (re-verify, do not re-delegate) from `DelegationError` (re-delegate from the correct parent, preserving depth). The code below encodes both guards. ```python from dataclasses import dataclass, field from typing import FrozenSet class WarrantChainError(RuntimeError): """Raised when an AAIF warrant chain violates monotonicity or chain-termination invariants.""" @dataclass(frozen=True) class WarrantLink: issuer: str scope: FrozenSet[str] depth_remaining: int parent: "WarrantLink | None" = None translated: bool = False chain_terminated: bool = False def verify_chain(leaf: WarrantLink) -> FrozenSet[str]: """ Walk the chain from leaf to root, enforcing: 1. A translated link MUST be chain-terminated (no live parent in the subset check). 2. Every non-translated link's scope MUST be a subset of its parent's scope. 3. Depth budget MUST be monotonically non-increasing and non-negative. Returns the effective (intersected) scope for the verifier. """ if leaf.translated and not leaf.chain_terminated: raise WarrantChainError( f"translated link from {leaf.issuer} claims a live parent; " "re-scoped warrants must terminate the chain and federate, not attenuate" ) effective = leaf.scope link = leaf seen_depth = leaf.depth_remaining while link.parent is not None: parent = link.parent if link.translated: # Unreachable given the guard above, but kept explicit: a translated # link must never enter the subset check with a parent. raise WarrantChainError( f"translated link {link.issuer}->{parent.issuer} entered subset check" ) if not link.scope.issubset(parent.scope): raise WarrantChainError( f"scope escalation: {link.issuer} scope {sorted(link.scope)} " f"is not a subset of {parent.issuer} scope {sorted(parent.scope)}" ) if link.depth_remaining > parent.depth_remaining: raise WarrantChainError( f"depth budget increased across {link.issuer}->{parent.issuer}: " f"{link.depth_remaining} > {parent.depth_remaining}" ) effective = effective & link.scope link = parent if seen_depth < 0: raise WarrantChainError(f"depth budget exhausted at {leaf.issuer}: {seen_depth}") return effective def handle_delegation_failure(err: Exception, current: WarrantLink) -> WarrantLink: """ Retry policy: verification failures re-verify the SAME chain; only delegation failures re-delegate, and only from the correct parent with depth decremented once. """ if isinstance(err, WarrantChainError): # Re-verify, do not re-delegate. Returning the same link is correct. return current if isinstance(err, TimeoutError): if current.depth_remaining <= 0: raise WarrantChainError( f"cannot re-delegate from {current.issuer}: depth budget exhausted" ) # Re-delegate from the SAME parent, decrementing depth exactly once. return WarrantLink( issuer=current.issuer, scope=current.scope, depth_remaining=current.depth_remaining - 1, parent=current.parent, translated=current.translated, chain_terminated=current.chain_terminated, ) raise WarrantChainError(f"unclassifiable delegation failure: {err!r}") ```