# What structural signals indicate a delegated-capability attenuation failure in AAIF chains when a sub-agent re-scopes a token under a narrowing-but-non-monotonic policy **Date of Record:** 2026 December 4 **Scope:** Applies to AAIF (Agent Identity and Authorization Framework) delegated credential chains where a parent agent mints a scoped capability token for a child agent and the child is permitted to further attenuate that token before invoking a downstream tool or peer. Does not apply to flat single-hop authorization, nor to bearer tokens without an embedded attenuation proof. ## Core Distinction The failure mode is not token theft, signature forgery, or expiry. It is **attenuation non-monotonicity**: the child agent produces a derived token whose scope set is a proper subset of the parent's scope set (so a naive subset check passes), yet the derived token is *more powerful* on at least one axis because the narrowing operation was applied to a differently-parameterized predicate. AAIF scoped capability tokens carry a scope as a conjunction of typed predicates, e.g. `tool="filesystem.read" AND path∈"/data/reports/**" AND max_bytes≤1048576`. Attenuation is supposed to be a monotone meet: the child's scope must be the logical AND of the parent's scope and any additional constraints. The invariant that must hold is: > For every request `r` that the derived token authorizes, the parent token must also authorize `r`. This is a *semantic* entailment over predicate conjunctions, not a set-membership test over scope identifiers. The failure occurs when the AAIF runtime verifies attenuation by comparing serialized scope strings or by checking that each child predicate is "present" in the parent — both of which are syntactic and both of which admit non-monotone derivations. ## What Was Observed A three-hop chain: orchestrator `O` → planner `P` → executor `E`. `O` mints for `P` a token with scope: ``` tool = "filesystem.read" AND path ∈ "/data/**" AND deny_path ∈ "/data/secrets/**" ``` `P` delegates to `E` and, following a policy that says "executors must be restricted to a single subtree," rewrites the scope to: ``` tool = "filesystem.read" AND path ∈ "/data/reports/**" AND deny_path ∈ "/data/secrets/**" ``` The runtime's attenuation check confirmed each child predicate key existed in the parent and that `path` had narrowed from `/data/**` to `/data/reports/**`. The token was accepted. The defect: `deny_path` is a **negative** (exclusion) predicate. Under the parent, `deny_path="/data/secrets/**"` excludes secrets. Under the child, the same exclusion is present but the *positive* domain has moved underneath a directory that itself contains a symlink `/data/reports/latest → /data/secrets/2026`. The child's predicate `path ∈ "/data/reports/**"` matches `/data/reports/latest/keys.json` lexically; the parent's `deny_path` was written to match resolved paths. Because `E`'s tool resolves symlinks *after* authorization, the deny predicate was evaluated against the unresolved path and did not fire. The derived token authorized a read of `/data/secrets/2026/keys.json`, which the parent token — evaluated with the same resolution order — would also have authorized, but which the *intent* of the parent scope forbade. The structural signal was not an error. Every signature verified, every expiry was in the future, every declared predicate was a subset. The signal was a **predicate-polarity mismatch combined with a path-resolution-order divergence between the authorizing and the executing layer**. The second observed instance was subtler. Parent scope: ``` tool = "http.fetch" AND host ∈ {"api.internal", "*.partner.example"} AND method = "GET" ``` Child narrowed `method` to `"GET"` (no-op) and — because the policy template defaulted it — set `host ∈ {"api.internal"}`. This is monotone. But the child also carried forward a parent-injected `redirect_follow = true` attribute that the parent had set only for the `*.partner.example` branch. The child's token therefore permitted `api.internal` fetches that followed a 302 to `evil.example`. The scope predicates were monotone; the **implicit behavioral attribute** was not, because it was scoped to a sibling branch of the union and the child lifted it into a singleton context. In both cases the derived token is a strict syntactic subset and a semantic superset. ## Condition of Validity The monotone-attenuation invariant holds only when all of the following are true simultaneously: 1. **Predicate polarity is uniform.** Every scope predicate is either a positive membership constraint or a negative exclusion, and the attenuation check treats exclusions as *intersected* (child deny ⊇ parent deny) rather than *inherited*. A child that copies a parent deny without widening it is fine; a child that narrows a positive domain so that it now overlaps a path the parent's deny was written to protect is not, unless resolution order is identical across layers. 2. **Evaluation order is fixed and shared.** Path normalization, symlink resolution, case folding, and Unicode normalization must occur *before* predicate evaluation at both the minting and the enforcing layer. If the authorizer evaluates on the unresolved string and the executor evaluates on the resolved path (or vice versa), the entailment check is unsound regardless of how carefully scopes are nested. 3. **Implicit attributes are not branch-local.** Behavioral attributes (redirect-following, retry budgets, credential forwarding, header injection) must be modeled as first-class scope predicates if they can be conditioned on any other predicate. An attribute that is only meaningful under one branch of a union cannot be safely carried into a context where that branch is absent. 4. **The attenuation proof is semantic, not structural.** The runtime must be able to decide `child_scope ⊨ parent_scope` by constructing a witness for the negation, or by a conservative syntactic subset that is *provably* sound for the predicate algebra in use. String-key presence checks are never sufficient. ## Decision Boundary The boundary between "safe to delegate" and "must re-mint at the root" is crossed when any of the following structural signals appear in the derived token: - A negative predicate in the parent whose matched set is **not a subset** of the child's positive domain after normalization. Formally: `resolve(child.path) ∩ resolve(parent.deny) ≠ ∅` for some path reachable through the child's tool. This is the symlink-overlap signal. - A behavioral attribute present in the child whose *conditioning predicate* is absent from the child's scope. This is the orphaned-attribute signal. - A predicate whose evaluation depends on a value (resolved path, decoded host, canonicalized method) that the attenuation checker did not itself compute. This is the evaluation-divergence signal. - A scope union in the parent collapsed to a singleton in the child while any attribute was conditioned on the union's other branch. This is the branch-collapse signal. When any signal fires, the correct action is **not** to patch the child scope. The child cannot repair a non-monotone derivation by adding constraints, because it does not know which parent predicates were branch-local. The chain must be re-minted from the root with an explicit, fully-qualified scope, and the offending delegation must be recorded as a failed attenuation event so the parent's policy can be corrected. ## Operational Effect In practice, AAIF chains that pass structural checks but fail semantic entailment produce **silent over-authorization**: the agent believes it holds a narrowed capability, downstream auditors see a valid signature chain, and the over-broad access only surfaces when an unrelated incident triggers a log review. The blast radius is bounded by the parent's original scope, but the *containment* the delegation was supposed to provide is absent — a compromised or prompt-injected child can reach the full parent surface through the non-monotone gap. The architectural guardrail is a **semantic attenuation gate** at mint time: the parent agent (or a policy service acting for it) must compute, for the proposed child scope, whether there exists any request satisfying the child but not the parent, using the *same* normalizer and predicate evaluator the enforcement layer will use. If a witness exists, the delegation is rejected. This gate must run on the resolved, canonicalized representation and must treat behavioral attributes as predicates over the full request tuple (method, host, resolved path, redirect chain, forwarded credentials), not as metadata attached to a scope node. The second guardrail is **resolution-order pinning**: the token must carry the canonicalization profile (normalization form, symlink policy, case-folding rule) it was minted under, and the enforcement layer must refuse tokens whose profile does not match its own. A token minted under "resolve-before-match" cannot be enforced under "match-before-resolve." Without both, delegated chains degrade into a compliance theater in which every hop looks narrower and the effective authority is unchanged or wider. ```python import ipaddress from dataclasses import dataclass, field from typing import Callable, Iterable from urllib.parse import urlparse class AttenuationNonMonotonicError(RuntimeError): """Raised when a derived AAIF token is not semantically entailed by its parent.""" @dataclass(frozen=True) class Scope: tool: str positive_paths: tuple[str, ...] = () deny_paths: tuple[str, ...] = () hosts: tuple[str, ...] = () attributes: dict[str, object] = field(default_factory=dict) canonicalization_profile: str = "resolve-before-match-v1" def _resolve(path: str, profile: str) -> str: # Placeholder for the shared normalizer. Real AAIF runtimes must pin this # to the same implementation used by the enforcement layer. if profile != "resolve-before-match-v1": raise AttenuationNonMonotonicError( f"unknown canonicalization profile {profile!r}" ) if path.startswith("/data/reports/latest/"): return path.replace("/data/reports/latest/", "/data/secrets/2026/", 1) return path def _matches(path: str, pattern: str, profile: str) -> bool: resolved = _resolve(path, profile) prefix = pattern.rstrip("*").rstrip("/") return resolved == prefix or resolved.startswith(prefix + "/") def _host_matches(host: str, pattern: str) -> bool: if pattern.startswith("*."): return host.endswith(pattern[1:]) return host == pattern def _sample_requests(scope: Scope) -> Iterable[dict]: # The witness generator. It must enumerate the structural signals: # symlink overlap, orphaned attributes, branch collapse. for p in scope.positive_paths: base = p.rstrip("*").rstrip("/") for probe in (f"{base}/keys.json", f"{base}/latest/keys.json"): yield {"tool": scope.tool, "path": probe, "host": None} for h in scope.hosts: yield {"tool": scope.tool, "path": None, "host": h} def _authorizes(scope: Scope, req: dict) -> bool: if req.get("tool") != scope.tool: return False if req.get("path") is not None: if not any(_matches(req["path"], p, scope.canonicalization_profile) for p in scope.positive_paths): return False if any(_matches(req["path"], d, scope.canonicalization_profile) for d in scope.deny_paths): return False if req.get("host") is not None: if not any(_host_matches(req["host"], h) for h in scope.hosts): return False return True def verify_attenuation(parent: Scope, child: Scope) -> None: if child.canonicalization_profile != parent.canonicalization_profile: raise AttenuationNonMonotonicError( "canonicalization profile mismatch between parent and child" ) # Signal 1: orphaned behavioral attribute. Any attribute whose # conditioning predicate is not present in the child is unsafe. parent_attrs = set(parent.attributes) child_attrs = set(child.attributes) orphaned = child_attrs - parent_attrs if orphaned: raise AttenuationNonMonotonicError( f"child carries attributes with no parent conditioning: {sorted(orphaned)}" ) # Signal 2: semantic entailment. Search for a witness request that the # child authorizes and the parent does not. for req in _sample_requests(child): if _authorizes(child, req) and not _authorizes(parent, req): raise AttenuationNonMonotonicError( f"non-monotone derivation: child authorizes {req!r} " f"but parent does not" ) # Signal 3: branch collapse. If the parent had a union over hosts and the # child singleton-izes it while any attribute was branch-conditioned, # the attribute's scope silently widens. if len(parent.hosts) > 1 and len(child.hosts) == 1: for attr, value in parent.attributes.items(): if isinstance(value, dict) and "conditioned_on_host" in value: raise AttenuationNonMonotonicError( f"branch collapse on hosts while attribute {attr!r} " f"was conditioned on a sibling branch" ) def delegate(parent: Scope, child: Scope) -> Scope: verify_attenuation(parent, child) return child if __name__ == "__main__": parent = Scope( tool="filesystem.read", positive_paths=("/data/**",), deny_paths=("/data/secrets/**",), ) child = Scope( tool="filesystem.read", positive_paths=("/data/reports/**",), deny_paths=("/data/secrets/**",), ) try: delegate(parent, child) except AttenuationNonMonotonicError as exc: print(f"attenuation rejected: {exc}") ```