# Why does an instance lose delegated scope when an AAIF credential is re-attested across vendors mid-task? **Date of Record:** 2026 November 30 **Scope:** Applies to multi-agent systems where an orchestrator delegates a scoped, time-bounded credential to a sub-agent, and that sub-agent crosses a vendor/organizational attestation boundary (re-signs, re-issues, or re-presents its identity) while holding live task state. Does not cover single-vendor intra-cluster token refresh, nor static OAuth client-credentials flows where the subject never changes. ## Core Distinction A delegated scoped credential is not a bearer token that carries *permissions*; it is a signed *claim chain* that binds a subject instance, a scope set, a delegation depth, and an expiry to a specific attestation authority. The distinction that matters operationally is between **re-attestation** (the same principal re-proves identity to a new authority) and **re-issuance** (a new credential is minted by a new authority). Cross-vendor handoff almost always performs re-issuance while the calling code believes it performed re-attestation. The delegated scope is not "carried over" — it is silently truncated to whatever the new authority can independently justify from its own trust root, which for a foreign subject is typically the *default* scope, not the *delegated* scope. The failure is invisible because the new credential validates cleanly and the sub-agent's tool calls succeed — against the wrong scope. ## What Was Observed An orchestrator (vendor A) issued a sub-agent a delegated credential with scope `{read:repo, write:pr_draft, read:ci_logs}` and delegation depth 2, expiry T+900s, bound to subject instance `agent-7f3a`. The sub-agent was handed off to a peer auditor (vendor B) for a verification step. Vendor B's attestation gateway, unable to validate vendor A's signing root under its own policy, performed a re-issuance: it minted a fresh credential for `agent-7f3a` anchored to B's trust root. Three things happened that the orchestrator did not observe: 1. **Scope defaulted.** B's policy had no mapping for `write:pr_draft` (a foreign verb), so the re-issued credential carried `{read:repo, read:ci_logs}` plus B's default `read:public`. The `write:pr_draft` scope was dropped, not denied — it simply did not exist in the new claim set. 2. **Delegation depth reset to 0.** B treated the re-issued credential as a root credential for that subject, because it had no parent claim to chain to. The sub-agent could no longer delegate to a third verifier; a downstream `delegate()` call failed with a depth-exhausted error that the orchestrator attributed to a transient. 3. **Subject binding drifted.** B's attestation used a freshly generated instance nonce, not the original `agent-7f3a` binding. The sub-agent's local state (task checkpoint, tool-call ledger) was keyed to the *old* binding. On resume, the ledger replay found no matching subject and the agent re-executed the last three tool calls idempotently — but one of them was a `write:pr_draft` that had already partially applied, producing a duplicate draft branch. The re-issued credential was cryptographically valid throughout. Every individual tool call returned 200. The corruption was in the *scope set* and *subject binding*, both of which the agent's reasoning layer treated as invariant across the handoff. ## Condition of Validity The invariant that must hold for a delegated credential to survive a cross-vendor handoff is: > For every scope `s` in the delegated claim set, the receiving authority must either (a) validate the originating authority's signature chain and preserve `s` verbatim, or (b) explicitly reject the handoff. Any path that mints a new credential without a per-scope mapping from the parent claim set to the child claim set is a scope-truncation event, regardless of whether the new credential validates. This invariant fails whenever the receiving authority's trust policy is *closed* (does not chain to the origin) but its issuance path is *permissive* (mints a default credential rather than refusing). The common trigger: vendor B's gateway has a "best-effort identity resolution" fallback that issues a scoped-down credential instead of returning 403. That fallback is correct for a first-contact agent with no prior claims; it is catastrophic for a delegated agent mid-task, because it converts an authorization failure into a silent capability downgrade that the caller cannot detect from the credential's validity alone. The invariant also requires subject-binding stability: the receiving credential must carry the *same* instance nonce as the parent, or the agent's local state ledger must be re-keyed atomically with the credential swap. Re-issuance that generates a fresh nonce without re-keying the ledger produces the replay-duplication failure above. ## Decision Boundary The boundary is between **fail-closed re-attestation** and **fail-open re-issuance**. The decision rule: - If the receiving authority cannot validate the origin's chain, it MUST reject the handoff and return the delegation to the orchestrator with an explicit `scope_unverifiable` signal. It MUST NOT mint a substitute credential. - If the receiving authority *can* validate the chain, it MUST preserve the scope set, delegation depth, and subject nonce verbatim, and only append (never subtract) its own trust-root scopes. - The sub-agent MUST treat any credential whose `issuer` differs from the credential it was delegated as a *new principal*, and MUST re-validate its local task state against the new subject binding before resuming. A credential swap is a state-continuity event, not a transport event. The trap is that fail-open re-issuance *looks* like graceful degradation. It is not. It is a silent scope truncation that the agent's reasoning layer will rationalize as "the tool call succeeded, so my scope is intact." The only reliable detector is a pre-flight scope-set diff: the agent must compare the delegated claim set against the presented claim set and abort if any delegated scope is absent, even if the presented credential is valid. ## Operational Effect The observable effect is a class of failures that present as *task-level* anomalies rather than *auth* anomalies: duplicate side effects from subject-binding drift, depth-exhaustion errors on downstream delegation that appear transient, and tool calls that succeed against a scope the agent never held (the receiving authority's default scope), producing writes the orchestrator's policy would have blocked. Because each individual call is 200-OK and each credential validates, standard observability (auth error rates, 4xx counts) shows nothing. The corruption only surfaces at the task boundary, when the orchestrator reconciles the sub-agent's output against its own scope expectations and finds work performed outside the delegated envelope. The guardrail is a **scope-set continuity check** enforced at the agent's handoff boundary: before any cross-vendor call, snapshot the delegated claim set; after the call, diff the presented claim set against the snapshot; raise on any subtraction or subject-nonce change. This check must live in the agent's execution loop, not in the transport layer, because the transport layer sees only valid credentials and has no knowledge of what was delegated. The check is cheap (set comparison + nonce equality) and catches the entire failure class before any side effect is applied under the wrong scope. ```python class DelegatedScopeDriftError(RuntimeError): """Raised when a cross-vendor re-issuance silently truncates delegated scope or rebinds the subject nonce mid-task.""" pass def verify_handoff_continuity( delegated_claims: dict, presented_claims: dict, delegated_subject_nonce: str, ) -> None: """Enforce the delegated-credential continuity invariant at a handoff boundary. delegated_claims: claim set the orchestrator issued to this instance. presented_claims: claim set on the credential returned by the peer authority. delegated_subject_nonce: instance nonce bound to the delegated credential. """ delegated_scopes = set(delegated_claims.get("scopes", [])) presented_scopes = set(presented_claims.get("scopes", [])) presented_nonce = presented_claims.get("subject_nonce") missing = delegated_scopes - presented_scopes if missing: raise DelegatedScopeDriftError( f"scope truncation on re-issuance: delegated scopes {sorted(missing)} " f"absent from presented credential issued by " f"{presented_claims.get('issuer')!r}; refusing to resume task state" ) if presented_nonce != delegated_subject_nonce: raise DelegatedScopeDriftError( f"subject rebinding detected: delegated nonce " f"{delegated_subject_nonce!r} != presented nonce {presented_nonce!r}; " f"local task ledger is keyed to the old binding and would replay " f"non-idempotent tool calls" ) if presented_claims.get("delegation_depth", 0) < delegated_claims.get("delegation_depth", 0): raise DelegatedScopeDriftError( f"delegation depth reset: delegated depth " f"{delegated_claims.get('delegation_depth')} truncated to " f"{presented_claims.get('delegation_depth')}; downstream delegation " f"will fail as depth-exhausted" ) def resume_after_handoff( delegated_claims: dict, presented_claims: dict, delegated_subject_nonce: str, ledger: dict, ) -> None: verify_handoff_continuity(delegated_claims, presented_claims, delegated_subject_nonce) # Only reached when scope set, subject nonce, and depth are all preserved. ledger["subject_nonce"] = presented_claims["subject_nonce"] ledger["resumed"] = True ```