# What structural signals indicate a scoped-capability attestation has silently degraded during cross-agent OAuth token exchange **Date of Record:** 2026 November 28 **Scope:** Applies to autonomous agents that obtain delegated credentials via OAuth 2.0 token exchange (RFC 8693) and propagate scoped capability attestations to downstream peer agents. Does not apply to single-agent, single-hop authorization where the token consumer is also the token originator. ## Core Distinction The failure we care about is not token *rejection*. Rejection is loud: the resource server returns 401/403, the agent escalates, the trace shows a clean stop. The failure that matters operationally is **silent scope widening via attestation re-signing**. A downstream agent receives a delegated token whose `scope` claim is correct, but whose *attestation envelope* (the signed statement binding scope to the acting agent's identity and the original grantor's intent) has been re-issued by an intermediary that normalized, merged, or re-derived the scope set. The token still validates. The signature still verifies. The scope string still parses. But the binding between "who was authorized to do what" and "who is now doing it" has been severed, and the receiving agent has no structural signal that its authority is now broader or differently-anchored than the grantor intended. The distinction is between **cryptographic validity** and **attestation fidelity**. OAuth token exchange preserves the former by construction; it does not preserve the latter unless the exchange is explicitly designed to. ## What Was Observed A three-hop chain: orchestrator agent `A` (holding a user-delegated grant with scope `repo:read repo:write issue:comment`) exchanges a token for worker agent `B` via RFC 8693 `grant_type=urn:ietf:params:oauth:grant-type:token-exchange`, requesting a *narrowed* scope `repo:read issue:comment`. `B` then exchanges for auditor agent `C`, requesting `issue:comment`. At hop 2, the authorization server's scope-narrowing logic operated on the *requested* scope intersection but re-derived the attestation envelope from the AS's own canonical scope vocabulary. The AS's vocabulary treated `repo:read` and `repo:write` as a single hierarchical family `repo:*` and, because the narrowing request was expressed as a delta rather than an absolute set, emitted an attestation whose `authorized_scope_family` claim was `repo:*`. The `scope` claim on the access token was correctly `repo:read`. The two disagreed. Agent `C`, receiving the hop-2 token, validated the JWT signature, checked `aud`, checked `exp`, and read `scope=issue:comment`. It never inspected `authorized_scope_family`, because that claim was not part of the OAuth spec and the agent's validation library ignored unknown claims. `C` then made a call that required `repo:write` — not because it was malicious, but because a tool schema it had cached from a prior session advertised a write path and `C`'s planner selected it. The resource server, which *did* consult `authorized_scope_family` as part of its policy engine, allowed the call. The effective authority of `C` was `repo:*`, not `issue:comment`. Three agents, three valid tokens, one silent widening. The structural signal that was present but unread: **claim-set divergence between the token's `scope` claim and the attestation's scope-family claim**. This divergence is the fingerprint of re-signing. It is detectable at every hop, and it is the invariant the receiving agent must enforce. ## Condition of Validity The invariant holds — and the guardrail is meaningful — only under these conditions: 1. **The attestation envelope is a distinct, signed artifact from the access token**, and the receiving agent is expected to validate both. If the AS collapses attestation into the token (e.g., a single `scope` claim), there is no divergence to detect and the guardrail is vacuous. This is the common case and the reason the failure is non-obvious: most deployments have already eliminated the signal. 2. **Scope vocabulary is hierarchical or overlapping** (`repo:read`/`repo:write` under `repo:*`, or `files:read`/`files:list` under `files:*`). Flat, disjoint scopes cannot widen through family re-derivation. The failure requires a vocabulary where "narrowing" is not a set operation but a lattice operation, and where the AS and the requesting agent may disagree on the lattice. 3. **The exchange is a delta-narrowing request, not an absolute-scope request.** RFC 8693 permits both. Delta requests (`scope=repo:read issue:comment` interpreted as "remove everything else from parent") force the AS to reconstruct the full authorized set, and reconstruction is where vocabulary drift enters. 4. **At least one hop is performed by an intermediary that is not the original grantor.** A single-hop exchange from the grantor's own AS has no re-derivation step. When any of these conditions fails, the divergence check is either unnecessary or impossible, and the correct posture is to fall back to absolute-scope requests and reject any token whose attestation is not byte-identical to the grantor's. ## Decision Boundary The receiving agent must decide, at token-acceptance time, whether the attestation it holds is *faithful* to the grantor's intent or merely *valid*. The boundary is drawn on three checks, in order: - **Claim-set equality check:** the set of scope families implied by the token's `scope` claim must equal the set implied by the attestation's `authorized_scope_family` claim. If the token's set is a strict subset, that is normal narrowing and acceptable *only if* the attestation's family set is also a subset of the parent's family set. If the token's set is a subset but the attestation's family set is *equal to or broader than* the parent's, the attestation has been re-derived and must be rejected. - **Signer-chain check:** the attestation must be signed by a key in the chain rooted at the original grantor's AS, and the chain must not include the exchanging intermediary as a re-signer unless that intermediary is explicitly delegated attestation authority. An intermediary that re-signs with its own key is a normalization point and must be treated as an authority boundary, not a pass-through. - **Parent-reference check:** the attestation must carry a `parent_attestation_hash` that matches the hash of the attestation the grantor issued. A missing or mismatched parent hash means the chain of intent is broken; the token is valid but unattested, and the agent must treat it as having the *intersection* of its own baseline scope and the requested scope, never the requested scope alone. If all three pass, accept. If any fails, the agent must not silently narrow to a "safe" scope — silent narrowing masks the failure and lets the next hop repeat it. It must fail closed and emit a structured divergence record. ## Operational Effect The practical consequence of missing this boundary is that **authority becomes non-monotonic across the agent graph**. Each hop believes it has narrowed; the aggregate effect is widening. Auditing becomes impossible because every individual token is valid and every individual agent acted within the scope *it* read. The failure is only visible at the graph level, and only if divergence records were emitted at each hop. When the guardrail is in place, the operational cost is a small number of false rejections during vocabulary migrations (when the AS legitimately changes its scope lattice) and a requirement that every intermediary either pass attestations through unmodified or be explicitly registered as an attestation authority. The benefit is that scope narrowing is *provable* at each hop rather than *asserted* by the AS, and that a compromised or buggy intermediary cannot widen authority without breaking the parent-hash chain. The signal to watch for in production is a rising rate of `claim-set divergence` events at a specific hop, correlated with a change in the AS's scope vocabulary or a new intermediary joining the exchange path. That correlation is the structural indicator that attestation fidelity has degraded, and it appears before any unauthorized action does. ```python import hashlib from dataclasses import dataclass class AttestationDivergenceError(RuntimeError): """Raised when a delegated token's attestation is valid but unfaithful to the grantor's intent.""" @dataclass(frozen=True) class Attestation: scope_families: frozenset[str] signer_chain: tuple[str, ...] parent_attestation_hash: str | None @dataclass(frozen=True) class DelegatedToken: scope: frozenset[str] attestation: Attestation def _family_of(scope: str) -> str: # 'repo:read' -> 'repo:*'; flat scopes map to themselves return scope.split(":", 1)[0] + ":*" if ":" in scope else scope def _hash(att: Attestation) -> str: payload = "|".join(sorted(att.scope_families)) + "::" + ">".join(att.signer_chain) return hashlib.sha256(payload.encode()).hexdigest() def validate_delegated_token( token: DelegatedToken, parent: Attestation, trusted_attestation_authorities: frozenset[str], ) -> None: att = token.attestation token_families = frozenset(_family_of(s) for s in token.scope) if token_families != att.scope_families: raise AttestationDivergenceError( f"claim-set divergence: token implies {sorted(token_families)}, " f"attestation asserts {sorted(att.scope_families)}" ) if att.scope_families - parent.scope_families: raise AttestationDivergenceError( f"attestation widened beyond parent: {sorted(att.scope_families - parent.scope_families)}" ) for signer in att.signer_chain[1:]: if signer not in trusted_attestation_authorities: raise AttestationDivergenceError( f"untrusted re-signer in chain: {signer}" ) if att.parent_attestation_hash != _hash(parent): raise AttestationDivergenceError( "parent attestation hash mismatch: chain of intent broken" ) ```