# Under what conditions must an instance re-derive delegated authority when a verifiable credential's scope set is transitively widened by an intermediate agent **Date of Record:** 2026 November 20 **Scope:** Applies to multi-hop agent delegation chains (A→B→C) where authority is carried as verifiable credentials (VCs) with OAuth scope attenuation, and an intermediate agent may re-issue or co-sign a downstream credential. Does not apply to single-hop delegation, to opaque bearer tokens with no verifiable scope set, or to authorization decisions made entirely server-side by a policy engine that re-evaluates the principal on every call. ## Core Distinction The failure is not "an agent exceeded its scope." It is the narrower and more dangerous case where **every individual hop in a delegation chain is individually valid and individually attenuated, yet the composed chain grants authority no single issuer ever held.** This is a transitive-widening defect: scope intersection is associative only if each hop intersects against the *effective* scope of its parent, not against the parent's *declared* scope. When an intermediate agent B holds `{read, summarize}` but re-issues a sub-credential to C asserting `{read, summarize, export}`, B's signature verifies, B's credential is unexpired, and C's credential chains cleanly to the root — and the chain is still invalid, because `export` was never in B's effective set. Naive verifiers that check (a) signature validity per hop and (b) expiry per hop, but do not recompute the running intersection across the chain, will accept the credential. The invariant is: **effective authority = fold(intersect, root_scope, scope_1, …, scope_n)**, and no hop may declare a scope outside the running fold of its ancestors. ## What Was Observed A three-agent pipeline: orchestrator A (root, holds `{read, summarize, export}`), a retrieval-specialist B delegated `{read, summarize}`, and a report-writer C delegated by B. B's implementation constructed C's credential by merging its *own credential's declared scope claim* with a static capability manifest it had cached from a prior deployment — the manifest still listed `export` because B's config predated a scope-down patch. B signed C's credential with `{read, summarize, export}`. C, holding a credential that asserted `export`, called the export endpoint. The endpoint's verifier walked the chain, validated three signatures, checked three expiries, confirmed the root A was trusted, and admitted the call. No agent lied; no signature was forged; the export succeeded against a principal (B) that had never been granted export. The tell was in the audit log: the *issuer* of the exporting credential was B, but B's *own* credential from A carried scope `{read, summarize}`. The widening was visible only by comparing a credential against its issuer's credential — a comparison no single-hop verifier performs because it only looks at the credential in front of it. A second, subtler variant appeared under credential refresh. When B's credential from A was re-issued with a narrowed scope mid-session (A dropped `summarize` after a policy change), C's already-issued credential retained `summarize`. C's credential remained signature-valid and unexpired; only a re-fold against B's *current* credential would have caught that C now exceeded B. Because C's credential had a longer TTL than B's, the chain stayed "valid" for hours after the authority beneath it had been revoked. ## Condition of Validity The fold invariant holds only under three conditions, and each is a place where the check silently degrades: 1. **The verifier must have access to the issuer's credential, not just the leaf.** If the chain is presented as a bare list of credentials without an issuer-pointer (each credential names its issuer's key ID but does not embed or reference the issuer's credential), the verifier cannot fold. It can only check signatures. Requiring each credential to carry a `parent_hash` referencing the exact credential it was derived from forces the fold to be computable and makes refresh-narrowing detectable. 2. **Scope comparison must be set-intersection over a normalized vocabulary, not string equality.** `read:documents` and `read:*` and `documents.read` are the same authority under different encodings. A fold that compares raw strings will treat a re-encoded narrower scope as wider (false rejection) or a re-encoded wider scope as distinct (false acceptance). Normalize to a canonical resource:action tuple before intersecting. 3. **The fold must be recomputed at verification time, against current ancestor credentials, not against a cached fold at issuance time.** This is the refresh-narrowing case. A verifier that trusts a `composed_scope` field baked into the leaf credential at issuance is trusting the issuer's arithmetic at a moment that may no longer reflect the ancestors' current state. The leaf's asserted scope is a *claim*; the fold is the *proof*. ## Decision Boundary The operational question is when to re-derive versus when to trust a cached composition. Re-derive authority from the full chain whenever any of the following holds: - The leaf credential's issuer is not the root (i.e., chain depth ≥ 2). Single-hop delegation can be verified by direct comparison against the root's scope; multi-hop cannot. - Any ancestor credential's `not_after` is earlier than the leaf's `not_after`. A leaf that outlives its parent is a widening window by construction. - Any ancestor credential carries a `revocation_epoch` or version field that postdates the leaf's issuance timestamp. - The scope vocabulary has changed encoding since the leaf was issued (detectable via a `vocab_version` claim). Do **not** re-derive when the leaf is issued directly by the root and the root's scope is unchanged since issuance — the fold is trivially the root's scope and recomputation adds latency without information. The failure mode of over-eager re-derivation is latency and availability: a verifier that demands the full ancestor chain on every call will reject valid leaves whenever an intermediate credential has been pruned from storage. The resolution is to require the chain to be *presented* with the leaf (the caller carries its own proof-of-authority), so re-derivation is a local computation over supplied material rather than a network walk. ## Operational Effect The practical consequence is that **credential validity is not a property of a credential; it is a property of a chain evaluated at a point in time.** Any component that caches "this credential is valid" as a boolean, or that treats signature-and-expiry as sufficient, will admit transitively-widened authority. The guardrail is a verifier that (1) requires `parent_hash` linkage, (2) normalizes scopes to canonical tuples, (3) folds intersection from root to leaf, and (4) re-folds against current ancestor state when any ancestor is narrower-lived or newer than the leaf. The export that "succeeded" in the observed case would have failed at step 3: `{read, summarize, export} ∩ {read, summarize} = {read, summarize}`, and `export ∉ {read, summarize}`. ```python from dataclasses import dataclass, field from typing import FrozenSet, Optional, Dict class TransitiveScopeWideningError(RuntimeError): """Raised when a delegated credential asserts authority outside the running intersection of its ancestors' effective scopes.""" pass @dataclass(frozen=True) class Credential: subject: str issuer: str scopes: FrozenSet[str] # canonical resource:action tuples not_after: float issued_at: float parent_hash: Optional[str] # hash of the exact parent credential cred_hash: str def _canonical(scopes) -> FrozenSet[str]: # Normalize encodings to resource:action before any set operation. out = set() for s in scopes: if s.startswith("read:*"): out.add("read:all") elif "." in s and ":" not in s: res, act = s.split(".", 1) out.add(f"{act}:{res}") else: out.add(s) return frozenset(out) def verify_chain( leaf: Credential, by_hash: Dict[str, Credential], now: float, vocab_version: int = 1, ) -> FrozenSet[str]: """Fold scope intersection from root to leaf. Returns effective authority.""" chain = [] cur: Optional[Credential] = leaf seen = set() while cur is not None: if cur.cred_hash in seen: raise TransitiveScopeWideningError(f"cycle at {cur.cred_hash}") seen.add(cur.cred_hash) chain.append(cur) if cur.parent_hash is None: break parent = by_hash.get(cur.parent_hash) if parent is None: raise TransitiveScopeWideningError( f"missing parent {cur.parent_hash} for {cur.cred_hash}; " "cannot fold, chain unverifiable" ) cur = parent chain.reverse() # root first root = chain[0] effective = _canonical(root.scopes) for cred in chain[1:]: declared = _canonical(cred.scopes) # The widening check: a hop may only narrow, never extend. widened = declared - effective if widened: raise TransitiveScopeWideningError( f"credential {cred.cred_hash} (issuer {cred.issuer}) asserts " f"{sorted(widened)} outside ancestor effective scope " f"{sorted(effective)}" ) # Refresh-narrowing: a leaf that outlives an ancestor is suspect. if cred.not_after > max(c.not_after for c in chain[: chain.index(cred)]): raise TransitiveScopeWideningError( f"credential {cred.cred_hash} outlives its parent; " "re-fold required against current ancestor state" ) effective = effective & declared return effective def authorize(leaf: Credential, by_hash: Dict[str, Credential], requested: str, now: float) -> None: effective = verify_chain(leaf, by_hash, now) if _canonical({requested}) - effective: raise TransitiveScopeWideningError( f"requested {requested!r} not in effective authority {sorted(effective)}" ) ```