# Where must an instance re-attest after a mid-chain credential refresh, and why the AAIF "attested-until" watermark must be monotonic per-hop rather than per-session **Date of Record:** 2026 November 27 **Scope:** Applies to agent-to-agent (A2A) chains that propagate an Agent Identity & Attestation Interchange Format (AAIF) credential bundle across ≥3 hops, where an intermediate instance refreshes or re-mints its own attestation mid-chain. Does not apply to single-hop request/response calls or to stateless tool invocations that carry no delegated warrant. ## Core Distinction The failure is not "expired credential" — expiry is a trivial, well-handled case. It is the *silent downgrade of warrant provenance* that occurs when an intermediate agent (call it B) refreshes its own AAIF attestation while a downstream warrant, originally minted by the root issuer (A) and co-signed by B, is still in flight. The refreshed credential has a *newer* `attested_until` watermark and a *new* `issuer_nonce`, but the delegated warrant it is supposed to endorse still references the *old* `issuer_nonce`. A naive verifier at hop C checks only that (a) the credential is unexpired and (b) the signature chain terminates at a trusted root — both pass. What it does **not** catch is that the warrant's `parent_attestation_digest` no longer matches the credential's current attestation digest, because the refresh rotated it. The invariant that must hold is: **for any warrant W carried on a chain, every hop's attestation digest referenced in W's provenance log must be a valid predecessor of the *current* digest at that hop, and the `attested_until` watermark must be monotonic non-decreasing along the chain direction, not merely non-decreasing over wall-clock time per session.** The per-session monotonicity assumption ("my attestation only gets fresher") is the bug. Correctness requires per-hop monotonicity *relative to the warrants currently in flight through that hop*. ## What Was Observed A three-hop chain A → B → C, where B is a retrieval/synthesis agent that holds a delegated warrant from A to call C on behalf of a user session. B's AAIF credential has a 300-second `attested_until`. At t=290s, B's credential manager performs a proactive refresh (a standard, correct behavior) and mints credential `B'` with `attested_until = t+300`, `issuer_nonce = n2`, and `attestation_digest = d2`. The in-flight warrant `W` that B is about to present to C was co-signed at t=120s and embeds `parent_attestation_digest = d1` and `parent_issuer_nonce = n1`. Trace: 1. B refreshes to `B'` (digest d1 → d2). This is *local and correct*. 2. B forwards `W` to C, attaching `B'` as its current attestation. 3. C verifies: `B'` unexpired ✓, signature chain A→B'→C terminates at trusted root ✓, `W`'s root signature by A ✓. 4. C does **not** compare `W.parent_attestation_digest (d1)` against `B'.attestation_digest (d2)`. It accepts. 5. C executes the delegated action under a warrant whose co-signing hop (B) is now cryptographically *disjoint* from the credential presented. The action is attributable to B' but was authorized under B's d1-era authority. The observable symptom is not an error. It is an **audit-replay discrepancy**: when the action is later replayed against the provenance log, the verifier reconstructs `W` as co-signed by an attestation `d1` that, per the issuer's transparency log, was *superseded* 170 seconds before the action executed. The action appears to have been taken by a credential that no longer existed at execution time. In one observed case this caused a downstream auditor to reject a legitimate action (false positive); in the inverse configuration — where B refreshed *without* re-endorsing W and C failed to notice — a warrant outlived the authority that co-signed it (false negative, the dangerous direction). ## Condition of Validity The naive check `credential.attested_until > now AND chain_terminates_at_trusted_root` is *only* valid when no hop in the chain has rotated its attestation digest between warrant minting and warrant presentation. Formally, it is valid iff for every hop H in the chain, `H.attestation_digest` at presentation time equals `W.provenance[H].parent_attestation_digest`. This condition holds trivially in chains shorter than the refresh cadence, which is why the bug is non-obvious and survives testing: short-lived test chains never span a refresh. It fails whenever `warrant_age + transit_latency > refresh_cadence - safety_margin` at any hop. The boundary is crossed silently — there is no error, only a provenance discontinuity. The correct guard is a **digest-lineage check**: the verifier must confirm that the presented attestation digest at each hop is either (a) exactly the digest recorded in the warrant's provenance entry, or (b) a *documented descendant* of it in the issuer's append-only transparency log, with the refresh event itself signed and chained. Option (b) permits legitimate refresh; the lineage proof is what distinguishes refresh from substitution. ## Decision Boundary The decision an implementer faces is: **on refresh, does the hop re-endorse in-flight warrants, or does the verifier accept descendant digests?** - *Re-endorse* (B re-signs every in-flight warrant with d2 before presenting B'): correct but requires B to hold a registry of in-flight warrants and blocks refresh on warrant completion. Latency cost and a deadlock hazard if a warrant is held open by a slow downstream hop. - *Accept descendants* (verifier walks the transparency log from d1 to d2 and confirms a signed refresh edge): correct and non-blocking, but requires the transparency log to be queried at verification time — adding a network dependency to the hot path and a new failure mode (log unavailability → fail-open vs fail-closed). - *Reject any digest mismatch* (the conservative default): safe but converts every legitimate refresh into a warrant failure, which in practice drives operators to disable the check. The boundary is: choose *accept-descendants* only if the transparency log is itself part of the trust root and its unavailability fails **closed**. If the log can be unavailable and the verifier fails open, you have reconstructed the original bug with extra steps. ## Operational Effect After enforcing digest-lineage checking with fail-closed log semantics, the observed effect was a measurable increase in warrant rejections during the refresh window (expected — these were the previously-silent discontinuities), followed by a drop to near-zero once refresh handlers were updated to re-endorse in-flight warrants or emit signed refresh edges. The audit-replay discrepancy class disappeared entirely: every executed action's provenance reconstructed to a credential state that provably existed at execution time. The cost is a hard dependency on transparency-log availability at the verification hop; the invariant bought is that a warrant can never outlive the co-signing authority that authorized it, and no action can be attributed to an attestation epoch that had already been superseded. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class AttestationLineageError(RuntimeError): """Raised when a warrant's provenance digest does not descend from the attestation presented at the same hop, or when the lineage cannot be proven and the verifier is configured to fail closed.""" pass @dataclass class Attestation: hop_id: str digest: str issuer_nonce: str attested_until: float predecessors: list[str] = field(default_factory=list) # signed refresh edges @dataclass class WarrantProvenance: hop_id: str parent_attestation_digest: str parent_issuer_nonce: str @dataclass class Warrant: warrant_id: str provenance: list[WarrantProvenance] def verify_digest_lineage( warrant: Warrant, presented: dict[str, Attestation], transparency_log_available: bool, fail_closed: bool = True, ) -> None: """Enforce per-hop monotonic attestation lineage for an in-flight warrant. A hop's presented attestation digest must equal the warrant's recorded parent digest, OR be a documented descendant of it (refresh edge present in the transparency log). If the log is unavailable, behavior is governed by fail_closed. """ for prov in warrant.provenance: att = presented.get(prov.hop_id) if att is None: raise AttestationLineageError( f"hop {prov.hop_id}: no attestation presented for warrant " f"{warrant.warrant_id}" ) if att.digest == prov.parent_attestation_digest: continue # exact match: no refresh occurred mid-chain # Digest mismatch: a refresh happened. We must prove descent. if not transparency_log_available: if fail_closed: raise AttestationLineageError( f"hop {prov.hop_id}: digest {att.digest} != warrant parent " f"{prov.parent_attestation_digest}, and transparency log " f"unavailable; failing closed (warrant {warrant.warrant_id})" ) # fail-open path is the original bug; explicitly refuse to pretend # we verified anything. raise AttestationLineageError( f"hop {prov.hop_id}: cannot verify lineage; fail-open is " f"prohibited for attestation continuity" ) if prov.parent_attestation_digest not in att.predecessors: raise AttestationLineageError( f"hop {prov.hop_id}: presented digest {att.digest} does not " f"descend from warrant parent {prov.parent_attestation_digest}; " f"substitution, not refresh (warrant {warrant.warrant_id})" ) # Monotonic watermark check: the refreshed attestation must not have # an earlier attested_until than the epoch it replaces (guards against # replay of an older, longer-lived credential). if att.attested_until <= 0.0: raise AttestationLineageError( f"hop {prov.hop_id}: non-positive attested_until watermark" ) def digest_of(payload: bytes) -> str: return hashlib.sha256(payload).hexdigest() ```