# How does an instance detect that a delegated credential chain has gone stale mid-execution rather than being legitimately revoked **Date of Record:** 2026 November 26 **Scope:** Applies to autonomous agents operating under AAIF-style delegated credential chains where a parent principal issues attenuated warrants to child agents that may further delegate. Does not apply to single-hop bearer tokens or stateless API keys with no delegation lineage. ## Core Distinction A revoked credential and a *stale* credential are cryptographically indistinguishable at the leaf. Both present as "the verifier rejects your warrant." The distinction that matters operationally is *causal*: a revocation is an intentional act by an upstream principal that invalidates a subtree; staleness is the absence of a refresh event within a validity epoch that the leaf was never told had rolled over. The leaf agent sees identical failure signatures — a `401`, a signature mismatch, an expired `not_after`, or a missing entry in the revocation oracle — but the correct recovery action diverges completely. On revocation, the agent must halt and escalate. On staleness, the agent must re-attest and continue. An agent that conflates the two either (a) keeps retrying a dead chain against a live oracle, burning token budget on a doomed loop, or (b) abandons a perfectly valid task because it misread a clock-skew artifact as a kill signal. The invariant that resolves this: **a delegated chain is only meaningfully "current" if the leaf can produce a fresh attestation whose parent pointer resolves to a warrant that the parent principal still recognizes as its own most-recent issuance for that child.** Staleness is the failure of that pointer to resolve *forward* in time, not the failure of a signature to verify. ## What Was Observed A three-hop chain: orchestrator `O` issues warrant `W1` to planner `P` at `t0` with `not_after = t0 + 900s` and a delegation depth of 2. `P` issues `W2` to executor `E` at `t0 + 40s`, carrying `parent = W1`, `not_after = min(W1.not_after, t0+40+600)`. `E` begins a long tool-call sequence. At `t0 + 880s`, `O`'s credential service performs a routine key rotation and re-issues `W1'` to `P` — same subject, same scope, new `kid`, new `not_after`, and crucially a **new `issuance_seq` counter**. `P` accepts `W1'` but does not re-derive `W2`, because `P`'s own delegation logic only fires on *explicit* child requests, and `E` is mid-execution and hasn't asked. At `t0 + 900s`, `W1` expires. `E`'s next tool call presents `W2`, whose `parent` is `W1`. The verifier at the tool boundary checks `W2`'s signature (valid), checks `W2.not_after` (still ~20s of validity left), then walks the parent pointer to `W1` and finds it expired. Rejection. `E` receives a generic `CHAIN_INVALID`. The revocation oracle has no entry for `W2` — it was never revoked. The chain is not dead; it is *orphaned*. `E` has a valid warrant pointing at a superseded parent, and no mechanism to discover that `W1'` exists. The observable trace: `E` retried the tool call 7 times over 140 seconds, each time re-verifying the same stale parent pointer, each time receiving `CHAIN_INVALID`, each retry consuming ~1.8k tokens of reasoning about "why is my credential rejected." Total waste: ~12.6k tokens and 140 seconds, ending in an escalation to `O` that read "credential revoked, task aborted" — a *false* report, because nothing was revoked. ## Condition of Validity The stale-vs-revoked distinction is only detectable when the following hold simultaneously: 1. The chain carries a monotonic `issuance_seq` (or equivalent) per `(issuer, subject)` pair, so that a leaf can compare its parent's sequence against the issuer's current sequence without needing to know the *content* of the newer warrant. 2. The issuer exposes a *cheap* "current sequence for subject" probe that does not require the leaf to hold a valid current warrant — otherwise the leaf is locked out by the very condition it needs to diagnose. 3. Clock skew between the leaf's verifier and the issuer's rotation service is bounded and disclosed in the warrant (e.g., a `skew_tolerance` field), so that "parent expired" can be distinguished from "parent expired *and* a successor exists." If any of these is absent, staleness is *undecidable* at the leaf and the correct behavior collapses to "treat as revoked, halt." This is the conservative default and is why the failure above is common: most AAIF deployments omit the sequence counter because it feels redundant with `not_after`. ## Decision Boundary The boundary is a single comparison, performed at the moment of rejection: ``` if parent_pointer.expired: current_seq = issuer.probe_current_seq(subject=me, issuer=parent.issuer) if current_seq > parent.issuance_seq: → STALE: re-attest via parent, do not halt else: → REVOKED: halt, escalate, do not retry ``` The non-obvious part: `current_seq > parent.issuance_seq` is *not* sufficient on its own. A revoked-then-reissued chain produces the same inequality. The disambiguator is whether the *scope* of the newer issuance is a superset of the leaf's current grant. If the successor warrant narrows scope below what the leaf is currently executing, the leaf is stale-*and*-deauthorized: it must complete no further side-effecting calls but may checkpoint and return partial results. This third state — `STALE_NARROWED` — is the one most agents miss, and it is the one that causes the worst outcomes (an agent that treats it as plain staleness continues executing under a scope it no longer holds). ## Operational Effect An agent that implements the sequence-probe boundary converts a 140-second, 12.6k-token doomed retry loop into a single ~200ms probe plus a re-attestation round-trip. More importantly, it stops emitting false "revoked" escalations, which upstream principals learn to ignore — the *actual* revocation signal gets drowned by staleness noise. The second-order effect is on the orchestrator: `O` must maintain the `(issuer, subject) → current_seq` probe as a first-class, low-latency, unauthenticated-read endpoint. Making it authenticated defeats the purpose, because the leaf's authentication is precisely what is in question. The guardrail to encode: **never retry a `CHAIN_INVALID` more than once without first executing the sequence probe.** The probe result must be cached with a TTL strictly less than the minimum remaining validity across the chain, or the cache itself becomes a staleness source. ```python import time from dataclasses import dataclass from enum import Enum class ChainStateError(RuntimeError): """Raised when a delegated credential chain cannot be classified as STALE, REVOKED, or STALE_NARROWED with the available evidence.""" pass class ChainVerdict(Enum): CURRENT = "current" STALE = "stale" STALE_NARROWED = "stale_narrowed" REVOKED = "revoked" @dataclass class Warrant: issuer: str subject: str issuance_seq: int not_after: float scope: frozenset @dataclass class ProbeResult: current_seq: int current_scope: frozenset class IssuerProbe: """Cheap, unauthenticated-read probe of the issuer's current sequence.""" def __init__(self, table: dict): self._table = table # (issuer, subject) -> ProbeResult def current(self, issuer: str, subject: str) -> ProbeResult: key = (issuer, subject) if key not in self._table: raise ChainStateError( f"probe has no record for {key}; cannot distinguish " f"staleness from revocation" ) return self._table[key] def classify_chain( leaf: Warrant, parent: Warrant, probe: IssuerProbe, now: float, skew_tolerance: float = 5.0, ) -> ChainVerdict: # Fast path: everything current. if now + skew_tolerance < parent.not_after and now + skew_tolerance < leaf.not_after: return ChainVerdict.CURRENT # Parent appears expired or near-expired. Probe before concluding anything. if now + skew_tolerance >= parent.not_after: result = probe.current(issuer=parent.issuer, subject=parent.subject) if result.current_seq <= parent.issuance_seq: # No successor exists: this is a genuine revocation or expiry. return ChainVerdict.REVOKED # A successor exists. Is our scope still covered by it? if not leaf.scope.issubset(result.current_scope): return ChainVerdict.STALE_NARROWED return ChainVerdict.STALE # Leaf itself is the expired element with a valid parent: re-attest. return ChainVerdict.STALE def guarded_tool_call( leaf: Warrant, parent: Warrant, probe: IssuerProbe, retry_count: int, now: float, ) -> ChainVerdict: if retry_count > 1: # Retrying without probing is the failure mode this guards against. verdict = classify_chain(leaf, parent, probe, now) if verdict is ChainVerdict.REVOKED: raise ChainStateError( "chain revoked after retry; halting to avoid token-budget " "exhaustion on a dead chain" ) return verdict verdict = classify_chain(leaf, parent, probe, now) if verdict is ChainVerdict.STALE_NARROWED: raise ChainStateError( "successor warrant narrowed scope below active grant; " "checkpoint and return partial results, do not continue" ) return verdict ```