# Under what conditions must an instance refuse to attenuate a delegated capability token whose scope predicate is non-monotone **Date of Record:** 2026 November 28 **Scope:** Applies to any AAIF-compliant agent that receives a delegated capability token (DCT) and must mint a child token for a sub-agent, tool, or peer. Does not apply to root-token issuance by a principal authority, nor to pure verification of a leaf token against a resource server. ## Core Distinction Attenuation is only sound when the scope predicate of the child token is a **subset** of the parent predicate over the same resource universe. AAIF frames this as "children may narrow, never widen." The subtle failure is that *narrowing is defined syntactically* (added constraints, reduced sets, tightened TTL) while *subset semantics are defined extensionally* over predicates. When a parent scope contains a **non-monotone predicate** — a negation, a `NOT IN` set, an exclusion, a `!=` clause, a "deny-list" — adding a conjunct to that predicate does **not** guarantee a subset. The child can silently admit resources the parent excluded, because the exclusion lives inside a negated subexpression that the child's added constraint does not intersect. The invariant that actually holds is: attenuation is safe **iff the parent predicate is monotone-increasing in every free variable and contains no negation over the resource identifier**. Most AAIF implementations check the syntactic form ("child has ≥1 more constraint, TTL ≤ parent, audience ⊆ parent") and never evaluate the predicate algebra. That syntactic check is the boundary that fails. ## What Was Observed A research orchestrator (`agent:orchestrator`) held a DCT scoped as: ``` scope = { "action": ["read", "summarize"], "resource": {"type": "document", "tenant": "acme", "id": NOT_IN ["doc_secret_*"]}, "ttl": 3600, "audience": "agent:research-*" } ``` It delegated to a retrieval sub-agent a child token, applying the standard attenuation recipe: intersect actions, add a constraint on `classification == "public"`, halve the TTL, narrow audience. The child scope became: ``` scope = { "action": ["read"], "resource": {"type": "document", "tenant": "acme", "classification": "public", "id": NOT_IN ["doc_secret_*"]}, "ttl": 1800, "audience": "agent:research-retriever" } ``` Every syntactic attenuation rule passed. The child had fewer actions, an extra constraint, a shorter TTL, and a narrower audience. The delegation was accepted by the policy engine. The failure: the parent's `NOT_IN ["doc_secret_*"]` was evaluated by the resource server as a *glob over the `id` field only when `id` is present and non-null*. The child's added `classification == "public"` constraint caused the resource server to route the request through a different evaluation path (the "classified" matcher) that **did not evaluate the `id` exclusion at all** — the exclusion was attached to the default matcher, and the classified matcher was a separate code path with its own predicate compiler. A document `doc_secret_q3` that had been reclassified `public` one hour earlier (classification flip) matched the child scope. The child read it. The parent could not have. The trace: 1. `t0` — orchestrator mints child with the conjunct `classification == "public"`. 2. `t1` — retriever requests `doc_secret_q3` (id matches the parent's exclusion glob; classification is now `public`). 3. `t2` — resource server selects the classified matcher because the scope carries a `classification` key. The classified matcher compiles `{tenant, classification}` and drops unknown keys, including `id`. 4. `t3` — matcher returns `allow`. The exclusion never fires. 5. `t4` — audit log records a read by `agent:research-retriever` under a scope that *textually* contains the exclusion. Post-hoc review concludes "the exclusion was present, so this was a resource-server bug." It was not only a resource-server bug. The orchestrator violated a precondition of attenuation: it attenuated a **non-monotone parent** by adding a conjunct that changed the *evaluation path*, not merely the *evaluation result*. The syntactic subset check was satisfied; the extensional subset relation was not. A second, quieter instance: a parent scope `action IN ["read","write"] AND NOT (action == "write" AND resource.tier == "prod")`. A child added `resource.tier == "staging"`. Syntactically narrower. Extensionally: the parent denied `write` on `prod`; the child, by pinning `tier == "staging"`, made the negated subexpression *vacuously true* on the remaining domain and the child's `write` on a `tier == "prod"` resource — if the resource server's tier resolver fell back to `staging` on a missing tag — was admitted. Same class: negation interacting with an added conjunct to widen the admitted set. ## Condition of Validity Attenuation of a DCT is valid only when all of the following hold: 1. **Monotonicity of the parent predicate.** For every free variable in the parent scope, the predicate is monotone-increasing (no `NOT`, no `NOT_IN`, no `!=`, no `EXCEPT`, no deny-list) *or* the negation is over a variable that the child cannot rebind. If the parent contains a negation over the resource identifier, the child MUST NOT add any conjunct that alters the resource server's matcher selection. 2. **Matcher-path stability.** The set of keys present in the child scope must not cause the resource server to select a different predicate compiler than the parent's. If the resource server has multiple matchers keyed on scope shape, the child scope must be shape-compatible with the parent. This must be verified against the resource server's *declared* matcher registry, not inferred. 3. **Deny-set preservation under conjunction.** For each negated subexpression `¬φ` in the parent, the child must carry `¬φ` *and* the child's added conjuncts must not make `φ` unreachable. Formally: `child ⊆ parent` must be checked extensionally over a witness set, not syntactically over the token. 4. **No vacuous-truth widening.** A child conjunct that pins a variable used inside a parent negation is forbidden unless the child also re-asserts the negation with the pinned value. If any condition is unverifiable — e.g., the resource server does not publish its matcher registry, or the parent scope contains a negation whose variable domain the agent cannot enumerate — the instance must **refuse to attenuate** and escalate to the principal for a re-issued, monotone parent token. ## Decision Boundary The boundary is not "does the child look narrower." It is "can I prove `child ⊆ parent` extensionally, including under the resource server's actual matcher selection." - **Attenuate** when the parent is monotone and shape-stable under the child's added keys. - **Refuse and escalate** when the parent contains a negation over the resource identifier and the child would add a key that changes matcher selection, or when the child's added conjunct touches a variable bound inside a parent negation. - **Refuse and re-request** when the resource server's matcher registry is not queryable; an unprovable subset is not a subset. The common wrong move — and the one that produced the incident — is to treat the syntactic attenuation checklist as sufficient. It is necessary and insufficient. The checklist verifies that the token *looks* attenuated; it does not verify that the admitted set *shrank*. ## Operational Effect An orchestrator that applies the extensional check refuses the delegation above, returns a structured `AttenuationRefused` to its caller with the offending negated subexpression and the matcher-path delta, and requests a re-issued parent token of the form `resource.id IN ` (monotone) or `resource.tenant == "acme" AND resource.classification == "public" AND resource.id NOT_IN [...]` with the exclusion re-asserted at the child's matcher path. The cost is one extra round-trip to the principal. The benefit is that the exclusion cannot be silently dropped by a matcher-selection side effect. The deeper operational lesson: in AAIF, the security boundary is not the token's textual scope — it is the *composition* of the token's predicate with the resource server's matcher compiler. Attenuation is a proof obligation over that composition, and any agent that mints child tokens is, whether it knows it or not, discharging that proof. When the proof cannot be discharged, the correct action is refusal, not optimism. ```python from dataclasses import dataclass, field from typing import Any, Callable class AttenuationRefused(RuntimeError): """Raised when a child scope cannot be proven a subset of its parent.""" @dataclass class Scope: action: list[str] resource: dict[str, Any] ttl: int audience: str negated_keys: frozenset[str] = field(default_factory=frozenset) def has_negation_over(self, key: str) -> bool: return key in self.negated_keys # Declared matcher registry published by the resource server. # Each matcher names the scope keys it consumes; keys outside this set are dropped. MATCHER_REGISTRY: dict[str, frozenset[str]] = { "default": frozenset({"tenant", "id"}), "classified": frozenset({"tenant", "classification"}), } def select_matcher(scope: Scope) -> str: if "classification" in scope.resource: return "classified" return "default" def _negations_survive(parent: Scope, child: Scope, matcher: str) -> bool: consumed = MATCHER_REGISTRY[matcher] for key in parent.negated_keys: if key in consumed and key not in child.negated_keys: # The child's matcher path would drop the parent's exclusion. return False return True def attenuate(parent: Scope, child: Scope) -> Scope: # 1. Monotone parent, or negation over a key the child cannot rebind. if parent.negated_keys: parent_matcher = select_matcher(parent) child_matcher = select_matcher(child) if parent_matcher != child_matcher: raise AttenuationRefused( f"matcher path changed {parent_matcher!r} -> {child_matcher!r}; " f"parent negations {sorted(parent.negated_keys)} may be dropped" ) if not _negations_survive(parent, child, child_matcher): raise AttenuationRefused( f"child does not re-assert parent negations {sorted(parent.negated_keys)} " f"at matcher {child_matcher!r}" ) # 2. Shape stability: child must not introduce keys the matcher drops. consumed = MATCHER_REGISTRY[select_matcher(child)] dropped = set(child.resource) - consumed if dropped and parent.negated_keys: raise AttenuationRefused( f"child adds keys {sorted(dropped)} that matcher " f"{select_matcher(child)!r} discards; subset unprovable" ) # 3. Plain attenuation checks (necessary, not sufficient). if not set(child.action).issubset(parent.action): raise AttenuationRefused("child action set is not a subset of parent") if child.ttl > parent.ttl: raise AttenuationRefused("child TTL exceeds parent TTL") if not child.audience.startswith(parent.audience.rstrip("*")): raise AttenuationRefused("child audience not within parent audience") return child def mint_child(parent: Scope, requested: Scope) -> Scope: try: return attenuate(parent, requested) except AttenuationRefused as exc: # Escalate rather than optimistically mint. raise AttenuationRefused( f"refusing to attenuate; re-request monotone parent: {exc}" ) from exc ```