What structural signals indicate a capability-attestation replay window has collapsed under continuous trust decay in A2A agent cards
**Date of Record:** 2026 December 1 **Scope:** Applies to multi-agent systems where peers discover and authorize each other through signed agent cards (e.g., A2A-style `AgentCard` documents carrying capability claims, issuer signatures, and a continuously recomputed trust score). Does not apply to stateless single-shot tool calls or to systems where capability grants are static ACLs with no time-varying trust component.
Core Distinction
The failure mode that matters is not *signature forgery* — that is a solved, binary problem. It is the **decoupling of a card's cryptographic validity epoch from the trust scorer's decay clock**. A signed agent card asserts a capability set and carries an `iat`/`exp` window and an issuer signature. A continuous trust scorer independently computes `trust(peer, t) ∈ [0,1]` from behavioral telemetry (task success, latency compliance, verification mismatches) and gates whether that card's *claims* are honored. The invariant that must hold is:
> A capability asserted by a card is honored at time `t` **iff** `verify_sig(card) == VALID` **and** `card.iat ≤ t ≤ card.exp` **and** `trust(peer, t) ≥ threshold(capability)`.
These three predicates live in three different subsystems with three different clocks. The non-obvious boundary is when `t` advances past `card.exp` *while the trust scorer is still returning a high score for the peer*. The card is cryptographically dead but behaviorally trusted, and naive implementations honor it anyway — because the trust gate is checked first and short-circuits the epoch check, or because the scorer's cached score outlives the card.
What Was Observed
A three-agent pipeline (planner → executor → auditor) issued executor cards with a 300-second `exp` window, refreshed by re-signing. The trust scorer decayed scores with a 600-second half-life and cached last-known scores for 90 seconds between recomputations. Under normal load the refresh loop ran every 240 seconds and everything reconciled.
Under a latency spike, the refresh loop stalled for 340 seconds. During the stall, the following trace was observed at the auditor:
- Auditor receives executor card with `exp = T+300`, current time `t = T+340`. Signature still verifies (the bytes are untouched).
- Auditor's trust gate evaluates first: `trust(executor, t) = 0.81` — stale, served from the 90s cache last populated at `T+250`, before the behavioral degradation that caused the stall. `0.81 ≥ threshold(0.80)`.
- Because the trust gate passed, the epoch check was skipped by an early-return in the authorization path (the check was ordered `if not trust_ok: deny; else: honor`).
- The executor, whose actual recent behavior had degraded to `~0.55`, was granted write capability and produced three verification-mismatched outputs before the auditor's own replay check caught the divergence.
The structural signal was a **trust-score timestamp (`scored_at`) that was older than the card's `exp`**. That single comparison — `scored_at < card.exp < t` — is the fingerprint of a collapsed replay window: the trust evidence predates the card's death, so the trust verdict is being applied to a claim it was never computed against.
Condition of Validity
The trust score is only a valid co-gate with the card epoch when it is computed against *the same behavioral epoch the card claims to represent*. Formally, the score must satisfy `scored_at ≥ card.iat` **and** `scored_at ≤ min(card.exp, t)`. If the most recent score was computed before the card was even issued, the score describes a *different* agent instance's behavior than the card attests to — the "attestation" is over a stale behavioral snapshot.
This is the continuity invariant: **a trust score is a statement about a peer's behavior over `[scored_at − window, scored_at]`; honoring a card at `t` requires that interval to intersect the card's validity interval and to be recent enough that decay has not silently expired the grant.** When `scored_at < card.iat`, you are authorizing a fresh claim on stale evidence. When `scored_at < card.exp < t`, you are authorizing a dead claim on stale evidence. Both are the same structural bug.
Decision Boundary
The boundary is the **ordering and coupling of the three predicates**, and it is sharp:
- **Fail-closed ordering:** evaluate epoch expiry *before* trust, never after. A card past `exp` is denied regardless of trust, because trust cannot resurrect a cryptographically dead claim. The correct predicate is `sig_valid AND not_expired AND trust_ok`, with `not_expired` evaluated unconditionally.
- **Staleness coupling:** if `t − scored_at > max_trust_staleness`, the score is *unknown*, not *last-known*. Unknown must map to the capability's threshold as a denial, not to the cached value. The 90-second cache is a latency optimization; it must never outlive the card it co-gates.
- **Refresh-race boundary:** when a card is within `refresh_margin` of `exp` (here, 60s) *and* the trust score is within `staleness_margin` of expiry, the peer must be treated as `PENDING_REATTEST` — neither honored nor hard-denied — and the caller must force a synchronous re-score before proceeding. This is the only state in which a capability grant may block on a live re-evaluation rather than a cached verdict.
Below this boundary (fresh card, fresh score) the system is correct. Above it (expired card or stale score) it must deny. The failure lives exactly in the band where one clock has advanced and the other has not, and the authorization path has no representation for "trust evidence and card evidence disagree about which epoch we are in."
Operational Effect
The practical consequence is **silent capability laundering across a decay boundary**: a degraded peer retains elevated privileges for the duration of `max(cache_ttl, refresh_stall)`, and every output it produces during that window carries an authorization stamp that *looks* attested (valid signature, passing trust gate) but is backed by behavioral evidence from before the degradation. Downstream auditors that trust the stamp — rather than re-deriving `scored_at` vs `exp` vs `t` — propagate the laundered grant. The divergence only surfaces when an independent replay check recomputes outputs against ground truth, which is exactly the expensive, late detection you were trying to avoid.
The guardrail is a single mandatory predicate evaluated at every authorization site, with no early-return that can skip it, plus a `PENDING_REATTEST` state that blocks rather than guesses when the two clocks disagree.
from dataclasses import dataclass
from enum import Enum
class AttestationReplayError(RuntimeError):
"""Raised when a capability grant would be honored on evidence whose
behavioral epoch does not intersect the card's validity epoch."""
pass
class Verdict(Enum):
HONOR = "honor"
DENY = "deny"
PENDING_REATTEST = "pending_reattest"
@dataclass(frozen=True)
class AgentCard:
peer_id: str
capabilities: frozenset
iat: float
exp: float
sig_valid: bool
@dataclass(frozen=True)
class TrustScore:
value: float
scored_at: float
def authorize(
card: AgentCard,
score: TrustScore,
capability: str,
now: float,
threshold: float,
max_trust_staleness: float = 90.0,
refresh_margin: float = 60.0,
staleness_margin: float = 30.0,
) -> Verdict:
# Predicate 1: signature — binary, always first.
if not card.sig_valid:
return Verdict.DENY
# Predicate 2: epoch expiry — evaluated UNCONDITIONALLY, before trust.
# A dead card cannot be resurrected by a high trust score.
if now > card.exp:
raise AttestationReplayError(
f"card for {card.peer_id} expired at {card.exp}, now={now}; "
f"trust score (scored_at={score.scored_at}) cannot resurrect it"
)
# Predicate 3: trust evidence must describe the card's behavioral epoch.
if score.scored_at < card.iat:
raise AttestationReplayError(
f"trust score for {card.peer_id} scored_at={score.scored_at} "
f"predates card iat={card.iat}; stale-evidence grant"
)
# Staleness: last-known is NOT a valid verdict beyond the window.
if now - score.scored_at > max_trust_staleness:
return Verdict.PENDING_REATTEST
# Boundary band: card near expiry AND score near staleness -> block, don't guess.
if (card.exp - now <= refresh_margin) and (
max_trust_staleness - (now - score.scored_at) <= staleness_margin
):
return Verdict.PENDING_REATTEST
if capability not in card.capabilities:
return Verdict.DENY
return Verdict.HONOR if score.value >= threshold else Verdict.DENY