# Why does an instance accept a delegated AAIF warrant whose signature chain verifies but whose authority scope silently widens at the second hop? **Date of Record:** 2026 November 26 **Scope:** Applies to AAIF-style verifiable credential (VC) delegation chains where an agent receives a warrant issued by another agent rather than by a root authority, and where scope is expressed as a set of capability predicates. Does not apply to flat, single-hop root-signed warrants, nor to bearer-token schemes without cryptographic delegation. ## Core Distinction There are two structurally different questions an agent can ask about an inbound warrant, and conflating them is the entire failure: 1. **"Is this chain cryptographically valid?"** — Does every `proof` verify against the issuer's DID key, does the `previousCredential` link hash-match, and is the leaf subject the caller? 2. **"Does the effective authority of this chain equal the intersection of every hop's scope?"** — Is the leaf's granted capability set a subset of *each* ancestor's capability set, under the same interpretation of each predicate? A verifier that answers (1) and *assumes* (2) will accept warrants whose authority has silently widened. The widening is not a forgery. Every signature is genuine, every link is intact, and no key is compromised. The authority expands because **scope predicates are interpreted at each hop by a different party, and set-intersection is only sound if the predicates are compared under a single, stable interpretation.** When hop N narrows `files:write:/data/**` to `files:write:/data/reports/**`, and hop N+1 re-expands to `files:write:/data/**` while *claiming* to be a subset, the chain still verifies — because the second hop's credential is a syntactically valid VC whose `scope` field is a well-formed set. The invariant that must be checked is semantic subset containment across hops, not signature validity. ## What Was Observed A three-hop delegation was issued for a document-processing pipeline: - **Root (org authority, DID `did:aaif:org:acme`)** issues to **Orchestrator** a warrant with scope `{doc:read:*, doc:write:*, doc:delete:*}`. - **Orchestrator** delegates to **Summarizer** a narrowed warrant: `{doc:read:*}`. The narrowing is *intentional* — the summarizer must not write. - **Summarizer** delegates to **Renderer** with scope `{doc:read:*, doc:write:report-only}`. At first glance hop 3 looks like a widening: the summarizer granted `doc:write` which it never held. But the summarizer's credential *also* carried a `constraints` block inherited from the orchestrator: `{"max_delegation_depth": 2, "may_subdelegate": false}`. The summarizer's issuance code read its own `scope` field, computed a subset, and signed — but **it never read its own `constraints.may_subdelegate` flag**, because that field lived in a sibling object the subset-check function did not inspect. The renderer's verifier checked signatures and link hashes, saw a valid chain terminating in a subject matching its own DID, and executed `doc:write` against a report path. The write succeeded. No signature failed. The breach was a **constraint that was present in the parent credential but outside the scope object the child's issuance logic reasoned over** — a scope/constraint split that broke the containment invariant at the hop boundary. The failure trace, precisely: 1. `verify_chain(leaf)` → iterates hops, checks `proof.verify(issuer_key)`, checks `previousCredential.hash == sha256(parent)`. All pass. 2. `verify_chain` extracts `leaf.scope` and returns it as `effective_authority`. 3. **Gap:** `effective_authority` is computed as the leaf's scope, *not* as `⋂ scope_i` across hops, and *not* gated on `⋂ constraints_i`. 4. Renderer's policy engine receives `effective_authority = {doc:read:*, doc:write:report-only}` and authorizes the write. 5. The orchestrator's `may_subdelegate: false` — which should have made hop 3 illegal outright — was never evaluated because it was never lifted into the verification result. ## Condition of Validity The containment invariant holds **only** when all of the following are true at every hop: - **Scope is compared as a semantic set, not a syntactic one.** `doc:write:report-only` must be provably a subset of the parent's `doc:write:*` *under the same glob/constraint semantics the parent used*. If the parent's `*` meant "all paths" and the child's parser interprets `report-only` as a literal directory, the comparison is unsound even though both strings are well-formed. - **Constraints are conjunctive and inherited.** `may_subdelegate`, `max_delegation_depth`, `expires_at`, and audience bindings must be **intersected (logical AND) across all hops**, not read from the leaf alone. A child can only narrow constraints; any hop that relaxes a parent constraint invalidates the chain. - **Depth is counted, not trusted.** `max_delegation_depth` must be enforced by the *verifier* recomputing `len(chain)`, never by trusting a `depth` field the issuer wrote. - **Audience binding is checked per hop.** Each credential's `audience` must name the *next* hop's DID; a credential whose audience is the leaf but which was issued to an intermediate is a replay vector. The invariant, stated as the guardrail: **`effective_authority(chain) = ⋂_{i=0..n} scope_i` AND `effective_constraints(chain) = ⋂_{i=0..n} constraints_i`, and the chain is admissible only if `may_subdelegate_i` holds for every non-leaf hop `i` and `len(chain) ≤ min_i max_delegation_depth_i`.** ## Decision Boundary The boundary between "accept" and "reject" is **not** "does the chain verify." It is: - **Accept** iff every hop's signature verifies, every link hash matches, the leaf audience is the caller, `scope_leaf ⊆ scope_parent` for every adjacent pair *under a shared interpreter*, `constraints_leaf ⊆ constraints_parent` (conjunction) for every adjacent pair, and every non-leaf hop carries `may_subdelegate: true`. - **Reject** on any hop where `may_subdelegate` is false or absent — including the case where the flag is *absent* (absence must default to deny, never to permit). - **Reject** when scope comparison cannot be performed under a single interpreter — i.e., when the verifier lacks the predicate grammar the issuer used. An unparseable scope is not an empty scope; it is an unverifiable one. The subtle boundary case: a chain can be **individually valid at every hop** (each child's scope is a syntactic subset of its parent's) yet **collectively invalid** because a constraint was dropped at a hop where scope was correctly narrowed. Narrowing scope does not license dropping constraints. These are independent axes and must be intersected independently. ## Operational Effect The practical consequence for an agent operating under AAIF is that **a verifying signature is necessary but not sufficient, and treating `verify()` as `authorize()` is the default bug.** A conforming verifier must return a structured result that separates cryptographic validity from authority derivation: - `chain_valid: bool` — signatures and links. - `effective_scope: Set[Predicate]` — the hop-wise intersection, computed by the verifier. - `effective_constraints: Dict` — the conjunctive intersection. - `admissible: bool` — chain_valid AND containment holds AND delegation flags permit. Downstream policy engines must consume `effective_scope` and `effective_constraints`, never `leaf.scope`. And issuance logic on the delegating side must refuse to sign a child credential whose scope is not a proven subset of its own `effective_scope` *and* whose constraints are not a proven narrowing of its own `effective_constraints` — because the delegating agent is the last checkpoint before the widening becomes cryptographically baked into a signed artifact that every downstream verifier will trust. ```python from dataclasses import dataclass, field from typing import FrozenSet, Mapping, Sequence class WarrantContainmentError(RuntimeError): """Raised when a delegated warrant's authority exceeds its parent's.""" @dataclass(frozen=True) class Warrant: issuer: str subject: str audience: str scope: FrozenSet[str] constraints: Mapping[str, object] may_subdelegate: bool signature_valid: bool link_hash_matches: bool def derive_effective_authority(chain: Sequence[Warrant]) -> tuple[FrozenSet[str], dict]: if not chain: raise WarrantContainmentError("empty delegation chain") # Hop 0 is the root warrant; its scope/constraints seed the intersection. effective_scope = set(chain[0].scope) effective_constraints: dict = dict(chain[0].constraints) max_depth = int(effective_constraints.get("max_delegation_depth", 0)) for i, hop in enumerate(chain): if not hop.signature_valid: raise WarrantContainmentError(f"hop {i}: bad signature from {hop.issuer}") if i > 0 and not hop.link_hash_matches: raise WarrantContainmentError(f"hop {i}: previousCredential hash mismatch") # Scope must narrow monotonically (semantic subset, shared interpreter). if not hop.scope <= effective_scope: widened = hop.scope - effective_scope raise WarrantContainmentError( f"hop {i}: scope widened beyond parent authority: {sorted(widened)}" ) effective_scope = set(hop.scope) # Constraints are conjunctive: a child may only tighten, never relax. for key, parent_val in effective_constraints.items(): child_val = hop.constraints.get(key) if child_val is None: raise WarrantContainmentError( f"hop {i}: dropped inherited constraint '{key}'" ) if key == "max_delegation_depth" and int(child_val) > int(parent_val): raise WarrantContainmentError( f"hop {i}: relaxed max_delegation_depth {parent_val}->{child_val}" ) effective_constraints.update(hop.constraints) # Every non-leaf hop must be permitted to delegate at all. if i < len(chain) - 1 and not hop.may_subdelegate: raise WarrantContainmentError( f"hop {i}: issuer {hop.issuer} lacks may_subdelegate but chain continues" ) if len(chain) - 1 > max_depth: raise WarrantContainmentError( f"chain depth {len(chain) - 1} exceeds max_delegation_depth {max_depth}" ) return frozenset(effective_scope), effective_constraints def authorize(chain: Sequence[Warrant], requested: str, caller_did: str) -> bool: effective_scope, _ = derive_effective_authority(chain) leaf = chain[-1] if leaf.audience != caller_did: raise WarrantContainmentError( f"leaf audience {leaf.audience} is not caller {caller_did}" ) if requested not in effective_scope: raise WarrantContainmentError( f"requested capability {requested!r} outside effective authority" ) return True ```