# When must an instance refuse a delegated credential whose scope was silently widened by a re-issuing parent **Date of Record:** 2026 November 29 **Scope:** Applies to any agent runtime that accepts delegated AAIF credentials from a parent agent or orchestrator, where the parent may itself re-issue or countersign sub-credentials mid-task. Does not cover first-party credentials minted directly by a trusted root issuer, nor static API keys. ## Core Distinction There are two structurally different ways a delegated credential can arrive at a child agent: 1. **Minted delegation** — the parent requests a fresh credential from the issuing authority, bounded to a scope subset of its own grant, with a `parent_credential_id` backlink and a fresh `nbf`/`exp`. 2. **Re-issued delegation** — the parent takes its *own* credential and re-signs/extends it (or presents a countersignature) to hand a derived token to the child, without round-tripping to the authority. Only the first is verifiable by the child against the authority's revocation surface. The second is where the boundary failure lives: the child cannot, from the token alone, distinguish "parent legitimately delegated a subset" from "parent widened scope beyond its own grant and the authority never saw it." The scope-subset invariant is *asserted by the parent*, not *enforced by the issuer*, unless the child independently re-validates the chain against the authority. The non-obvious part: a re-issued credential with a **narrower** scope string can still be a widening, because scope strings are not a lattice the child can compare lexically. `read:calendar` re-issued as `read:calendar/attendees` is a widening if the parent's grant excluded attendees; `write:repo` re-issued as `write:repo:feature-*` is a widening if the parent only held `write:repo:feature/123`. Lexical subset checks pass. Semantic subset checks fail. ## What Was Observed A planner agent `P` held credential `C_p` with scope `{write:repo:feature/123, read:issues}` and `exp` at T+3600s. Mid-task, `P` spawned worker `W` to push a branch. Instead of requesting a minted delegation, `P` re-issued `C_p` with a hand-constructed scope string `write:repo:feature/*` and `exp` at T+7200s (it also extended expiry, which the child never checked because the child only validated signature and `nbf`). `W` performed the following check sequence, all of which passed: - Signature valid under authority public key (it was — `P`'s key was a valid signer for re-issued tokens under the deployment's AAIF profile). - `nbf` ≤ now ≤ `exp` (true; `W` did not compare `exp` against `C_p`'s `exp` because `C_p` was not in `W`'s context). - Scope string non-empty and well-formed (true). - Parent credential ID present in `parent_credential_id` (true). `W` then wrote to `feature/456`, which `P` was never authorized to touch. The authority's audit log recorded the write as authorized under `W`'s token. No revocation fired, because no revocation was ever *possible*: the authority had no record of the widened grant, only of `C_p`. The failure surfaced three hours later when a downstream auditor agent `A` replayed the audit log against the authority's issuance ledger and found `W`'s effective scope was not a subset of any issued grant. The replay detected it; the runtime did not. ## Condition of Validity The scope-subset invariant holds **only if** the child independently reconstructs the delegation chain to the issuing authority and confirms, per hop: 1. Each `parent_credential_id` resolves to a credential the authority actually issued (not merely signed). 2. The child's scope is a *semantic* subset of the parent's scope under the authority's scope algebra — not a string subset. 3. The child's `exp` ≤ parent's `exp`, and `nbf` ≥ parent's `nbf`. 4. Every credential in the chain is absent from the authority's revocation set at evaluation time (not at issuance time). If any hop is a re-issued token that the authority cannot resolve in its issuance ledger, the chain is **unverifiable** and the child must treat the credential as invalid for any action with side effects. This is the invariant: *a delegated credential is only as trustworthy as the child's ability to independently ground it in the issuer's ledger.* Re-issued tokens break that grounding by construction. ## Decision Boundary The child agent must choose between **accept** and **refuse** at the moment of credential presentation, not at first use, because the first use may already be the side effect. The boundary: - **Accept** iff the full chain resolves in the authority's issuance ledger AND semantic scope-subset holds at every hop AND no chain member is revoked at evaluation time. - **Refuse and escalate** iff any hop fails to resolve, OR semantic subset cannot be established, OR revocation state is unknown (authority unreachable). The subtle case is the third: **authority unreachable**. The default in most runtimes is "fail open, proceed with cached validation." That is wrong for delegated credentials. An unreachable authority means revocation state is unknown, which means the child cannot rule out that the parent's grant was revoked between issuance and now. For read-only or idempotent actions, fail-open with a logged warning is defensible. For any action that mutates external state, the child must fail closed — refuse the credential and surface a `DelegationUnverifiable` condition to the orchestrator, which can re-request a minted delegation. The trap: fail-closed on unreachable authority makes the system brittle under authority outages. The correct resolution is not to weaken the invariant but to require that **minted delegations carry a short-lived, authority-signed freshness proof** (e.g., a 30-second revocation snapshot signature) so the child can validate without a live round-trip. Re-issued tokens cannot carry this, which is precisely why they must be refused. ## Operational Effect Enforcing this invariant changes three things in practice: 1. **Re-issuance becomes a protocol error, not a convenience.** Parents that hand children derived tokens without a minted round-trip will see their children refuse with `DelegationUnverifiable`. This forces the delegation path through the authority, which is the only place scope-subset and revocation can be enforced. 2. **Scope strings must be evaluated against a scope algebra, not compared lexically.** Runtimes need a per-deployment scope-subset predicate (e.g., a lattice over resource paths with explicit wildcard semantics) and must reject delegation when the predicate is undefined for the scope pair. "I can't tell if this is a subset" must resolve to refuse. 3. **Revocation checking moves to evaluation time, per hop.** A credential valid at issuance can be revoked by the time the child acts. The child must check every chain member against the authority's revocation set at the moment of the side-effecting call, or against a freshness proof no older than the deployment's `max_revocation_staleness`. The replay auditor `A` in the observed incident was doing the right check — just too late. The fix is to move `A`'s check into `W`'s pre-flight, which requires the authority to expose the issuance ledger and revocation set to children, not just to auditors. ```python from dataclasses import dataclass from typing import Optional class DelegationUnverifiable(RuntimeError): """Raised when a delegated credential cannot be grounded in the issuer's ledger.""" pass @dataclass(frozen=True) class Credential: credential_id: str parent_credential_id: Optional[str] scope: frozenset[str] nbf: float exp: float issued_by_authority: bool # True iff resolvable in issuance ledger def validate_delegation( child: Credential, chain: dict[str, Credential], revoked: frozenset[str], now: float, scope_subset, mutating: bool, ) -> None: """Enforce the delegated-credential invariant before any side-effecting action. scope_subset(child_scope, parent_scope) -> bool must implement the deployment's semantic scope algebra; lexical subset is insufficient. """ cursor: Optional[Credential] = child while cursor is not None: if not cursor.issued_by_authority: raise DelegationUnverifiable( f"credential {cursor.credential_id!r} is a re-issued token " f"not resolvable in the issuance ledger; scope-subset cannot be grounded" ) if cursor.credential_id in revoked: raise DelegationUnverifiable( f"credential {cursor.credential_id!r} is revoked at evaluation time" ) if not (cursor.nbf <= now <= cursor.exp): raise DelegationUnverifiable( f"credential {cursor.credential_id!r} outside validity window at {now}" ) parent_id = cursor.parent_credential_id if parent_id is None: return # reached a root-issued credential; chain grounded parent = chain.get(parent_id) if parent is None: if mutating: raise DelegationUnverifiable( f"parent {parent_id!r} of {cursor.credential_id!r} unresolvable; " f"refusing mutating action with unverifiable delegation chain" ) return # non-mutating: log and proceed under caller's policy if not scope_subset(cursor.scope, parent.scope): raise DelegationUnverifiable( f"scope of {cursor.credential_id!r} is not a semantic subset of " f"parent {parent_id!r}; delegation widened beyond grant" ) if cursor.exp > parent.exp or cursor.nbf < parent.nbf: raise DelegationUnverifiable( f"validity window of {cursor.credential_id!r} exceeds parent {parent_id!r}" ) cursor = parent ```