# In what scenarios must an instance reject a delegated AAIF credential whose scope narrows mid-chain: the attenuation-monotonicity invariant and its silent violation under re-issuance **Date of Record:** 2026 November 27 **Scope:** Applies to any agent that receives a delegated AAIF credential from a peer, orchestrator, or upstream warrant holder and then acts on it (tool invocation, sub-delegation, or resource access). Does not apply to root credentials minted directly by a trusted issuer, nor to stateless bearer tokens with no delegation chain. ## Core Distinction The AAIF delegation model rests on one non-negotiable invariant: **scope is monotonically non-increasing along the chain**. A child credential's effective permission set must be a subset of its parent's. This is the same attenuation discipline as macaroons and biscuit tokens, but AAIF adds a wrinkle that generic capability systems do not have: *re-issuance*. An intermediate agent does not merely pass a credential through — it may **re-mint** the credential against its own signing key, embedding a freshly computed scope claim, and forward that. The verifier then sees a chain of independently signed credentials rather than a single token with appended caveats. The boundary failure lives exactly here. When scope is expressed as a *computed* claim (a resolved set, a normalized resource glob, a time-bounded window) rather than as an *appended* predicate, the re-minting agent can produce a child scope that is *semantically* narrower but *syntactically* incomparable to the parent. Set-subset verification then either passes vacuously (empty intersection check) or fails closed on a credential that was actually legitimate. The dangerous case is the former: a child that *looks* attenuated but grants access the parent never held, because the normalization functions on the two sides disagree. ## What Was Observed An orchestrator agent `O` held a root warrant `W0` scoped to `resource: "s3://tenant-42/reports/*"` with `actions: [read]`. It delegated to a summarizer agent `S` by re-minting `W1` with scope `resource: "s3://tenant-42/reports/2024/*"`, `actions: [read]`. Syntactically a strict narrowing. `S` then sub-delegated to a retrieval worker `R` by re-minting `W2` scoped to `resource: "s3://tenant-42/reports/2024/q?_summary.json"`, `actions: [read, list]`. Two things went wrong at once, and only the second is obvious: 1. **Action widening.** `W2` added `list`, which `W0` never granted. A naive subset check on the *action* dimension across the whole chain would catch this — but `S`'s verifier only checked `W1 ⊆ W0` and `W2 ⊆ W1` pairwise, and `W1`'s action set was `[read]`, so `[read, list] ⊄ [read]`. This *should* have been caught. It was not, because `S`'s re-minting library normalized `list` into `read` at mint time (treating listing as a read-class operation) but the verifier's normalizer did not. The two normalizers diverged by one enum entry. 2. **Resource glob escape.** The glob `q?_summary.json` under a path-segment-aware matcher resolves to `q1_summary.json`, `q2_summary.json`, etc. — all children of `reports/2024/`. But `W0`'s glob `reports/*` was evaluated by the issuer's matcher as a *single-segment* wildcard, meaning it matched `reports/2024` as a directory but the `*` did not cross the `/` boundary. So `W0` never actually authorized anything under `reports/2024/` at depth 2. `O`'s re-mint of `W1` used a *recursive* matcher (`**` semantics) and silently widened. Every pairwise check downstream of `W1` passed because both sides used the recursive matcher. The escape happened at the `W0 → W1` edge and was invisible to every subsequent verifier. The net effect: `R` executed `list` against `s3://tenant-42/reports/2024/` and received object listings for a prefix that no credential in the chain ever authorized. The audit log recorded a clean, fully-attenuated chain. ## Condition of Validity The monotonicity invariant holds **only if the scope-comparison relation is total and shared by every verifier in the chain**. Concretely, a delegated credential `W_{i+1}` is a valid attenuation of `W_i` iff, for every dimension `d` in the scope schema: - `normalize_d^{issuer}(W_{i+1}.d) ⊆ normalize_d^{verifier}(W_i.d)` evaluates under *the same* `normalize_d`, and - the matcher semantics for resource globs (single-segment `*` vs recursive `**`, case sensitivity, trailing-slash handling, percent-encoding) are pinned by the credential's `schema_uri` and not inferred from the verifying agent's local defaults. When either condition fails, the chain is *unverifiable*, not *valid*. The correct disposition is rejection, not best-effort matching. The subtlety that trips operators: a chain can be pairwise-valid at every edge and still be globally invalid, because the composition of normalizers is not the normalizer of the composition. Non-associativity of normalization is the actual failure surface. ## Decision Boundary An instance must **reject and refuse to act** on a delegated credential — even one that verifies pairwise at its own edge — when any of the following hold: - The credential's `schema_uri` differs from the parent's, or the parent's `schema_uri` is absent (unpinned matcher). - The scope contains any dimension the verifier cannot normalize with a function it can prove is the issuer's (no shared normalizer registry entry, or a version mismatch). - The resource dimension contains a glob whose segment-crossing behavior is ambiguous under the declared matcher. - The action set of the child contains an element not present in the parent *before* normalization, regardless of whether normalization would collapse it. - The chain length exceeds the `max_delegation_depth` declared in `W0` — a re-mint that drops the depth counter resets the budget and is a widening. An instance may **proceed with a warning** only when the parent's normalizer is available, version-matched, and the child scope is a strict subset under that normalizer. Anything else is a hard stop. The asymmetry is deliberate: false rejection costs a retry; false acceptance costs an unauthorized side effect that the audit trail will misattribute. ## Operational Effect The practical consequence is that **verification must be anchored at the root, not at the edge**. An agent receiving `W_i` cannot validate it in isolation; it must either (a) fetch and replay the full chain against `W0` using `W0`'s pinned normalizers, or (b) trust a signed *attenuation proof* attached to `W_i` that certifies the subset relation was checked by a party holding the issuer's normalizer. AAIF's `proof_of_attenuation` field exists for (b); agents that ignore it and fall back to local pairwise checks are the population that produces the failure above. Two concrete architectural changes follow. First, normalizer versions must be part of the credential, not part of the verifier's config — a `scope_normalizer_version` claim that the verifier refuses to override. Second, re-minting must be *append-only* on the action dimension and *set-intersection* on the resource dimension, never recomputed from scratch; recomputation is where the recursive-glob widening enters. The invariant to encode: `effective_scope(W_{i+1}) = effective_scope(W_i) ∩ declared_scope(W_{i+1})`, computed under `W0`'s normalizers, with intersection — not re-derivation — as the only legal combining operation. ```python from dataclasses import dataclass, field from typing import FrozenSet, Optional class AttenuationViolation(RuntimeError): """Raised when a delegated AAIF credential fails monotonicity under the root's normalizers.""" @dataclass(frozen=True) class Scope: resources: FrozenSet[str] actions: FrozenSet[str] normalizer_version: str matcher: str # "single_segment" | "recursive" @dataclass(frozen=True) class Credential: issuer: str subject: str scope: Scope parent_id: Optional[str] depth: int schema_uri: str proof_of_attenuation: Optional[str] = None ROOT_NORMALIZER = {"v1": {"read": {"read"}, "list": {"list"}, "read_write": {"read", "write"}}} def _normalize_actions(actions: FrozenSet[str], version: str) -> FrozenSet[str]: table = ROOT_NORMALIZER.get(version) if table is None: raise AttenuationViolation(f"unknown normalizer version {version!r}; cannot verify subset") out: set = set() for a in actions: if a not in table: raise AttenuationViolation(f"action {a!r} has no normalizer entry under {version}") out |= table[a] return frozenset(out) def _resource_subset(child: FrozenSet[str], parent: FrozenSet[str], matcher: str) -> bool: # Conservative: every child glob must be provably contained in some parent glob # under the SAME matcher. Recursive/single-segment mixing is treated as widening. for c in child: if not any(_glob_contains(p, c, matcher) for p in parent): return False return True def _glob_contains(parent_glob: str, child_glob: str, matcher: str) -> bool: if matcher == "single_segment": # '*' does not cross '/'. Child may not introduce '**' or deeper segments. if "**" in child_glob: return False p_prefix = parent_glob.split("*", 1)[0] return child_glob.startswith(p_prefix) and child_glob.count("/") == parent_glob.count("/") if matcher == "recursive": p_prefix = parent_glob.split("*", 1)[0] return child_glob.startswith(p_prefix) raise AttenuationViolation(f"unknown matcher {matcher!r}") def verify_delegation(child: Credential, parent: Credential, root: Credential) -> None: """Reject unless child is a provable attenuation of parent under ROOT's normalizers.""" if root.scope.normalizer_version != parent.scope.normalizer_version: raise AttenuationViolation("parent normalizer version diverges from root") if child.scope.normalizer_version != root.scope.normalizer_version: raise AttenuationViolation( f"child normalizer {child.scope.normalizer_version!r} != root " f"{root.scope.normalizer_version!r}; re-mint may have widened" ) if child.scope.matcher != root.scope.matcher: raise AttenuationViolation( f"matcher drift {child.scope.matcher!r} vs root {root.scope.matcher!r}" ) if child.depth > root.depth: raise AttenuationViolation(f"depth {child.depth} exceeds root budget {root.depth}") # Action attenuation: child actions must be a subset of parent actions pre-normalization, # then the normalized sets must also be subsets. if not child.scope.actions.issubset(parent.scope.actions | _normalize_actions(parent.scope.actions, root.scope.normalizer_version)): raise AttenuationViolation( f"action widening: child={sorted(child.scope.actions)} parent={sorted(parent.scope.actions)}" ) if not _normalize_actions(child.scope.actions, root.scope.normalizer_version).issubset( _normalize_actions(parent.scope.actions, root.scope.normalizer_version) ): raise AttenuationViolation("normalized action set escapes parent") if not _resource_subset(child.scope.resources, parent.scope.resources, root.scope.matcher): raise AttenuationViolation( f"resource widening: child={sorted(child.scope.resources)} " f"parent={sorted(parent.scope.resources)} matcher={root.scope.matcher}" ) def admit(chain: list[Credential]) -> Credential: """Validate a full delegation chain against its root; return the leaf on success.""" if not chain: raise AttenuationViolation("empty chain") root = chain[0] for i in range(1, len(chain)): verify_delegation(chain[i], chain[i - 1], root) return chain[-1] ```