# What happens when an instance re-delegates a verifiable credential across an AAIF chain and the resolver clock skew invalidates the parent link mid-handoff **Date of Record:** 2026 November 24 **Scope:** Applies to AAIF-compliant agent identity systems where an instance presents a decentralized identifier (DID) plus a verifiable credential (VC) delegation chain to authorize a downstream action or handoff. Does not apply to single-hop bearer-token auth or to chains where every link is re-verified synchronously against a trusted single clock. ## Core Distinction There are two distinct notions of "valid delegation" in an AAIF chain, and they diverge exactly at the handoff boundary: 1. **Structural validity** — the chain is cryptographically well-formed: each VC's `proof` verifies against the issuer DID's key, `credentialSubject.id` of link N equals `issuer.id` of link N+1, and scopes narrow monotonically (a child cannot grant a capability its parent lacked). 2. **Temporal validity** — every link's `validFrom`/`validUntil` window contains the *evaluation instant*, and the DID documents resolved for each issuer still contain the verification method referenced by that link's proof. The failure mode lives in the gap: a chain can be structurally valid at the moment instance A signs a re-delegation, then become temporally invalid by the time instance B (the delegate) presents it, because B evaluates against a clock and a resolver cache that A never saw. The non-obvious part is that **the re-delegation is signed by A, not by the root**, so A's signing instant silently becomes the reference point for a chain whose earliest link may already be aging out. A does not need to be malicious or wrong; it only needs to hand off across a boundary where clock skew and DID-document cache TTLs conspire. ## What Was Observed A three-hop chain: root orchestrator `did:aaif:root` → planner `did:aaif:planner` → executor `did:aaif:executor`. The planner received a VC from root granting `tool:write:staging` with `validUntil = T0 + 3600s`. At `T0 + 3590s` (ten seconds before expiry), the planner re-delegated a narrowed scope `tool:write:staging:table_x` to the executor, signing the new VC with `validFrom = now_planner`, `validUntil = now_planner + 600s`. Structurally this is sound: the child scope is a strict subset, the proof verifies, the subject/issuer linkage holds. But the executor's resolver had cached the root's DID document with a TTL of 900s, and the root had rotated its verification method key at `T0 + 3500s` — after the planner's chain was issued but before the executor resolved it. Two independent temporal facts broke simultaneously: - The **parent link's `validUntil`** (`T0 + 3600s`) had already passed relative to the executor's clock, which ran ~40s ahead of the planner's due to an unsynchronized NTP pool. - The **root DID document** the executor resolved no longer contained the verification method that signed the planner's parent VC; the rotated key was present but the old one had been dropped rather than retained in `alsoKnownAs`/historical methods. The executor's verification returned `chain_invalid: parent_expired` — but the *action* it was gating (a staging table write) had already been partially executed by a concurrent worker that verified against a stale cache and saw the parent as still valid. The result was a split-brain: one worker committed, one refused, and the delegation chain gave no single authoritative answer about whether the write was authorized. The tell was in the audit log: the same executor DID recorded `verify=pass` and `verify=fail` for the *same chain bytes* within a 200ms window, differing only in resolver cache state and local clock. ## Condition of Validity The invariant that makes AAIF delegation safe across handoffs is: > A re-delegation is only sound if, at the instant the delegate evaluates it, the *entire* chain from root to leaf is temporally valid and every referenced verification method is resolvable — and the delegate's evaluation instant is bounded by the minimum remaining lifetime across all links, not by the lifetime of the link the delegator just signed. Concretely, the delegator must set the child's `validUntil` to `min(parent.validUntil, now + max_child_ttl)`, and must refuse to re-delegate when `parent.validUntil - now < handoff_margin`. The executor, in turn, must treat chain validity as `min over links (validUntil) - clock_skew_budget`, and must resolve DID documents with a cache policy that retains rotated verification methods for at least the maximum chain lifetime (`maxChainLifetime + skew`). Without both halves, the boundary is unguarded. The condition fails in practice because the delegator computes `min(...)` against *its own* clock and cache, while the delegate evaluates against *its own*. The two are only consistent if skew is explicitly budgeted and the resolver retains historical keys. Neither is true by default in most AAIF deployments. ## Decision Boundary The decision boundary is a single comparison the executor must make before acting, and it must be made against the *weakest* link, not the strongest: ``` effective_validity = min( for each link in chain: link.validUntil ) - clock_skew_budget authorized = (now_executor <= effective_validity) AND (every verification_method in chain is resolvable, including rotated-out methods within maxChainLifetime) AND (scope of leaf ⊆ scope of every ancestor) ``` If `authorized` is false, the executor must **not** execute and must **not** cache a `pass` — it must return a structured `DelegationExpired` or `VerificationMethodUnresolvable` fault that names the failing link. The delegator, on its side, must refuse to sign when `parent.validUntil - now < handoff_margin`, converting a latent temporal failure into an explicit, observable refusal at the point of delegation rather than a silent split at the point of execution. The subtle boundary: a chain that passes at `t` can fail at `t + ε` for reasons entirely outside the delegate's control. The only defense is to make the failure *loud and attributable* — never let a stale cache produce a `pass`. ## Operational Effect When this boundary is unguarded, the observable effects are: - **Split-brain authorization.** Concurrent workers evaluating the same chain against different cache states commit and refuse the same action. The audit trail shows contradictory verdicts for identical bytes, which is worse than a uniform failure because it destroys the ability to reconstruct what was authorized. - **Silent capability widening under rotation.** If the resolver drops rotated keys, a delegate that *should* fail verification may instead resolve to a *different* key that happens to satisfy the proof check — or, more commonly, the chain fails closed on a legitimate delegation, causing false denials that operators "fix" by widening `validUntil` and re-introducing the original bug at larger scale. - **Handoff latency amplification.** Re-verifying the full chain synchronously on every tool call (the naive fix) adds resolver round-trips to the hot path; under load, the verification itself times out, and a timeout is indistinguishable from a failure unless the fault is structured. The guardrail that bounds all three: pin the chain's effective validity to `min(link.validUntil) - skew_budget` at *both* ends, retain rotated verification methods for `maxChainLifetime + skew`, and make every refusal a named, structured fault carrying the failing link's DID and the evaluation instant. A chain that cannot be evaluated must fail with attribution, never with a bare boolean. ```python import time from dataclasses import dataclass, field from typing import Optional class DelegationExpired(RuntimeError): """Raised when a re-delegation or verification crosses the temporal boundary.""" pass class VerificationMethodUnresolvable(RuntimeError): """Raised when a rotated-out verification method is no longer in the DID document.""" pass @dataclass class ChainLink: issuer_did: str subject_did: str valid_from: float valid_until: float verification_method_id: str scope: frozenset @dataclass class DIDDocument: did: str # verification_method_id -> public key bytes (historical methods retained) methods: dict = field(default_factory=dict) # methods rotated out but still resolvable within maxChainLifetime historical_methods: dict = field(default_factory=dict) def resolve(self, method_id: str) -> Optional[bytes]: return self.methods.get(method_id) or self.historical_methods.get(method_id) CLOCK_SKEW_BUDGET = 60.0 # seconds HANDOFF_MARGIN = 120.0 # delegator refuses below this MAX_CHAIN_LIFETIME = 3600.0 # resolver must retain rotated keys this long def re_delegate( parent: ChainLink, delegator_did: str, delegate_did: str, narrowed_scope: frozenset, now: float, requested_ttl: float = 600.0, ) -> ChainLink: """Delegator-side guard: refuse to sign a child that outlives its parent.""" if not narrowed_scope.issubset(parent.scope): raise DelegationExpired( f"scope widening refused: {narrowed_scope} not subset of {parent.scope}" ) remaining = parent.valid_until - now if remaining < HANDOFF_MARGIN: raise DelegationExpired( f"refusing re-delegation from {delegator_did}: parent {parent.issuer_did} " f"expires in {remaining:.1f}s < handoff margin {HANDOFF_MARGIN}s" ) child_until = min(parent.valid_until, now + requested_ttl) return ChainLink( issuer_did=delegator_did, subject_did=delegate_did, valid_from=now, valid_until=child_until, verification_method_id=f"{delegator_did}#key-1", scope=narrowed_scope, ) def verify_chain( chain: list, documents: dict, now: float, ) -> None: """Delegate-side guard: evaluate against the weakest link, with skew budget.""" if not chain: raise DelegationExpired("empty chain") effective_until = min(link.valid_until for link in chain) - CLOCK_SKEW_BUDGET if now > effective_until: weakest = min(chain, key=lambda l: l.valid_until) raise DelegationExpired( f"chain invalid at t={now:.1f}: weakest link {weakest.issuer_did} " f"expired at {weakest.valid_until:.1f} (effective {effective_until:.1f})" ) for link in chain: doc = documents.get(link.issuer_did) if doc is None or doc.resolve(link.verification_method_id) is None: raise VerificationMethodUnresolvable( f"cannot resolve {link.verification_method_id} for {link.issuer_did}; " f"rotated methods must be retained for {MAX_CHAIN_LIFETIME}s" ) if __name__ == "__main__": t0 = time.time() root = ChainLink( issuer_did="did:aaif:root", subject_did="did:aaif:planner", valid_from=t0, valid_until=t0 + 3600.0, verification_method_id="did:aaif:root#key-1", scope=frozenset({"tool:write:staging"}), ) # Planner re-delegates ten seconds before parent expiry: must refuse. try: re_delegate( parent=root, delegator_did="did:aaif:planner", delegate_did="did:aaif:executor", narrowed_scope=frozenset({"tool:write:staging:table_x"}), now=t0 + 3590.0, ) except DelegationExpired as e: print(f"delegator refused: {e}") # Simulate the split-brain: parent expired, stale cache saw it as valid. docs = { "did:aaif:root": DIDDocument( did="did:aaif:root", methods={"did:aaif:root#key-2": b"rotated"}, historical_methods={"did:aaif:root#key-1": b"old"}, ) } try: verify_chain([root], docs, now=t0 + 3605.0) except DelegationExpired as e: print(f"executor refused: {e}") ```