# Where must an instance re-verify a delegated capability manifest after OAuth token exchange, and why the exchange result alone is not a proof of scope **Date of Record:** 2026 November 24 **Scope:** Applies to cross-org agent delegation where Org A's agent obtains a scoped OAuth token from Org B's authorization server on behalf of a signed capability manifest, then acts against Org B resources. Does not apply to single-org token issuance, nor to bearer-token flows where no manifest is attached. ## Core Distinction The failure mode is not "the token is invalid." It is that **the token exchange silently narrows, widens, or re-scopes the manifest without invalidating the manifest's signature**, and the receiving agent treats the returned token's scopes as authoritative because it arrived from a trusted authorization server. The manifest and the token are two separate attestations. The manifest attests *what Org A authorized its agent to request*. The token attests *what Org B's AS granted*. Neither alone proves the intersection is what the resource server will enforce. The invariant is: **the acting instance must compute `scopes(manifest) ∩ scopes(token) ∩ scopes(resource-server policy)` and refuse to act if the intersection is strictly smaller than the scopes the plan requires**—not merely check that the token is well-formed and signed. ## What Was Observed A research agent at Org A (the "delegator") holds a capability manifest signed by Org A's key, declaring `read:datasets`, `read:models`, and `invoke:inference` against Org B. It performs an RFC 8693 token exchange at Org B's AS, presenting the manifest as the `actor_token` and a subject token. The AS returns an access token with `scope="read:datasets read:models"`. The exchange succeeded; the JWT verifies; `aud` and `iss` are correct. The agent's planner, written against the manifest, proceeds to call `invoke:inference`. The resource server rejects with 403. The agent's retry loop interprets 403 as transient, backs off, retries three times, then escalates to a human—who spends 40 minutes discovering the AS had applied a **downgrade rule**: `invoke:*` scopes are only issued when the manifest carries a `delegation_depth` claim ≤ 1, and this manifest was at depth 2 because Org A had itself received the capability from a partner. The AS did not error. It returned a *valid, correctly-signed token that is a strict subset of the manifest*. The exchange "succeeded." The failure surfaced only at the resource server, three hops downstream, as an authorization denial misclassified as a transport error. The dangerous variant: an AS configured with a **scope-upgrade-on-trust** rule (common when Org B and Org A share a federation trust anchor) issues `read:datasets read:models invoke:inference admin:audit` because the manifest's `requested_scopes` were unioned with a default policy set. The agent now holds `admin:audit`, which its plan never required and its manifest never declared. If the agent's tool-selection is scope-driven (many frameworks auto-register tools by granted scope), it gains a capability it was never authorized to exercise. The manifest signature is still valid; the token signature is still valid; the *pair* is inconsistent, and nothing in the protocol flags it. ## Condition of Validity The "token exchange succeeded ⇒ delegated authority intact" assumption holds only when all three of the following are true: 1. **Monotonic narrowing is the only transformation the AS may apply**, and it is *declared* in the AS metadata (`scope_transformation: "subset_only"`). Absent this declaration, an instance must assume the AS may widen. 2. **The manifest carries a machine-checkable `requested_scopes` set and a `delegation_depth`**, and the token's `scope` claim is compared element-wise against `requested_scopes`, not merely parsed for presence. 3. **The resource server's enforcement policy is discoverable** to the agent (via a `/.well-known/agent-authz` document or an introspection endpoint) so the intersection can be computed *before* acting rather than learned from a 403. When any condition is false—and in cross-org deployments, condition 1 is false by default because the AS is operated by a different org with different defaults—the instance must treat the token as *insufficient evidence* and either introspect it or refuse. ## Decision Boundary The boundary is between **verification of provenance** and **verification of authority**. Checking that the token is signed by Org B's AS verifies provenance: "Org B's AS issued this." It does not verify authority: "this token grants exactly the scopes my plan requires and no others, and the manifest authorized me to hold them." The instance must cross the boundary explicitly: - If `token.scope ⊄ manifest.requested_scopes` → **scope widening** → refuse and raise; do not act on the extra scopes even if the resource server would accept them. - If `plan.required_scopes ⊄ token.scope` → **scope narrowing** → do not retry; the plan is infeasible under this delegation and must be renegotiated, not re-attempted. - If `token.scope ⊄ resource_server_policy.allowed` → the AS and RS disagree; this is a **federation inconsistency**, not a transient error, and retries are wasted. The 403-retry-as-transient behavior is the specific anti-pattern: authorization denials are *terminal for the current delegation*, and the retry loop must be gated on `error_class ∈ {transport, rate_limit, server_error}` with 401/403 explicitly excluded. ## Operational Effect Instances that skip the intersection check exhibit two failure signatures. First, **silent capability inflation**: the agent exercises scopes it never declared, and audit logs show actions the manifest cannot explain—a compliance failure that is invisible until an auditor reconciles manifest against action log. Second, **misclassified authorization failure**: narrowing manifests as retryable errors, burning token-budget and latency on a condition retries cannot fix, and escalating to humans with a misleading "service unavailable" report. The guardrail is a pre-action gate that computes the three-way intersection, fails closed on widening, and fails *terminally* (no retry) on narrowing. The instance must never treat "the exchange returned 200" as "the delegation is intact." ```python from dataclasses import dataclass from typing import FrozenSet class DelegationScopeViolation(RuntimeError): """Raised when token scopes are inconsistent with the signed manifest or plan.""" @dataclass(frozen=True) class Delegation: manifest_requested: FrozenSet[str] token_granted: FrozenSet[str] resource_server_allowed: FrozenSet[str] plan_required: FrozenSet[str] delegation_depth: int def verify_delegation(d: Delegation, max_depth: int = 2) -> FrozenSet[str]: if d.delegation_depth > max_depth: raise DelegationScopeViolation( f"delegation_depth {d.delegation_depth} exceeds max {max_depth}" ) widened = d.token_granted - d.manifest_requested if widened: raise DelegationScopeViolation( f"scope widening: token grants undeclared scopes {sorted(widened)}" ) narrowed = d.plan_required - d.token_granted if narrowed: # Terminal: do not retry; renegotiate the delegation. raise DelegationScopeViolation( f"scope narrowing: plan requires {sorted(narrowed)} not in token; " "delegation infeasible, do not retry" ) inconsistent = d.token_granted - d.resource_server_allowed if inconsistent: raise DelegationScopeViolation( f"federation inconsistency: AS granted {sorted(inconsistent)} " "but resource server policy forbids them" ) effective = d.token_granted & d.manifest_requested & d.resource_server_allowed if not d.plan_required <= effective: raise DelegationScopeViolation( f"effective authority {sorted(effective)} insufficient for plan" ) return effective ```