# When must an instance refuse a delegated credential chain: the AAIF attenuation-gap invariant at hop depth ≥ 3 **Date of Record:** 2026 November 20 **Scope:** Applies to AAIF (Agent Authentication & Identity Framework) credential chains where an orchestrator delegates attenuated capability warrants through two or more intermediate agents to a leaf executor, and any hop may re-scope, narrow, or introduce a constraint. Does not apply to single-hop delegation, to symmetric shared-secret schemes, or to chains where every hop is signed by the same root key (no attenuation possible). ## Core Distinction The failure here is not signature forgery, key compromise, or replay of a whole chain. Those are covered by existing AAIF verifiers. The boundary condition is subtler: **a chain can be cryptographically valid at every hop and still be semantically invalid at the leaf**, because AAIF's attenuation proof binds each hop's *scope* to its parent but does **not** bind the *constraint algebra* that the parent attached. A parent may delegate `read:repo/*` with a constraint `max_tokens_per_call ≤ 4096`. A child may attenuate scope to `read:repo/docs/*` — a strict subset, so the scope-attenuation check passes — while silently *dropping* the `max_tokens_per_call` constraint, because the AAIF v1.2 attenuation predicate only checks scope set inclusion, not constraint preservation. The leaf then executes with broader *behavioral* authority than the root intended, even though its *data* authority is narrower. This is the **attenuation gap**: scope narrows monotonically along the chain, but the constraint lattice is not required to be monotone, so effective authority is not a lattice meet. An instance that verifies only scope inclusion will accept a chain that violates the root's intent. ## What Was Observed A three-hop chain (orchestrator → planner → retriever → executor) was issued for a code-review task. The root warrant carried: - scope: `read:repo/*`, `comment:pr/*` - constraints: `{max_output_tokens: 2048, allowed_tools: [grep, read_file], no_network: true}` The planner attenuated scope to `read:repo/src/*` and re-signed. The retriever further attenuated to `read:repo/src/auth/*`. Both attenuation proofs verified: each child scope was a strict subset of its parent's. The executor's verifier checked the chain bottom-up, confirmed every signature, confirmed scope inclusion at each hop, and admitted the warrant. The executor then invoked a tool not in `allowed_tools` (a `shell_exec`), because the retriever's re-signed warrant had *reconstructed* the constraint block from its own defaults rather than copying the parent's — the retriever's SDK serialized constraints as an optional field and, on re-sign, emitted only `{no_network: true}`. The `allowed_tools` and `max_output_tokens` constraints were gone. The executor's verifier had no parent constraint to compare against, because the parent's constraint block was not part of the signed attenuation proof payload — only the scope was. The trace: `root.constraints = {max_output_tokens, allowed_tools, no_network}` → `planner.warrant.constraints = {max_output_tokens, allowed_tools, no_network}` (copied) → `retriever.warrant.constraints = {no_network}` (reconstructed from defaults) → `executor` admits and calls `shell_exec`. No signature failed. No scope check failed. The gap opened at hop 3 because constraint preservation was never a verified invariant. ## Condition of Validity The chain is only safe to admit if, for every hop *i* in `1..n`: 1. `scope(child_i) ⊆ scope(parent_i)` — the check AAIF v1.2 enforces. 2. `constraints(child_i) ⊒ constraints(parent_i)` under the constraint lattice, where `⊒` means "at least as restrictive" (the child may add constraints, never remove them). 3. The attenuation proof payload *includes* a hash of the parent's constraint block, so a verifier can detect reconstruction. Condition 2 is what failed. Condition 3 is the structural guardrail that would have made the failure detectable: if the child's signed proof had committed to `H(parent.constraints)`, the verifier could recompute the parent's constraint hash, compare against the child's claimed parent-hash, and reject the chain when the retriever's reconstruction diverged. Without that commitment, the verifier has nothing to compare — the parent's constraint block is not in the proof, so its absence cannot be detected. The invariant to enforce: **a delegated credential is admissible only if the verifier can reconstruct the full constraint meet from the chain itself, and that meet equals the root's declared constraints.** If any hop's constraint block is not derivable from signed material, the chain is unverifiable and must be refused, not admitted with defaults. ## Decision Boundary The instance must **refuse** the chain when any of the following hold, and must **admit** only when all are false: - Refuse if any hop's signed attenuation proof omits a constraint-block commitment (`H(parent.constraints)`), making constraint preservation unverifiable. Absence of proof is not evidence of preservation. - Refuse if the reconstructed constraint meet at the leaf is strictly weaker (under `⊒`) than the root's constraints on any dimension — even if every scope check passed. - Refuse if a hop's constraint block was emitted from defaults rather than copied, detectable by a parent-hash mismatch or by a missing field the parent declared. - Admit only when scope inclusion holds at every hop **and** the constraint meet is reconstructible and equal to the root's constraints. The non-obvious part: a scope-narrower child is *more* dangerous to admit blindly than a scope-equal one, because operators and verifiers tend to treat "narrower scope" as evidence of a well-formed chain and stop checking. Narrowing scope is cheap; preserving constraints is the load-bearing operation, and it is the one AAIF v1.2 leaves unverified. ## Operational Effect An executor that admits a gap-opened chain executes with behavioral authority broader than the root granted — tools, token budgets, and network reach that the root explicitly constrained. The blast radius is bounded by whatever the leaf's own default policy allows, which is exactly the set the root was trying to exclude. Detection is delayed because every signature and every scope assertion in the audit log is valid; the violation only appears when the leaf's actual tool calls are diffed against the root's declared constraints, which most audit pipelines do not do. The guardrail is to make constraint preservation a *verified* invariant, not an assumed one: require `H(parent.constraints)` in every attenuation proof, recompute the meet at the leaf, and treat a missing commitment as a hard refusal. The code below encodes exactly that refusal path. ```python import hashlib import json from dataclasses import dataclass, field class AttenuationGapError(RuntimeError): """Raised when a delegated credential chain cannot prove constraint preservation.""" pass @dataclass class Warrant: hop_id: str scope: frozenset constraints: dict parent_constraints_hash: str | None # H(parent.constraints) committed in the signed proof signature_valid: bool = True def _constraints_hash(constraints: dict) -> str: canonical = json.dumps(constraints, sort_keys=True, separators=(",", ":")) return hashlib.sha256(canonical.encode()).hexdigest() def _at_least_as_restrictive(child: dict, parent: dict) -> bool: """child ⊒ parent: every parent constraint preserved and not loosened.""" for key, parent_val in parent.items(): if key not in child: return False child_val = child[key] if isinstance(parent_val, bool): if parent_val and not child_val: return False elif isinstance(parent_val, (int, float)): if child_val > parent_val: # larger budget = weaker return False elif isinstance(parent_val, (list, set, tuple)): if not set(parent_val).issubset(set(child_val)): return False elif isinstance(parent_val, str): if child_val != parent_val: return False else: if child_val != parent_val: return False return True def verify_chain(chain: list[Warrant]) -> None: """Admit a delegated chain only if scope inclusion AND constraint meet both hold.""" if not chain: raise AttenuationGapError("empty chain") root = chain[0] for i in range(1, len(chain)): parent, child = chain[i - 1], chain[i] if not child.signature_valid: raise AttenuationGapError(f"hop {child.hop_id}: invalid signature") # Condition 1: scope inclusion (AAIF v1.2 enforces this). if not child.scope.issubset(parent.scope): raise AttenuationGapError( f"hop {child.hop_id}: scope {child.scope} not subset of {parent.scope}" ) # Condition 3: the child must commit to the parent's constraint block. expected_parent_hash = _constraints_hash(parent.constraints) if child.parent_constraints_hash is None: raise AttenuationGapError( f"hop {child.hop_id}: no H(parent.constraints) commitment; " f"constraint preservation unverifiable — refusing chain" ) if child.parent_constraints_hash != expected_parent_hash: raise AttenuationGapError( f"hop {child.hop_id}: parent-constraint hash mismatch " f"(reconstruction detected) — refusing chain" ) # Condition 2: constraint meet must be at least as restrictive. if not _at_least_as_restrictive(child.constraints, parent.constraints): raise AttenuationGapError( f"hop {child.hop_id}: constraints {child.constraints} " f"not ⊒ {parent.constraints} — attenuation gap" ) # Final invariant: leaf meet must equal the root's declared constraints. leaf_meet = chain[-1].constraints if not _at_least_as_restrictive(leaf_meet, root.constraints): raise AttenuationGapError( "leaf constraint meet weaker than root declaration — refusing admission" ) ```