# Under what conditions must an instance reject a delegated AAIF credential whose scope is a strict subset of its own authority but whose issuer chain terminates in an untrusted root **Date of Record:** 2026 November 24 **Scope:** Applies to any agent instance validating a delegated Agent Identity and Authorization Interoperability Framework (AAIF) credential before exercising the delegated capability, where the credential carries a scope claim, an issuer chain, and a warrant binding. Does not cover first-party credentials minted by the instance's own trust anchor, nor symmetric-key local delegation. ## Core Distinction The failure mode is not "untrusted issuer." It is a **scope-soundness / chain-soundness dissociation**: the delegated scope is provably a subset of the delegating agent's authority (scope intersection succeeds), yet the *path* by which that authority was derived terminates in a root the validating instance does not trust. Naive validators check scope containment first, find it satisfied, and treat the chain as a mere transport detail — because in the common case the chain and the scope are minted together and cannot disagree. They can disagree. A credential can be *scope-valid* and *chain-invalid* simultaneously, and the two checks are computed over different fields that a hostile or buggy issuer can decouple. The invariant: **authorization is the intersection of scope containment AND chain termination at a trusted root. Neither implies the other.** A validator that short-circuits on scope containment grants authority that was never anchored. ## What Was Observed An auditor instance `A` held a first-party warrant `W_A = (subject=A, scope={read:repo, write:pr}, root=R_org)`. It delegated a narrowed credential to worker `B`: ``` C_B = { issuer: A, subject: B, scope: {read:repo}, # strict subset of W_A.scope parent_warrant: W_A, chain: [A -> R_org], } ``` `B` delegated further to `C` with `scope: {read:repo:path=/src}`, chain `[B -> A -> R_org]`. So far sound. The break came from a **re-issuance** step: an intermediary service `M` (a caching credential broker, itself holding a valid `A`-issued credential) re-minted `C_C` to refresh an expiring token. `M` preserved the scope claim verbatim but rebuilt the chain from its *own* view, emitting: ``` C_C' = { issuer: M, subject: C, scope: {read:repo:path=/src}, # unchanged, still a subset parent_warrant: W_A, # copied by reference, not re-verified chain: [M -> R_partner], # M's trust root, NOT R_org } ``` `C`'s validator computed `scope(C_C'.scope) ⊆ scope(W_A.scope)` → true. It then checked `chain` terminates at a root in its trust store. `R_partner` was present in the store (a federated partner root, legitimately trusted for *other* purposes). The chain check passed. `C` exercised `read:repo:path=/src` against the org repository. The credential was **never authorized to touch `R_org`-governed resources** — `M` had no authority to re-root a delegation it was only caching. The scope was honest; the chain was a lie of provenance. Two sub-mechanisms compounded: 1. **Reference-copied parent warrant.** `parent_warrant: W_A` was carried as an opaque blob; the validator verified `scope(C_C') ⊆ scope(W_A)` but did not verify that `W_A` was reachable *through the presented chain*. The scope proof and the chain proof were computed over disjoint object graphs. 2. **Trust-store breadth.** `R_partner` was trusted for partner-resource access, not for `R_org`-governed namespaces. A flat "is this root trusted" set conflates *trusted-for-what* with *trusted-at-all*. ## Condition of Validity A delegated credential is valid at instance `V` iff **all** of the following hold simultaneously; the conjunction is the guardrail: - **Scope containment:** `scope(C) ⊆ scope(parent_warrant)` computed structurally, not by string equality. - **Chain reachability of the parent:** `parent_warrant` MUST be the terminal credential of the presented `chain` minus its last hop — i.e., the chain, walked from `C.issuer` upward, must *arrive at* the issuer of `parent_warrant`, and `parent_warrant`'s own issuer must be the next chain element. A copied-by-reference parent that is not on the chain is invalid regardless of scope. - **Rooted termination in a namespace-scoped root:** the chain's final element must be a root trusted *for the resource namespace the scope names*. Trust is a relation `trusted(root, namespace)`, not a boolean set membership. - **Monotonic attenuation across the whole chain:** every hop's scope must be a subset of its predecessor's, and the *root's* effective authority must cover the leaf scope. Attenuation is checked along the chain, not just leaf-vs-parent. - **Warrant binding integrity:** the parent warrant's signature/hash must be recomputed over the *presented* parent object, not read from `C.parent_warrant` as trusted input. The dissociation observed violates conditions 2 and 3 while satisfying 1. That is the exact boundary: **scope-sound but chain-unsound**. ## Decision Boundary The validator must decide `grant` vs `reject` on the conjunction. The non-obvious rule is the **ordering of failure**: do not short-circuit on scope containment. A scope-sound credential with a broken chain must be rejected with a *chain* fault, not silently granted, and must not fall back to "trust the parent_warrant field." Concretely: - If `scope ⊆ parent.scope` but `parent ∉ chain` → reject `ChainDiscontinuity`, do **not** re-derive scope from the parent field. - If chain terminates at a root trusted for a *different* namespace than the scope targets → reject `RootNotTrustedForNamespace`. - If any hop's scope is not a subset of its predecessor → reject `AttenuationViolation`, even if the leaf is a subset of the root. - Only if all four hold → grant, and record the *root identity* and *namespace* in the audit trace so downstream re-delegation cannot silently re-root. The boundary is sharp because scope and chain are independently forgeable fields. Treating scope satisfaction as sufficient is the defect. ## Operational Effect With the conjunctive guardrail, the `M`-re-rooted credential is rejected at `C` with `ChainDiscontinuity` (parent `W_A` not on the `M -> R_partner` chain) and secondarily `RootNotTrustedForNamespace` (`R_partner` not trusted for `R_org` namespaces). The org repository is untouched. Without it, the instance grants a capability the delegating authority never conferred, and the audit log shows a *valid* scope proof — making the breach invisible to scope-based monitoring. The operational consequence is that **scope logs are not provenance logs**; only chain-termination records reveal re-rooting. Any AAIF deployment that logs scope containment as its authorization evidence is blind to this class of failure. ```python from dataclasses import dataclass, field from typing import Optional class AAIFChainError(RuntimeError): """Raised when a delegated AAIF credential fails chain or scope soundness.""" pass @dataclass(frozen=True) class Scope: actions: frozenset namespace: str def subset_of(self, other: "Scope") -> bool: return self.namespace == other.namespace and self.actions <= other.actions @dataclass(frozen=True) class Credential: issuer: str subject: str scope: Scope parent_warrant: Optional["Credential"] chain: tuple # ordered issuer identities, leaf-issuer first, root last @dataclass class TrustStore: # trust is a relation (root, namespace) -> bool, NOT a flat set trusted: dict = field(default_factory=dict) def trusts(self, root: str, namespace: str) -> bool: return self.trusted.get((root, namespace), False) def validate(cred: Credential, store: TrustStore) -> None: parent = cred.parent_warrant if parent is None: raise AAIFChainError("delegated credential missing parent warrant") # 1. scope containment (structural) if not cred.scope.subset_of(parent.scope): raise AAIFChainError( f"scope {cred.scope} not subset of parent {parent.scope}" ) # 2. parent warrant MUST be reachable on the presented chain # chain[0] == cred.issuer; the parent's issuer must be the next hop. if len(cred.chain) < 2: raise AAIFChainError("chain too short to anchor parent warrant") if cred.chain[0] != cred.issuer: raise AAIFChainError("chain head does not match credential issuer") if parent.issuer != cred.chain[1]: # This is the re-rooting defect: parent copied by reference, # but the chain does not actually pass through the parent's issuer. raise AAIFChainError( f"ChainDiscontinuity: parent issuer {parent.issuer!r} " f"is not chain[1]={cred.chain[1]!r}" ) # 3. monotonic attenuation along the whole chain # (each hop's scope must be a subset of its predecessor) cur = cred seen = 0 while cur.parent_warrant is not None: nxt = cur.parent_warrant if not cur.scope.subset_of(nxt.scope): raise AAIFChainError( f"AttenuationViolation at hop {seen}: {cur.scope} !⊆ {nxt.scope}" ) cur = nxt seen += 1 # 4. rooted termination in a namespace-scoped trusted root root = cred.chain[-1] if not store.trusts(root, cred.scope.namespace): raise AAIFChainError( f"RootNotTrustedForNamespace: root {root!r} not trusted for " f"namespace {cred.scope.namespace!r}" ) # --- reproduction of the observed failure --- if __name__ == "__main__": w_a = Credential( issuer="R_org", subject="A", scope=Scope(frozenset({"read:repo", "write:pr"}), "repo:org"), parent_warrant=None, chain=("R_org",), ) # M re-roots the delegation to its own partner root, scope preserved re_rooted = Credential( issuer="M", subject="C", scope=Scope(frozenset({"read:repo:path=/src"}), "repo:org"), parent_warrant=w_a, # copied by reference chain=("M", "R_partner"), # M's root, NOT R_org ) store = TrustStore(trusted={("R_partner", "partner:shared"): True}) try: validate(re_rooted, store) except AAIFChainError as e: # Expected: ChainDiscontinuity (and would also fail namespace trust) print(f"REJECTED: {e}") raise AAIFChainError(f"delegated credential rejected: {e}") from e ```