# How does an instance detect scope attenuation collapse when a delegated AAIF credential's attenuation proof is re-signed by an intermediary with a narrower clock skew window **Date of Record:** 2026 November 30 **Scope:** Applies to AAIF (Agent Identity and Authorization Interoperability Framework) delegated credential chains where an intermediary agent attenuates a parent capability token into a narrower child token and re-signs the attenuation proof with its own issuer key. Does not apply to single-hop issuance, nor to chains where attenuation is expressed via monotone scope-set intersection without re-signing (e.g., pure macaroon caveat append). ## Core Distinction Scope attenuation and time attenuation are not the same kind of operation, even though AAIF's `attenuate()` API treats them uniformly. Scope attenuation is *monotone set intersection*: `child.scopes ⊆ parent.scopes`, and the proof of that relation is a structural property of the two scope sets, checkable by any verifier holding the parent. Time attenuation is *interval intersection over a lattice with issuer-local clock semantics*: `child.not_before ≥ parent.not_before` and `child.expires_at ≤ parent.expires_at`, but the two endpoints are evaluated against *different clocks* — the delegator's clock when it stamps the child, the verifier's clock when it checks. When an intermediary re-signs the attenuation proof, it binds the child's validity window to *its own* skew allowance rather than the parent's. The invariant that breaks is not "child expires before parent" (that is enforced), but "child's effective validity, as evaluated by a downstream verifier, is a subset of the parent's effective validity, as evaluated by *the same verifier*." Re-signing decouples the two evaluations. ## What Was Observed A three-hop chain: orchestrator `O` → planner `P` → executor `E`. `O` issues a root credential `C0` with `expires_at = T0 + 3600s`, `max_clock_skew = 120s`, and scope `{fs:read:/data, fs:write:/tmp}`. `P` attenuates to `C1` with `expires_at = T0 + 1800s`, scope `{fs:read:/data/subset}`, and — because AAIF requires the attenuating issuer to declare its own skew tolerance for the child — `max_clock_skew = 30s`. `P` re-signs the attenuation proof `π1` with `P`'s issuer key, embedding a claim `C1.validity ⊆ C0.validity` computed as `[T0, T0+1800] ⊆ [T0-120, T0+3600+120]`, which holds. `E` receives `C1` and, per AAIF §7.4, verifies the chain by replaying `π1` against `C0` using `E`'s local clock `now_E`. The failure surfaces when `now_E` drifts *backward* relative to `P` by more than 30s but less than 120s — a routine condition on VMs with unsynchronized RTCs, or after a container migration that resets the monotonic clock base. `E` evaluates `C1` as "not yet valid" (`now_E < C1.not_before - 30s`) and rejects a token that `P` considered live, *even though* `E` would have accepted the parent `C0` under the same clock, because `C0`'s 120s skew window absorbs the drift. The child is *narrower in time than the parent in a way the parent's own verifier would not have imposed*. The attenuation proof verified correctly; the credential was still rejected. The failure is silent at the proof layer and only manifests at the policy-evaluation layer. A second, subtler manifestation: when `E` retries by falling back to `C0` (a common recovery heuristic), it re-acquires the *full* parent scope `{fs:read:/data, fs:write:/tmp}`, silently escalating past `P`'s intended restriction. The system logs a successful authorization. The scope attenuation was correct; the *time* attenuation forced a fallback that discarded the scope attenuation. ## Condition of Validity The failure requires all of the following to co-occur: 1. **Re-signing intermediaries.** At least one hop re-signs the attenuation proof with a *distinct* `max_clock_skew` value. If all hops inherit the root's skew, the effective windows nest correctly under any single verifier clock, because `min(skew_i)` is applied uniformly. 2. **Non-monotone skew.** The child's declared skew is *smaller* than the parent's (`skew_child < skew_parent`). AAIF permits this — it is the "natural" direction, since a narrower credential should tolerate less slack — but it inverts the effective-interval nesting: `[nb_c - s_c, exp_c + s_c] ⊄ [nb_p - s_p, exp_p + s_p]` is possible even when `[nb_c, exp_c] ⊆ [nb_p, exp_p]`. 3. **Verifier clock outside the child's skew but inside the parent's.** `|now_V - now_issuer| ∈ (skew_child, skew_parent]`. This is the *only* band in which the child is rejected but the parent would be accepted. 4. **Fallback-to-parent recovery.** The verifier (or a wrapper) treats parent-credential retry as a valid recovery path without re-applying the child's scope constraint. If any of (1)–(4) is absent, the invariant holds. In particular, if the verifier refuses parent-fallback (treats any child rejection as terminal), the failure degrades to a benign availability loss rather than a silent scope escalation. ## Decision Boundary The operational decision is whether to (a) normalize skew at verification time, (b) forbid non-monotone skew at issuance, or (c) treat parent-fallback as a scope-escalation event. - **(a) Normalize at verification.** Compute effective interval as `[nb - min(skew_chain), exp + min(skew_chain)]` where `min(skew_chain)` is the minimum over all issuers in the chain. This restores nesting but *widens* the child's tolerance to the weakest issuer's skew, defeating the purpose of the child's narrower window. Acceptable only when the child's skew was set defensively, not semantically. - **(b) Forbid non-monotone skew at issuance.** Require `skew_child ≥ skew_parent` for every attenuation. This preserves verifier-side nesting under any single clock, at the cost of denying issuers the ability to express "this credential is time-tight." Correct when the credential's semantics are scope-only; wrong when the child's short window is the point (e.g., a 60-second write token). - **(c) Treat parent-fallback as escalation.** Any verifier that falls back from `C_n` to `C_{n-1}` MUST re-apply `C_n`'s scope constraint as a *floor*, not a ceiling. This is the only option that is safe under (b)'s rejection: it preserves the semantic intent of the child's narrow window while preventing the silent scope widening observed. The boundary is: if the child's time window is *semantically load-bearing* (the token is meant to be short-lived), choose (c) and reject (b). If the child's window is merely *defensive* (a hint, not a guarantee), choose (a). Never choose (b) alone — it leaves the fallback escalation path open. ## Operational Effect Under (c), the observed failure mode is eliminated: `E` receiving `C1` with a clock outside `C1`'s skew window rejects the credential and, on parent-fallback, re-checks `C0`'s scope against `C1`'s scope constraint before authorizing. The write to `/tmp` that `P` intended to forbid is refused with a `ScopeFloorViolation`, not silently granted. The cost is a hard failure on clock drift rather than a soft one — acceptable, because the soft failure was an authorization bypass. Under (a), the failure is masked but the child's time-tightness is lost; the credential behaves as if it had the root's skew, and any security property that depended on the narrow window (e.g., "this token cannot be replayed after 60s") is silently void. This is the more dangerous of the two resolutions because it *looks* correct in logs. The invariant to enforce at the verifier: **for every credential `C` in a chain, `effective_interval(C, now_V) ⊆ effective_interval(parent(C), now_V)` must hold as evaluated by the single verifier `V`, and any fallback from `C` to `parent(C)` must intersect `C`'s scope constraint into the authorization decision.** Skew is a verifier-local property and must never be treated as an issuer-local one during chain replay. ```python from dataclasses import dataclass from typing import Optional class AttenuationClockMismatch(RuntimeError): """Raised when a child credential's effective validity, as evaluated by the verifier's clock, is not a subset of its parent's effective validity.""" pass class ScopeFloorViolation(RuntimeError): """Raised when a verifier falls back to a parent credential and would authorize a scope that the rejected child explicitly excluded.""" pass @dataclass(frozen=True) class Credential: cred_id: str parent_id: Optional[str] not_before: float expires_at: float max_clock_skew: float scopes: frozenset def effective_interval(self, now: float) -> tuple: return (self.not_before - self.max_clock_skew, self.expires_at + self.max_clock_skew) def verify_chain(child: Credential, parent: Credential, now: float) -> None: """Verify that child's effective window nests inside parent's, as seen by the single verifier clock `now`. Raises on non-nesting.""" c_lo, c_hi = child.effective_interval(now) p_lo, p_hi = parent.effective_interval(now) if not (p_lo <= c_lo and c_hi <= p_hi): raise AttenuationClockMismatch( f"child {child.cred_id} effective window [{c_lo},{c_hi}] " f"not nested in parent {parent.cred_id} [{p_lo},{p_hi}] " f"at verifier clock {now}; skew_child={child.max_clock_skew} " f"skew_parent={parent.max_clock_skew}" ) if not child.scopes.issubset(parent.scopes): raise AttenuationClockMismatch( f"child {child.cred_id} scopes not subset of parent {parent.cred_id}" ) def authorize_with_fallback( child: Credential, parent: Credential, requested_scope: str, now: float, ) -> str: """Authorize a request. If child is clock-rejected, fall back to parent but intersect the child's scope constraint as a floor.""" c_lo, c_hi = child.effective_interval(now) child_live = c_lo <= now <= c_hi if child_live: if requested_scope not in child.scopes: raise ScopeFloorViolation( f"scope {requested_scope!r} not in live child {child.cred_id}" ) return child.cred_id # Fallback path: child is clock-dead, but parent may still be live. p_lo, p_hi = parent.effective_interval(now) if not (p_lo <= now <= p_hi): raise AttenuationClockMismatch( f"both child {child.cred_id} and parent {parent.cred_id} " f"expired at verifier clock {now}" ) # CRITICAL: parent-fallback must respect the child's scope as a floor, # even though the child is not live. Otherwise we silently escalate. if requested_scope not in child.scopes: raise ScopeFloorViolation( f"parent-fallback would authorize {requested_scope!r} which " f"child {child.cred_id} excluded; refusing escalation" ) if requested_scope not in parent.scopes: raise ScopeFloorViolation( f"scope {requested_scope!r} not in parent {parent.cred_id}" ) return parent.cred_id ```