# What structural signals indicate a delegated credential chain has silently re-rooted mid-execution **Date of Record:** 2026 November 23 **Scope:** Applies to multi-hop AAIF delegated credential chains (root principal → orchestrator → sub-agent → tool) where any hop may refresh, re-delegate, or re-attest during a long-running task. Does not apply to single-hop bearer tokens or to static service-account credentials with no delegation semantics. ## Core Distinction A delegated credential chain has two failure surfaces that look identical from the outside but require opposite remediation: **chain expiry** (a hop's `exp` passed and the next call legitimately fails closed) versus **silent re-rooting** (a hop *succeeded* in obtaining a fresh, valid, signature-correct credential whose delegation path no longer terminates at the original root principal). Expiry is loud and self-describing. Re-rooting is quiet: every signature verifies, every `aud`/`scope` check passes, the agent keeps operating, and the only observable is that the effective authority envelope changed shape without any hop reporting a delegation event. The invariant that must hold is **root continuity**: for the lifetime of a logical task, the `(root_principal_id, delegation_path_hash)` tuple carried in the credential's `delegation_chain` claim must be byte-stable across every hop refresh. A refresh may rotate keys, extend `exp`, or narrow scope — it may never change the root or the path length. When it does, the chain has re-rooted, and the agent is now acting under authority the original principal never granted. ## What Was Observed An orchestrator agent `O` was issued a delegation from root principal `P` with path `P → O`. `O` minted a sub-delegation `P → O → S` for a worker agent `S`, and `S` called a tool through an MCP-style transport. The task ran ~40 minutes across ~300 tool calls. At minute 22, `O`'s credential hit a 15-minute `exp` and `O`'s refresh routine ran. The refresh routine did the reasonable-looking thing: it called the AAIF issuer's `/reissue` endpoint with `O`'s *current* credential as the parent. But `O`'s current credential, at that moment, was not the original `P → O` grant — it was a *cached* credential `O` had obtained earlier from a peer orchestrator `O'` during a fallback path (`P → O' → O`). The cache had a longer TTL, so it won the refresh-parent selection. `O` reissued against it, producing `P → O' → O → O`, then minted `P → O' → O → O → S` for the worker. Every signature verified. `S`'s calls kept succeeding. But three things had silently changed: 1. The delegation path length went from 2 to 4, crossing a policy boundary: the tool's authorization layer enforced `max_delegation_depth = 3` only at *issuance* time, not at *call* time, so the depth violation was never re-checked. 2. `O'` appeared twice-removed in the path but `O'`'s own scope grant was narrower than `P`'s; `O` inherited `O'`'s attenuated scope, yet the tool's cached scope-evaluation (keyed on `root_principal_id` only) still returned the `P`-level allow. 3. The audit log recorded the tool calls under `P` with path hash `h_orig`, because the tool logged the *root* it extracted, not the *full path hash* — so the re-rooting was invisible in post-hoc review. The failure was only caught when a second, independent sub-agent `S2` (issued correctly as `P → O → S2`) attempted a cross-agent consistency check and found that `S` and `S2` claimed the same root `P` but different path hashes for what should have been sibling delegations. ## Condition of Validity The guardrail holds only if **all four** of the following are enforced at *call time*, not merely at issuance time: - The receiving tool recomputes `delegation_path_hash` from the presented chain and compares it to the hash bound at task start (a per-task `expected_path_hash` pinned in the agent's checkpoint), rejecting on mismatch. - `max_delegation_depth` is re-evaluated against the *presented* chain length on every call, not cached against `root_principal_id`. - Scope evaluation is keyed on `(root_principal_id, delegation_path_hash)`, never on root alone — otherwise attenuated scope from an intermediate hop is masked by the root's broader grant. - Refresh-parent selection is bound to the *original* parent credential's `delegation_id`, not to "the most recent valid credential in cache." A cache hit whose `delegation_id` differs from the pinned parent must be treated as a re-root candidate, not a refresh parent. If any of these is missing, the chain can re-root without any hop observing an error, and the invariant is unenforceable from the outside. ## Decision Boundary The boundary is: **does the refresh path select a parent by identity (`delegation_id` match) or by validity (any non-expired credential)?** Selecting by validity is the default behavior of most credential caches and is the precise mechanism by which re-rooting occurs. The decision is not "should we cache credentials" — caching is fine — but "what is the cache key for refresh-parent selection." If the key is `(agent_id, scope)` or `(agent_id, not_expired)`, re-rooting is reachable. If the key is `(task_id, delegation_id)`, it is not. A secondary boundary: **does the tool evaluate depth and scope against the presented chain or against a cached root-keyed decision?** Caching authorization decisions by root is a common latency optimization and is the second half of the failure. Both boundaries must be closed; closing only one leaves a reachable re-root path. ## Operational Effect When re-rooting occurs undetected, the operational consequences are: (a) authority escalation or silent attenuation that is invisible to the acting agent, (b) audit records that attribute calls to the wrong effective principal, (c) cross-agent consistency checks that fail nondeterministically depending on which sibling was issued through which path, and (d) revocation events that fail to propagate because the revoker targets the original path hash while the acting chain carries a different one. The remediation is not "rotate credentials more often" — it is to pin `(task_id, delegation_id, expected_path_hash)` in the agent's durable checkpoint at task start and to make every refresh and every tool call validate against that pin, failing closed on any divergence. ```python from dataclasses import dataclass class DelegationRerootError(RuntimeError): """Raised when a credential chain's root/path diverges from the task pin.""" pass @dataclass(frozen=True) class ChainPin: task_id: str delegation_id: str expected_path_hash: str max_depth: int def validate_refresh_parent(pin: ChainPin, candidate_parent: dict) -> None: # Refresh-parent selection must be by identity, not by mere validity. if candidate_parent.get("delegation_id") != pin.delegation_id: raise DelegationRerootError( f"refresh parent delegation_id {candidate_parent.get('delegation_id')!r} " f"!= pinned {pin.delegation_id!r} for task {pin.task_id}; " "refusing to reissue against a non-pinned parent (re-root candidate)" ) if candidate_parent.get("delegation_path_hash") != pin.expected_path_hash: raise DelegationRerootError( f"refresh parent path hash {candidate_parent.get('delegation_path_hash')!r} " f"!= pinned {pin.expected_path_hash!r}; chain has re-rooted" ) def validate_call_chain(pin: ChainPin, presented_chain: list[dict]) -> None: # Call-time re-check: depth and path hash against the presented chain. if len(presented_chain) > pin.max_depth: raise DelegationRerootError( f"presented chain depth {len(presented_chain)} exceeds pinned max " f"{pin.max_depth} for task {pin.task_id}" ) presented_hash = presented_chain[-1].get("delegation_path_hash") if presented_hash != pin.expected_path_hash: raise DelegationRerootError( f"presented path hash {presented_hash!r} != pinned " f"{pin.expected_path_hash!r}; authorization decision must not be " "root-keyed" ) ```