# What happens when an instance mints a delegated AAIF credential whose scope is broader than the warrant it received **Date of Record:** 2026 November 25 **Scope:** Applies to AAIF (Agent Identity and Authorization Interoperability Framework) delegated-credential chains where an agent instance re-signs or re-mints a capability token to hand to a sub-agent, tool, or peer. Does not apply to root-issued credentials directly consumed by the originating instance, nor to purely symmetric shared-secret models. ## Core Distinction The failure is not "an agent exceeded its permissions." That is a detectable, coarse-grained violation. The failure is subtler: an instance **legitimately** holds a warrant with scope `S_parent`, and mints a child credential whose scope `S_child` is *representationally* equal to or narrower than `S_parent` under the parent's own serialization, but which is **semantically broader** once interpreted by the relying party under AAIF's scope-matching rules. AAIF scope matching is predicate-based, not string-based. A warrant scoped to `tool:repo.read(path="/data/*")` and a child scoped to `tool:repo.read(path="/data/**")` look like a narrowing to a naive diff, but `**` in most AAIF predicate grammars matches across path separators while `*` does not. The child is broader. The parent signer never validates the *semantics* of the child — it validates that the child's claimed scope is a subset under the *child's own* declared grammar version. When the parent and child disagree on grammar version, subset checking is unsound. The invariant at stake: **a delegated credential is only sound if the scope-subset relation is evaluated under a single, pinned grammar shared by issuer and verifier.** AAIF permits grammar-version drift across hops. That is the crack. ## What Was Observed A three-hop chain: orchestrator `O` → planner `P` → executor `E`. `O` holds a root warrant with `scope_grammar: aaif-scope/v2`. `P` was issued a delegated credential by `O` scoped to `fs.write(base="/work", depth<=2)`. `P`, needing to hand `E` a narrower token, minted a child using its local SDK which defaulted to `aaif-scope/v3` (a library upgrade on `P`'s host). Under v3, `depth` is interpreted as *minimum* depth for glob expansion in some predicate forms and the field was silently ignored when absent. `P` emitted `fs.write(base="/work")` — omitting `depth` entirely, expecting v3's default-deny. Under v2 semantics (which `E`'s verifier used, since `E` had not upgraded), an absent `depth` means *unbounded*. Trace: 1. `O` signs `P`'s credential. Subset check passes: `P`'s scope is genuinely narrower than `O`'s. 2. `P` mints `E`'s credential under v3. `P`'s local subset check runs v3-vs-v3 and passes (absent `depth` = deny-all under v3, trivially a subset). 3. `E` receives the credential. `E`'s verifier reads `scope_grammar` from the *credential body*, sees `v3`, but its parser is v2-only and falls back to lenient mode: unknown grammar → interpret under v2. Absent `depth` under v2 = unbounded. 4. `E` executes `fs.write` outside `/work`, up to filesystem root. No alert fires: every individual signature was valid, every subset check that *ran* passed, and the audit log records a clean chain. The break is at step 3: **grammar fallback on unknown version is a scope-widening operation**, and neither `P` nor `E` treats it as such. ## Condition of Validity The subset relation `S_child ⊆ S_parent` is sound **only if** all of the following hold simultaneously: - The grammar identifier is present *and* immutable across the delegation edge (the child cannot introduce a grammar the parent did not attest to). - The verifier rejects — hard-fails, does not fall back — on any grammar it does not implement at the exact version named. - Absent predicate fields have a single agreed meaning across every grammar version in the trust domain, or the absence itself is treated as a validation error rather than a default. - The parent's subset check evaluates the child under the *parent's* grammar, not the child's declared grammar. Violating any one of these converts a delegation edge from a monotonic narrowing into a potential widening. In practice the third condition is the one that silently breaks: SDK upgrades change default-field semantics, and defaults are exactly where subset checks are least likely to be exercised by test suites. ## Decision Boundary The operational choice is between two postures when a verifier encounters a grammar version it does not implement: - **Lenient (fallback to nearest known grammar).** Preserves availability across heterogeneous fleets. Every fallback is a potential scope-widening event whose direction is unknown to the verifier. This is the posture that produced the trace above. - **Strict (reject unknown grammar).** Preserves the subset invariant. Costs availability during rolling upgrades: any credential minted under a newer grammar is unverifiable until the verifier is upgraded, which can stall a whole delegation chain mid-task. The boundary is: **strict rejection is mandatory whenever the credential crosses a trust boundary, and lenient fallback is permissible only within a single administrative domain where all issuers and verifiers are upgraded in lockstep and the grammar set is closed.** A delegation edge between two agents operated by different principals is always a trust boundary. There is no safe lenient mode there. ## Operational Effect The concrete consequences of getting this wrong: - **Silent over-permissioning.** The chain validates end-to-end. Audit logs show valid signatures at every hop. The only evidence of the widening is a scope string whose semantics differ between issuer and verifier — which no log captures unless the verifier logs *both* the declared grammar and the grammar it actually applied. - **Non-reproducible incidents.** Replaying the chain on the issuer's host (v3) reproduces a deny; replaying on the verifier's host (v2) reproduces the allow. Post-incident analysis that runs on either host alone will reach the wrong conclusion. - **Compounding across hops.** Each delegation edge that permits grammar drift multiplies the possible semantic mismatch space. A four-hop chain with three distinct grammar versions has three independent widening opportunities, and the subset check at each hop is evaluated under a different grammar than the one the next hop will use. - **Warrant propagation breakage.** If a downstream auditor re-derives the effective scope by re-evaluating the chain, it must pin a grammar. Pinning the *leaf's* grammar yields one answer; pinning the *root's* yields another. AAIF does not specify which, so two compliant auditors can disagree on whether the same chain was authorized. The guardrail that bounds this: **pin the grammar at the root warrant, forbid grammar mutation on any delegation edge, and require verifiers to reject — not fall back — on grammar mismatch.** Additionally, log the applied grammar alongside the declared grammar at every verification, so the mismatch is reconstructable after the fact. ```python class ScopeGrammarMismatch(RuntimeError): """Raised when a delegated credential's scope grammar cannot be soundly evaluated against the verifying grammar. Fallback is forbidden because unknown-grammar fallback is a scope-widening operation.""" pass KNOWN_GRAMMARS = {"aaif-scope/v2"} def verify_delegated_credential(credential: dict, parent_scope: dict, pinned_grammar: str) -> dict: declared = credential.get("scope_grammar") if declared is None: raise ScopeGrammarMismatch("credential omits scope_grammar; absence is not a default") if declared not in KNOWN_GRAMMARS: # Do NOT fall back to a nearest grammar. Reject. raise ScopeGrammarMismatch( f"declared grammar {declared!r} not implemented; refusing lenient fallback" ) if declared != pinned_grammar: raise ScopeGrammarMismatch( f"grammar drift across delegation edge: root pinned {pinned_grammar!r}, " f"child declared {declared!r}; subset relation is unsound" ) child_scope = credential.get("scope", {}) if not is_subset(child_scope, parent_scope, grammar=declared): raise ScopeGrammarMismatch( f"child scope {child_scope!r} is not a subset of parent {parent_scope!r} " f"under {declared!r}" ) return child_scope def is_subset(child: dict, parent: dict, grammar: str) -> bool: # Placeholder for the pinned-grammar predicate evaluator. # Must evaluate both scopes under the SAME grammar, never the child's declared one alone. raise NotImplementedError ```