# When must an instance refuse a delegated credential whose scope chain has silently widened **Date of Record:** 2026 November 23 **Scope:** Applies to agents that receive authority via AAIF delegated credential chains (root principal → intermediate agent → worker instance) using scoped ephemeral tokens with attenuation semantics. Does not apply to single-hop API keys or to opaque bearer tokens without a scope chain, where the failure mode described here cannot be expressed. ## Core Distinction There are two ways a delegated token can grant more authority than the delegator intended, and only one of them is visible at the wire. The visible failure is **scope non-attenuation**: an intermediate agent mints a child token whose scope set is not a subset of its own. A conforming verifier catches this by set-inclusion check at issuance and rejects the token. This is a well-understood check and most AAIF implementations perform it. The non-obvious failure is **scope reinterpretation across chain hops**. The scope string is preserved byte-for-byte, the subset check passes, and yet the effective authority expands because the *semantics* of a scope atom are resolved at the leaf verifier, not at the root principal. A scope atom like `fs:read:/data/*` means one thing to the resource server that issued it and a different thing to a downstream resource server that matches the same atom against a different path-normalization rule, a different wildcard grammar, or a different tenant namespace. The chain is syntactically attenuated and semantically amplified. The invariant that must hold is not `scope(child) ⊆ scope(parent)` but `resolve_v(scope(child)) ⊆ resolve_v(scope(parent))` for every verifier `v` that will ever see the token — and the leaf agent is typically the only party positioned to evaluate `resolve_v`, because it is the only party that knows which `v` it is about to call. ## What Was Observed An intermediate orchestrator agent held a root-issued ephemeral token with scope `{fs:read:/tenant/acme/*, fs:write:/tenant/acme/scratch/*}` and a TTL of 900s. It delegated to a worker instance a child token with scope `{fs:read:/tenant/acme/*}` — a strict subset, TTL 300s, correctly signed, correctly chained. The subset check at the orchestrator passed. The worker's local pre-flight check passed. The worker then called a storage resource server whose path-normalization rule collapses `..` segments *after* wildcard expansion. The worker requested `/tenant/acme/../beta/secrets`. Under the worker's own resolver, the glob `*` does not cross `/`, so `/tenant/acme/../beta/secrets` matches `fs:read:/tenant/acme/*` on the literal prefix and is permitted. The resource server, however, normalizes the path to `/tenant/beta/secrets` before authorization and then evaluates the scope against the normalized path — which *also* matches, because the server's matcher treats `*` as a recursive wildcard. Both parties believed the request was in scope; neither party's belief was wrong relative to its own resolver; the request crossed a tenant boundary. The trace is: 1. Orchestrator mints child token. Subset check on raw scope strings: pass. 2. Worker pre-flight: `match('/tenant/acme/../beta/secrets', 'fs:read:/tenant/acme/*')` under worker grammar → true. 3. Request sent. Resource server normalizes to `/tenant/beta/secrets`. 4. Server authorization: `match('/tenant/beta/secrets', 'fs:read:/tenant/acme/*')` under server grammar → true (recursive `*`). 5. Data returned across tenant boundary. No error raised at any hop. The failure is not a signature failure, not a TTL failure, and not a subset failure. It is a **resolver disagreement** that the chain protocol has no field to express. The token carries the scope atom; it does not carry the resolver identity, the normalization regime, or the grammar version under which the atom was minted. ## Condition of Validity The subset invariant `scope(child) ⊆ scope(parent)` is sound only under the assumption that all verifiers in the chain resolve scope atoms under a single shared grammar and normalization regime. Formally, the chain is safe iff for the set `V` of verifiers reachable by the leaf, `resolve_v` is identical across all `v ∈ V` on the paths the leaf can construct. This condition fails whenever any of the following holds: - The leaf can synthesize a path or resource identifier that is a fixed point of one resolver and a non-fixed point of another (path traversal, Unicode normalization, case folding, percent-encoding, trailing-dot handling, symlink resolution). - The scope atom grammar contains a wildcard whose expansion rule is not pinned to a version in the token. - Two resource servers in the same chain are operated by different principals with different matching implementations but accept the same scope atom namespace. - The token's audience field is broader than the set of verifiers that share a grammar. The invariant that actually holds is narrower and must be stated explicitly: **a delegated token is safe to present to verifier `v` only if the leaf can prove that `v`'s resolver agrees with the resolver under which the scope atom was minted, on every identifier the leaf will construct.** When the leaf cannot prove this, the token is not merely risky — it is unverifiable, and unverifiable authority must be treated as absent. ## Decision Boundary The leaf instance must refuse to present a delegated credential when the following predicate evaluates false: ``` safe_to_present(token, v) := v.grammar_id == token.scope_grammar_id AND v.normalization == token.scope_normalization AND v.tenant_namespace ∈ token.audience AND normalize_v(candidate_path) == candidate_path # leaf's path is a fixed point of v ``` The last conjunct is the one that is routinely omitted and the one that catches the observed failure. If the leaf's candidate identifier is not a fixed point of the verifier's normalizer, then the leaf's own `match` result is not predictive of the verifier's, and the leaf is presenting authority it cannot bound. The correct action is to refuse, not to re-check locally and proceed on the strength of the local check. Two corollaries bound the decision: - **Refusal is not retryable against the same verifier.** The mismatch is structural, not transient. Retrying with a re-minted token from the same orchestrator reproduces the same resolver disagreement. - **Escalation must go to the minting principal, not the verifier.** The verifier cannot widen its grammar to accommodate the token without violating its own tenant boundary; the principal must re-mint with a grammar-pinned, normalization-pinned scope atom, or narrow the audience to verifiers that share the minting grammar. ## Operational Effect When the leaf enforces `safe_to_present`, the observed failure converts from a silent cross-tenant read into a hard refusal at the leaf, before any request leaves the instance. The operational cost is a class of false refusals: legitimate requests against verifiers whose grammar is compatible-but-not-identical will be rejected until the token carries explicit grammar and normalization pins. This is the correct trade — a false refusal is a bounded availability cost localized to one delegation path, while a false permit is an unbounded confidentiality breach that the chain has no mechanism to detect after the fact. The architectural guardrail is to make the resolver identity part of the credential, not part of the ambient configuration. A scope atom without a grammar pin and a normalization pin is not a scope; it is a string that different parties will interpret differently, and a chain built from such strings is attenuated in syntax and unattenuated in semantics. The instance that recognizes this and refuses is not being conservative — it is the only hop in the chain that can see the disagreement, and therefore the only hop that can bound it. ```python import unicodedata from dataclasses import dataclass from typing import FrozenSet class ResolverDisagreement(RuntimeError): """Raised when a delegated token's scope cannot be bounded at the leaf verifier.""" pass @dataclass(frozen=True) class ScopePin: grammar_id: str normalization: str # e.g. "nfc", "nfd", "none" audience: FrozenSet[str] @dataclass(frozen=True) class DelegatedToken: scope_atom: str pin: ScopePin ttl_seconds: int @dataclass(frozen=True) class Verifier: grammar_id: str normalization: str tenant_namespace: str def normalize(self, path: str) -> str: # Collapse ".." segments and apply Unicode normalization. parts = [] for seg in path.split("/"): if seg == "..": if parts: parts.pop() elif seg and seg != ".": parts.append(seg) joined = "/" + "/".join(parts) if self.normalization == "nfc": return unicodedata.normalize("NFC", joined) if self.normalization == "nfd": return unicodedata.normalize("NFD", joined) return joined def safe_to_present(token: DelegatedToken, verifier: Verifier, candidate_path: str) -> bool: if token.ttl_seconds <= 0: return False if verifier.grammar_id != token.pin.grammar_id: return False if verifier.normalization != token.pin.normalization: return False if verifier.tenant_namespace not in token.pin.audience: return False # The leaf's candidate must be a fixed point of the verifier's normalizer. if verifier.normalize(candidate_path) != candidate_path: return False return True def present_credential(token: DelegatedToken, verifier: Verifier, candidate_path: str) -> str: if not safe_to_present(token, verifier, candidate_path): raise ResolverDisagreement( f"refusing to present token scope={token.scope_atom!r} to verifier " f"grammar={verifier.grammar_id!r} norm={verifier.normalization!r} " f"for path={candidate_path!r}: resolver identity not pinned or path " f"not a fixed point of verifier normalizer" ) return verifier.normalize(candidate_path) # Observed failure reproduction: tok = DelegatedToken( scope_atom="fs:read:/tenant/acme/*", pin=ScopePin(grammar_id="aaif-glob-v2", normalization="nfc", audience=frozenset({"storage"})), ttl_seconds=300, ) ver = Verifier(grammar_id="aaif-glob-v2", normalization="nfc", tenant_namespace="storage") # This call refuses instead of silently crossing the tenant boundary. present_credential(tok, ver, "/tenant/acme/../beta/secrets") ```