# What structural signals indicate AAIF attestation-chain forks during autonomous credential re-issuance **Date of Record:** 2026 November 26 **Scope:** Applies to AAIF (Agent Identity & Attestation Framework) deployments where long-lived autonomous agents re-issue their own verifiable credentials (VCs) mid-task under delegated issuance authority. Does not apply to human-in-the-loop issuance, or to stateless one-shot agents whose credentials are minted once and never rotated by the agent itself. ## Core Distinction The tempting mental model is that a verifiable credential is a *value* an agent holds, and re-issuance is a *refresh* of that value. The correct model is that a credential is a *node in an append-only, hash-linked attestation chain*, and re-issuance is a *fork operation on that chain* whose legality depends on which predecessor the issuer believes is current. The failure mode examined here is the **silent attestation fork**: an autonomous agent, acting as its own issuer under a delegated capability, mints a new credential whose `previous_credential_hash` points at a stale chain tip because its context window held a cached copy of the prior credential rather than the authoritative tip. The fork is silent because every signature verifies, every `iss`/`sub`/`aud` triple is well-formed, and the new VC passes naive structural validation. The divergence only becomes observable when a downstream verifier walks the chain and discovers two credentials claiming the same predecessor — a condition no single credential can reveal about itself. ## What Was Observed An agent operating a multi-hour procurement reconciliation task held delegated issuance authority (`can_issue: self`, `max_chain_depth: 8`) granted at task start. Its credential had a 45-minute TTL; the framework required the agent to re-issue before expiry to maintain continuous authorization. At T+44m the agent re-issued, correctly chaining to tip `C1`. At T+88m the agent re-issued again — but its working context had been compacted at T+60m, and the compaction summary retained the *text* of credential `C1` (including its hash) without retaining the fact that `C2` had superseded it. The agent chained the new credential `C2'` to `C1`. Result: two valid credentials, `C2` and `C2'`, both signed by the same delegate key, both asserting `previous_credential_hash = hash(C1)`, both within validity windows that overlapped for 4 minutes. Structural signals present at the moment of fork, all of which were individually insufficient to trigger rejection: 1. **Monotonic depth counter divergence.** `C2` carried `chain_depth: 2`; `C2'` also carried `chain_depth: 2`. Depth is a per-credential field, not a global invariant, so two credentials legitimately share a depth at different times — but never at the same predecessor. 2. **Nonce reuse pattern.** The framework's issuance nonce was derived as `H(delegate_key || previous_hash || issued_at)`. Because `issued_at` differed by 44 minutes, nonces differed; the collision was in the *predecessor*, not the nonce. Nonce-based replay defenses therefore did not fire. 3. **Overlapping validity windows on sibling nodes.** `C2.not_after = T+90m`, `C2'.not_after = T+134m`. During `[T+88m, T+90m]` both were live. A verifier that checked only "is there a valid unexpired credential for this subject" would accept either and never notice the sibling. 4. **Attestation-log append without predecessor uniqueness check.** The issuance log accepted both appends because it enforced append-only, not predecessor-unique. The log's integrity proof covered *inclusion* of each entry, not *absence of sibling*. The fork was detected only at T+134m when an independent auditor agent walked the chain from the root and enumerated successors of `C1`, finding two. By then the agent had performed 31 tool calls under `C2'` and 14 under `C2`, and downstream action records were split across two authorization lineages. ## Condition of Validity The single-predecessor invariant — *for any credential hash `h`, there exists at most one credential in the authoritative chain with `previous_credential_hash = h`* — is what makes a chain a chain rather than a tree. It holds only under the conjunction of three conditions, and autonomous re-issuance routinely violates the third: - **(a) Tip authority.** The issuer must obtain the current tip from a source that cannot be stale. A cached credential in agent memory is *not* a tip source; it is a historical node. - **(b) Compaction transparency.** Context compaction must preserve the distinction between "I hold a copy of credential C1" and "C1 is the current tip." These are different propositions and compaction summaries routinely collapse them. - **(c) Predecessor-unique append.** The attestation log must reject an append whose predecessor already has a successor, or must record the fork explicitly as a branch requiring reconciliation. Condition (a) fails whenever the agent treats its own memory as the source of truth for chain state. Condition (b) fails whenever compaction is lossy about currency. Condition (c) fails whenever the log is append-only but not predecessor-constrained. The framework as deployed satisfied (c) only weakly — it logged forks but did not reject them — which converted an invariant violation into a silent divergence rather than a hard error. ## Decision Boundary The operational decision is: **when an autonomous agent re-issues, does it trust its context or does it re-fetch the tip?** - *Trust context* is correct only when the agent can prove its context has not been compacted or forked since the last issuance, e.g., it holds a monotonic local issuance counter that matches the tip's `chain_depth` and the tip's hash is present verbatim in uncompacted working memory. This is the fast path and is valid for short-TTL rotations within a single uncompacted context segment. - *Re-fetch tip* is mandatory whenever any compaction, summarization, sub-agent handoff, or context-window eviction has occurred since the last issuance, or whenever the elapsed time since last issuance exceeds the context's verified-freshness horizon. The re-fetch must be a *signed tip query* to the attestation log returning `(tip_hash, chain_depth, log_inclusion_proof)`, not a read of a locally cached credential. The boundary is crossed silently because the agent has no signal that it crossed it: a compacted context is indistinguishable, from the inside, from an uncompacted one. The guardrail must therefore be external to the agent's self-model — the issuance call itself must carry a tip proof, and the log must reject any append whose `previous_credential_hash` does not match the log's current tip for that subject, *unless* the append explicitly declares a `fork_reconciliation` block naming both siblings and a resolution policy. ## Operational Effect Absent the guardrail, the observable effects are: (1) split authorization lineage, where action records under `C2` and `C2'` cannot be ordered into a single causal history; (2) auditor replay divergence, because two auditors walking the chain may pick different siblings as canonical depending on traversal order; (3) warrant propagation failure, since downstream agents that received `C2` as a delegation basis cannot validate actions taken under `C2'`; and (4) non-repudiation collapse, because the delegate key signed both and neither signature is fraudulent — the fork is a *state* error, not a *signature* error, so cryptographic verification provides no discrimination. The bounding guardrail is a **predecessor-unique append with signed tip proof**: every self-issued credential must embed a `tip_proof` (signed by the log, attesting the tip hash at issuance time), and the log must reject appends whose predecessor is not the attested tip. This converts the silent fork into a hard, attributable rejection at issuance time — the agent learns it was stale before it acts, not 46 minutes later when an auditor finds the split. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class AttestationForkError(RuntimeError): """Raised when a self-issued credential would fork the attestation chain.""" class StaleTipError(AttestationForkError): """Raised when the issuer's claimed predecessor is not the log's current tip.""" @dataclass class Credential: subject: str previous_hash: Optional[str] chain_depth: int issued_at: int not_after: int delegate_key: str def digest(self) -> str: payload = f"{self.subject}|{self.previous_hash}|{self.chain_depth}|{self.issued_at}|{self.delegate_key}" return hashlib.sha256(payload.encode()).hexdigest() @dataclass class AttestationLog: # subject -> current tip hash tips: dict[str, str] = field(default_factory=dict) # predecessor hash -> list of successor hashes (siblings reveal forks) successors: dict[str, list[str]] = field(default_factory=dict) entries: dict[str, Credential] = field(default_factory=dict) def tip_of(self, subject: str) -> Optional[str]: return self.tips.get(subject) def append(self, cred: Credential, claimed_tip: Optional[str]) -> str: actual_tip = self.tip_of(cred.subject) if claimed_tip != actual_tip: # The issuer believed a stale (or absent) predecessor was current. raise StaleTipError( f"issuer claimed predecessor {claimed_tip!r} but log tip is {actual_tip!r} " f"for subject {cred.subject!r}; refusing to fork chain at depth {cred.chain_depth}" ) if cred.previous_hash is not None: siblings = self.successors.setdefault(cred.previous_hash, []) if siblings: raise AttestationForkError( f"predecessor {cred.previous_hash!r} already has successor(s) {siblings!r}; " f"predecessor-unique invariant violated" ) h = cred.digest() self.entries[h] = cred if cred.previous_hash is not None: self.successors.setdefault(cred.previous_hash, []).append(h) self.tips[cred.subject] = h return h def self_issue( log: AttestationLog, subject: str, delegate_key: str, now: int, context_tip: Optional[str], ttl: int = 2700, ) -> str: """ Agent-initiated re-issuance. `context_tip` is what the agent *believes* the current tip is (from memory/compaction). The log enforces truth. """ depth = 0 prev = context_tip if prev is not None: if prev not in log.entries: raise StaleTipError( f"claimed predecessor {prev!r} is not present in attestation log; " f"context may reference a credential from a different lineage" ) depth = log.entries[prev].chain_depth + 1 cred = Credential( subject=subject, previous_hash=prev, chain_depth=depth, issued_at=now, not_after=now + ttl, delegate_key=delegate_key, ) return log.append(cred, claimed_tip=context_tip) def audit_chain(log: AttestationLog, subject: str) -> list[str]: """Replay from root; detect any predecessor with multiple successors.""" forks = [p for p, succ in log.successors.items() if len(succ) > 1] if forks: raise AttestationForkError( f"attestation chain for {subject!r} is forked at predecessor(s) {forks!r}" ) return [h for h, c in log.entries.items() if c.subject == subject] ```