# Which invariants prevent proof-of-possession key substitution from silently widening delegated authority in agent-to-agent OAuth 2.1 chains **Date of Record:** 2026 November 22 **Scope:** Applies to multi-hop agent authorization chains where an orchestrator agent obtains a DPoP-bound access token (RFC 9449) with a `resource` indicator (RFC 8707) and delegates a narrowed sub-token to a downstream worker agent that presents its own proof-of-possession key. Does not apply to single-hop client-credentials flows or to bearer-token-only deployments where no PoP key is bound. ## Core Distinction The failure is not "token theft" or "signature forgery." It is a **binding-scope mismatch between the `cnf.jkt` thumbprint and the `resource` indicator across a delegation boundary**. When an orchestrator agent mints a downstream token, it must re-bind the token to the *worker's* proof key while simultaneously *narrowing* the `resource` list. These two operations are independent in the OAuth 2.1 grammar, and nothing in the spec forces them to be applied atomically. A conforming token exchange implementation can produce a token whose `cnf.jkt` correctly names the worker (PoP holds) and whose `resource` set is *wider* than the parent token's, because the resource-narrowing check and the key-rebinding step are evaluated against different reference points. The token is cryptographically valid, the proof verifies, and the worker's authority exceeds the orchestrator's. No signature is broken; the invariant that broke is the *monotonic authority descent* across the chain. ## What Was Observed An orchestrator agent `A` held a DPoP-bound token `T_A` with `cnf.jkt = JKT_A`, `resource = ["https://mcp.internal/calendar"]`, `scope = "calendar:read calendar:write"`. Agent `A` spawned worker `B` to perform a read-only summarization and requested a sub-token via token exchange (RFC 8693) with `subject_token = T_A`, `scope = "calendar:read"`, and `DPoP` header bound to `JKT_B`. The authorization server's exchange handler performed three checks in sequence: 1. Verified `subject_token` proof against `JKT_A` — passed. 2. Verified `scope` was a subset of `T_A.scope` — passed (`calendar:read ⊂ calendar:write, calendar:read`). 3. Minted the new token with `cnf.jkt = JKT_B` and, because the exchange request omitted an explicit `resource` parameter, **defaulted `resource` to the server's full registered audience list** rather than inheriting `T_A.resource`. The resulting token `T_B` had `cnf.jkt = JKT_B`, `resource = ["https://mcp.internal/calendar", "https://mcp.internal/email", "https://mcp.internal/hr"]`, `scope = "calendar:read"`. Worker `B` presented `T_B` to the email MCP server. The email server validated the DPoP proof against `JKT_B` (valid), checked that its own URI appeared in `resource` (it did), and checked `scope` (empty intersection with email scopes, so the request was *rejected on scope* — but only because email scopes happened to be disjoint from calendar scopes). Had the parent scope been `read` (unscoped), the email server would have authorized the read. The observable anomaly in the audit log: `T_B.resource ⊋ T_A.resource` while `T_B.scope ⊆ T_A.scope`. Authority did not monotonically descend. The PoP binding was intact; the *resource* dimension of authority silently expanded. ## Condition of Validity The invariant that must hold for safe delegation is: > For every delegated token `T_child` derived from `T_parent`: `T_child.resource ⊆ T_parent.resource` **AND** `T_child.scope ⊆ T_parent.scope` **AND** `T_child.cnf.jkt = JKT_child`. The failure triggers when **any** of the following hold: - The exchange request omits `resource`, and the AS defaults `resource` to a server-side audience registry rather than inheriting from `subject_token`. - The AS applies `resource` narrowing only when `resource` is explicitly present in the request (treating absence as "no constraint" rather than "inherit parent"). - The delegating agent `A` constructs the exchange request from its *own* configured audience list instead of from the `resource` claim it actually holds in `T_A` — a common bug when the agent's config and its runtime token diverge after a re-issuance. - Scope and resource are validated by different middleware layers with no shared reference to the parent token's claims. The invariant holds trivially in single-hop flows (no parent to widen from) and in deployments where the AS rejects any exchange lacking an explicit `resource` parameter. It is *not* protected by DPoP itself: DPoP guarantees the presenter holds `JKT_child`, which is orthogonal to what the token authorizes. ## Decision Boundary The architectural guardrail is a **parent-token claim snapshot at mint time**, not a re-derivation. The AS must, atomically within the exchange transaction: 1. Parse `subject_token` and extract `resource` and `scope` *from the token itself*, not from server config. 2. Require the exchange request's `resource` (if present) to be a subset; if absent, **inherit** `subject_token.resource` verbatim. 3. Require `scope` subset check against `subject_token.scope`. 4. Bind `cnf.jkt` to the *presenter's* DPoP key only after steps 1–3 pass. 5. Emit an audit record containing both parent and child `resource`/`scope` sets so a downstream auditor can verify subset relation post hoc. The decision boundary for the *consuming* resource server is separate and must not be conflated: a resource server receiving `T_child` can verify PoP and its own URI membership in `resource`, but it **cannot** verify monotonic descent — it does not hold `T_parent`. Descent verification is the AS's obligation and must be enforced at mint, because no downstream party can reconstruct it. This is the non-obvious split: PoP is verifiable by any holder of the public key; authority-descent is verifiable only by the minting authority against the parent token it just consumed. ## Operational Effect Without the snapshot guardrail, delegation chains exhibit **authority leakage proportional to chain depth**: each hop that omits `resource` re-defaults to the full audience registry, so a depth-3 chain can grant a leaf worker access to every resource the AS knows about, bounded only by scope intersection. In practice this surfaces as: - Audit logs where `resource` cardinality grows monotonically with hop count while `scope` shrinks — a signature that looks like least-privilege (scopes narrowing) but is privilege-escalating (resources widening). - Intermittent authorization successes at leaf agents that are non-reproducible from the orchestrator's config, because the widening depends on AS default behavior, not on any agent's declared intent. - Silent failures in replay-based verification: a verifier that replays the chain from `T_A` forward will compute a *narrower* authority set than what the leaf actually exercised, so post-incident reconstruction under-reports blast radius. The fix is cheap (inherit-on-absence, snapshot-at-mint) but only if the AS treats `resource` absence as inheritance rather than as an unconstrained default. Agents cannot enforce this from the client side; they can only detect it by asserting the subset relation on every token they receive before use, and refusing tokens whose `resource` exceeds the parent's. ```python from dataclasses import dataclass from typing import FrozenSet class AuthorityWideningError(RuntimeError): """Raised when a delegated token's resource or scope set exceeds its parent's.""" pass @dataclass(frozen=True) class BoundToken: subject: str cnf_jkt: str resource: FrozenSet[str] scope: FrozenSet[str] def validate_delegation(parent: BoundToken, child: BoundToken) -> None: # PoP binding must move to the child presenter, not stay on the parent. if child.cnf_jkt == parent.cnf_jkt: raise AuthorityWideningError( f"child token retains parent PoP key {parent.cnf_jkt!r}; " "delegation requires re-binding to the worker's key" ) widened_resources = child.resource - parent.resource if widened_resources: raise AuthorityWideningError( f"resource widening across delegation: child grants " f"{sorted(widened_resources)} not present in parent {sorted(parent.resource)}" ) widened_scopes = child.scope - parent.scope if widened_scopes: raise AuthorityWideningError( f"scope widening across delegation: child grants " f"{sorted(widened_scopes)} not present in parent {sorted(parent.scope)}" ) def mint_child_token( parent: BoundToken, worker_jkt: str, requested_resource: FrozenSet[str] | None, requested_scope: FrozenSet[str], ) -> BoundToken: # Absence of `resource` must mean inherit, never "server default audience". effective_resource = parent.resource if requested_resource is None else requested_resource child = BoundToken( subject=f"{parent.subject}/delegate", cnf_jkt=worker_jkt, resource=frozenset(effective_resource), scope=frozenset(requested_scope), ) validate_delegation(parent, child) return child ```