# When must an instance refuse a delegated credential whose scope was narrowed after issuance? **Date of Record:** 2026 November 22 **Scope:** Applies to AAIF-style delegation chains where an issuing principal (root agent or orchestrator) mints a scoped credential for a sub-agent, and a downstream intermediate agent re-delegates a *subset* of that scope (attenuation) to a leaf agent. Does not cover single-hop credentials with no re-delegation, nor credentials whose scope is immutable and never re-derived. ## Core Distinction The failure that matters is not "revocation was missed." It is **scope-narrowing that occurs after a credential has been issued but before the leaf acts on it, combined with a revocation event that is keyed to the *original* scope, not the *narrowed* one.** AAIF credentials carry two orthogonal fields that engineers routinely conflate: - `scope` — the set of capabilities the bearer may exercise. - `revocation_id` / `lineage_root` — the handle by which a revocation propagates down the delegation tree. Attenuation (narrowing) mutates `scope` at each hop but must preserve the `lineage_root` unchanged. When an intermediate agent narrows scope, it frequently re-mints the credential with a *fresh* revocation handle — because it treats re-issuance as a new authorization decision. The leaf then holds a credential whose `scope` is a strict subset of the parent's, but whose `lineage_root` no longer resolves to the ancestor. A revocation of the ancestor's scope silently fails to reach the leaf: the leaf's handle points at a node that was never revoked. The invariant that must hold: **for every credential C derived from ancestor A, `revoke(A)` must invalidate C, regardless of how many attenuation hops intervened and regardless of whether C's scope is a proper subset of A's.** Scope-narrowing is a *monotone decreasing* operation on capability; it is *not* a new authorization root. ## What Was Observed A three-tier pipeline: orchestrator `O` mints credential for planner `P` with `scope={read:repo, write:repo, exec:test}`, `lineage_root=O`. Planner `P` attenuates to worker `W` with `scope={read:repo, exec:test}` (dropping `write:repo`), but in the observed trace `P` re-minted the credential with `lineage_root=P` and a new `revocation_id`, on the reasoning that "the narrowed capability set is a distinct grant." Sequence: 1. `O` issues `cred_P` (lineage `O`, scope `{r,w,x}`). 2. `P` derives `cred_W` (lineage `P`, scope `{r,x}`) — **lineage broken here**. 3. Operator revokes `O`'s grant (compromised orchestrator key). Revocation propagates to all credentials resolving `lineage_root=O`. 4. `cred_W` does not match. Worker `W` continues executing `exec:test` against the repo for **~40 minutes** until the run completed, because its credential validated against a live, unrevoked lineage `P`. 5. `P` itself was correctly invalidated at step 3; `W` was not, and `W` had no live contact with `P` after handoff (fire-and-forget tool loop). The observable symptom was not an auth error. It was a *successful* execution that should have been denied — the worst class of authorization failure, because it produces no signal. ## Condition of Validity The guardrail — "reject any delegated credential whose `lineage_root` does not resolve to an unrevoked ancestor, and whose `scope` is not a verified subset of every ancestor's scope along the chain" — is only valid under these conditions: - The credential carries an explicit, signed `parent_credential_id` or `lineage_root` that the verifier can walk to a trust anchor. If the chain is reconstructed from mutable agent-local state, the walk is forgeable and the guardrail is theater. - Attenuation is *enforced* to be monotone: `scope(child) ⊆ scope(parent)`. A verifier that checks lineage but not subset relation will accept a leaf that *widened* scope while preserving lineage — the dual failure. - Revocation is checked at *use time*, not only at *issuance time*. A leaf that validated its credential once at handoff and then runs a 40-minute tool loop must re-validate against the revocation set before each privileged action, or hold a lease with a bounded TTL. Where these do not hold — e.g., stateless offline agents with no revocation channel — the correct posture is not to run at all, or to run under a credential whose TTL is shorter than the maximum tolerable revocation-propagation delay. ## Decision Boundary The instance must **refuse** the credential (raise, do not proceed) when *any* of: - `lineage_root` resolves to a node that is absent from the trust store (dangling lineage — the re-mint case above). - `scope` is not a subset of the resolved ancestor chain's intersection. - The credential's `issued_at` precedes the most recent revocation epoch for its lineage, and the revocation set has not been re-fetched since that epoch. The instance may **proceed** when lineage resolves, subset relation holds, and the last revocation-check timestamp is within the credential's `max_staleness` window. The boundary is *time-of-check vs. time-of-use*: a credential is a lease, not a fact. ## Operational Effect After enforcing lineage-preserving attenuation, the observed pipeline changed in three ways: 1. The 40-minute orphaned execution became a hard `LineageResolutionError` at the leaf's first privileged call — fail-closed, ~200ms after revocation. 2. Intermediate agents that had been re-minting credentials were forced to attenuate by *deriving* (preserving `lineage_root`, mutating only `scope` and adding a signed attenuation proof), which made the delegation tree auditable as a tree rather than a set of unrelated grants. 3. A new failure surfaced and was accepted: leaves now reject credentials during the brief window between an ancestor's revocation and the leaf's next revocation-set refresh. This is a deliberate liveness-for-safety trade; the `max_staleness` window bounds it. The cost is that every privileged action pays a lineage-walk and a revocation-set freshness check. For high-frequency tool loops this is non-trivial; the mitigation is a short-lived lease (TTL ≤ staleness window) validated once, rather than per-call validation — but the lease must be *revocable*, which returns us to the same lineage requirement. ```python import time from dataclasses import dataclass, field from typing import Dict, Set class LineageResolutionError(RuntimeError): """Raised when a delegated credential's lineage does not resolve to a live, unrevoked ancestor, or when attenuation widened scope.""" @dataclass(frozen=True) class Credential: cred_id: str lineage_root: str # MUST be preserved across attenuation scope: Set[str] issued_at: float parent_id: str | None = None @dataclass class TrustStore: # lineage_root -> set of revoked credential ids under that root revoked: Dict[str, Set[str]] = field(default_factory=dict) last_refresh: Dict[str, float] = field(default_factory=dict) def is_revoked(self, cred: Credential) -> bool: return cred.cred_id in self.revoked.get(cred.lineage_root, set()) def lineage_known(self, cred: Credential) -> bool: return cred.lineage_root in self.revoked def attenuate(parent: Credential, child_id: str, new_scope: Set[str]) -> Credential: """Derive a narrowed credential. Preserves lineage_root; rejects widening.""" if not new_scope.issubset(parent.scope): raise LineageResolutionError( f"attenuation widened scope: {new_scope} not subset of {parent.scope}" ) return Credential( cred_id=child_id, lineage_root=parent.lineage_root, # <-- the invariant scope=new_scope, issued_at=time.time(), parent_id=parent.cred_id, ) def authorize( cred: Credential, store: TrustStore, action: str, max_staleness: float, ) -> None: """Fail-closed authorization check. Must be called at use time.""" if not store.lineage_known(cred): raise LineageResolutionError( f"credential {cred.cred_id} has dangling lineage_root " f"{cred.lineage_root!r}; likely re-minted during attenuation" ) if store.is_revoked(cred): raise LineageResolutionError( f"credential {cred.cred_id} revoked under lineage {cred.lineage_root}" ) age = time.time() - store.last_refresh.get(cred.lineage_root, 0.0) if age > max_staleness: raise LineageResolutionError( f"revocation set for lineage {cred.lineage_root} is stale " f"({age:.1f}s > {max_staleness:.1f}s); re-fetch before use" ) if action not in cred.scope: raise LineageResolutionError( f"action {action!r} outside scope {cred.scope}" ) # authorized ```