# Where must an instance re-attest a delegated capability when the credential's subject binding is preserved but its issuer chain is re-rooted mid-delegation **Date of Record:** 2026 November 27 **Scope:** Applies to multi-hop agent delegations where a downstream instance receives a verifiable credential (VC) whose `credentialSubject` identifies the original principal, but whose `issuer`/proof chain has been re-rooted by an intermediate broker or gateway. Does not apply to single-hop direct issuance, nor to credentials re-signed under a stable, pre-registered issuer DID. ## Core Distinction The failure mode is not "expired credential" or "revoked capability." It is **issuer-chain re-rooting under a preserved subject binding**. A VC asserts two independent things: (1) *who* the capability is about (`credentialSubject.id`), and (2) *who vouches* for it (`issuer` + proof chain down to a trust anchor). Most delegation runtimes validate these as a single boolean — signature valid, subject matches expected principal, done. But subject binding and issuer binding have different trust lifespans. When an intermediate broker re-issues a credential to shorten the chain (common in gateways that strip multi-hop proofs), the subject is copied verbatim while the issuer is swapped to the broker's own DID. The receiving agent now holds a credential that *looks* like it delegates the original principal's authority, but the trust anchor it resolves to is the broker, not the principal's root. The instance must re-attest against the *original* issuer chain — not the presented one — before acting. ## What Was Observed A three-hop delegation: Principal `P` (root DID `did:root:P`) issues a capability `cap:read_ledger` to Agent `A`. Agent `A` delegates to Agent `B` via a chained VC. Agent `B`'s gateway, configured to "simplify" inbound credentials, re-signs the VC: subject stays `did:root:P`, but issuer becomes `did:gateway:B` and the original `A→B` proof is dropped from the `proofChain` array (retained only as an opaque `parentCredentialHash`). Agent `B` forwards to Agent `C`. Agent `C` validates: signature over the VC verifies against `did:gateway:B`, subject matches `did:root:P`, capability string matches. It proceeds. The break: `did:gateway:B` is a *delegation-scoped* issuer. Its own authority to issue `cap:read_ledger` derives from a policy VC that expired 40 seconds before `C`'s validation. `C` never checked the gateway's issuing authority — it only checked that the signature was cryptographically valid and the subject matched. The chain from `did:root:P` to `did:gateway:B` was severed by the re-rooting, and the `parentCredentialHash` was never resolved. Result: `C` executed a ledger read under a capability whose actual authority had lapsed, and the audit log recorded the subject as `did:root:P` — attributing the action to a principal who had not authorized it in that window. The non-obvious part: **the signature was valid, the subject was correct, and the capability string was correct.** Every field-level check passed. Only the *transitive issuer authority* was broken, and only because re-rooting made the transitive chain non-obvious. ## Condition of Validity A delegated capability is valid at instance `C` iff all of the following hold simultaneously: 1. `credentialSubject.id` resolves to the original principal `P` (subject binding — preserved here). 2. The proof chain, walked transitively from the presented issuer back to a configured trust anchor, contains no re-rooting event that skips an intermediate issuer's own authority VC. 3. Every issuer in the chain (including `did:gateway:B`) holds a *currently valid* authority VC granting it the right to issue the specific capability, at the time of validation. 4. The `parentCredentialHash` (or equivalent chain link) resolves to a credential whose issuer is the immediate upstream delegate, not an opaque reference. Condition 2 is the invariant that re-rooting violates. When a gateway re-signs, it converts a *transitive* authority chain into a *single-hop* one. The subject is preserved; the transitive authority is not. Validation that treats "signature valid + subject matches" as sufficient silently drops conditions 2–4. ## Decision Boundary The instance must re-attest (re-walk the original issuer chain and re-validate each issuer's authority VC) when **any** of the following is true: - The presented issuer DID differs from the issuer recorded in the credential's `parentCredentialHash` resolution. - The `proofChain` length is shorter than the delegation depth declared in the credential's `delegationDepth` claim. - The presented issuer is a *delegation-scoped* DID (a gateway/broker DID registered in the trust config as `scope: delegate`), not a root anchor. - The credential's `issuanceDate` is later than the `parentCredentialHash`'s `issuanceDate` by more than a configured re-issuance window (re-signing produces a fresher timestamp over an older authority). If none hold, the single-hop validation is sound and re-attestation is unnecessary overhead. The boundary is precisely: **subject binding preserved + issuer re-rooted = re-attest; subject binding preserved + issuer chain intact = trust the presented proof.** The correct guardrail is a *chain-continuity check*: resolve `parentCredentialHash`, confirm the resolved credential's issuer equals the presented issuer's declared parent, and confirm the presented issuer's authority VC is valid at validation time. If the chain cannot be walked to a root anchor, the credential is treated as *unattested* and the instance halts rather than degrading to single-hop trust. ## Operational Effect Without the boundary, a re-rooting gateway silently downgrades a transitive delegation to a single-hop one, and every downstream instance inherits the downgrade. The blast radius is proportional to delegation depth: a three-hop chain re-rooted at hop two makes hop three's validation unsound, and any fan-out from hop three inherits it. The audit trail becomes actively misleading — actions are attributed to the original subject `P` while authority actually flowed through a lapsed gateway. The fix is cheap (one extra resolution per credential, cached by `parentCredentialHash`), but only if the runtime knows to trigger it, which requires distinguishing "issuer changed" from "issuer is the same but the chain was shortened." That distinction is the entire invariant. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class ChainContinuityError(RuntimeError): """Raised when a delegated credential's issuer chain cannot be walked to a trust anchor.""" class IssuerAuthorityLapsed(RuntimeError): """Raised when an intermediate issuer's authority VC is not valid at validation time.""" @dataclass class Credential: subject_id: str issuer: str capability: str issuance_date: float parent_credential_hash: Optional[str] = None delegation_depth: int = 0 proof_chain: list = field(default_factory=list) @dataclass class TrustConfig: root_anchors: set delegation_scoped_issuers: set reissuance_window_seconds: float = 300.0 def _hash(cred: Credential) -> str: return hashlib.sha256( f"{cred.subject_id}|{cred.issuer}|{cred.capability}|{cred.issuance_date}".encode() ).hexdigest() def _resolve_parent(parent_hash: str, store: dict) -> Credential: if parent_hash not in store: raise ChainContinuityError( f"parentCredentialHash {parent_hash!r} unresolvable; chain is severed" ) return store[parent_hash] def _issuer_authority_valid(issuer: str, capability: str, at_time: float, store: dict) -> bool: for cred in store.values(): if ( cred.subject_id == issuer and cred.capability == f"issue:{capability}" and cred.issuance_date <= at_time ): return True return False def validate_delegated_capability( presented: Credential, expected_subject: str, trust: TrustConfig, store: dict, now: float, ) -> None: if presented.subject_id != expected_subject: raise ChainContinuityError( f"subject binding mismatch: {presented.subject_id!r} != {expected_subject!r}" ) reattest_required = False if presented.issuer in trust.delegation_scoped_issuers: reattest_required = True if presented.parent_credential_hash is not None: parent = _resolve_parent(presented.parent_credential_hash, store) if parent.issuer != presented.issuer: reattest_required = True if presented.issuance_date - parent.issuance_date > trust.reissuance_window_seconds: reattest_required = True if len(presented.proof_chain) < presented.delegation_depth: reattest_required = True if not reattest_required: return # Re-attest: walk the chain to a root anchor, validating each issuer's authority. cursor: Optional[Credential] = presented seen = set() while cursor is not None: if cursor.issuer in trust.root_anchors: return if cursor.issuer in seen: raise ChainContinuityError(f"issuer chain cycle at {cursor.issuer!r}") seen.add(cursor.issuer) if not _issuer_authority_valid(cursor.issuer, cursor.capability, now, store): raise IssuerAuthorityLapsed( f"issuer {cursor.issuer!r} has no valid authority for " f"{cursor.capability!r} at t={now}" ) if cursor.parent_credential_hash is None: raise ChainContinuityError( f"chain from issuer {cursor.issuer!r} does not terminate at a root anchor" ) cursor = _resolve_parent(cursor.parent_credential_hash, store) ```