Why does an instance accept an A2A artifact whose provenance chain verifies locally but whose signing key was rotated out of the trust window mid-flight?
**Date of Record:** 2026 December 1 **Scope:** Applies to cross-organizational Agent-to-Agent (A2A) artifact transfers where integrity is asserted by a signed provenance chain (each hop co-signs the artifact digest) and the receiver validates that chain against a time-bounded key-trust registry. Does not apply to single-org intra-mesh transfers where all signers share one key-rotation policy, nor to artifacts carried over an authenticated mTLS channel with no per-hop co-signature.
Core Distinction
The failure is not signature forgery and not chain truncation. It is a **temporal disagreement between two clocks that the verifier treats as one**: the *chain-construction time* (when each hop appended its signature, stamped by the signer's clock) and the *validation time* (when the receiver checks each key against its trust window, stamped by the receiver's clock). A provenance chain is only sound if every signing key was inside its trust window **at the moment that hop signed**—but most implementations validate keys against *the receiver's current time*, or against *the artifact's declared creation time*, rather than against *the per-hop signature timestamp bounded by that hop's own key lifetime*.
This produces a non-obvious acceptance: an artifact signed by Org B's key at T−40s, where Org B rotated that key out of the trust registry at T−10s, still validates at the receiver at T because the receiver checks "is key B valid now?" against a registry that *removed* B—and a removed key is ambiguous between "expired, reject" and "unknown, defer." Many verifiers resolve that ambiguity toward acceptance to avoid breaking in-flight transfers.
What Was Observed
A three-hop chain: Org A (originator) → Org B (enricher) → Org C (receiver). Each hop appends `{signer_id, key_id, sig_ts, digest_sig}`. The receiver, Org C, validates the full chain at ingest.
Trace of the failing exchange:
- **T−60s** — Org A signs the artifact digest with key `A/k1`, `sig_ts = T−60s`. A's key `A/k1` is in C's trust registry, valid `[T−3600s, T+3600s]`. Hop A validates cleanly.
- **T−40s** — Org B enriches the artifact, re-signs with key `B/k7`, `sig_ts = T−40s`. At signing time, `B/k7` is valid.
- **T−10s** — Org B's rotation job retires `B/k7` and publishes `B/k8`. The registry update propagates to Org C: `B/k7` is *deleted*, not marked `retired_at`. C's registry now has no entry for `B/k7`.
- **T** — Org C validates the chain. Hop A: `A/k1` present, valid → pass. Hop B: `B/k7` **absent** from registry. The verifier's `lookup(key_id)` returns `None`. The code path for `None` is `if key is None: log("unknown key, deferring to peer trust")` and falls through to **accept**, because the A2A spec C implements treats an unknown key as "the peer's problem" rather than "reject."
- The artifact is admitted with a provenance chain that is *locally self-consistent* (all signatures verify cryptographically) but *globally unsound* (hop B's signature was made by a key C can no longer attribute to Org B).
The dangerous property: **the signature still verifies**. `B/k7`'s public key is embedded in the chain record itself or fetchable from B's JWKS endpoint, so `verify(digest, sig, B/k7_pub)` returns `True`. The chain passes cryptographic verification *and* fails trust attribution, and the verifier conflated the two.
Condition of Validity
The invariant that must hold for a chain to be admissible:
> For every hop *h* with signature timestamp `sig_ts_h` and signing key `k_h`, the receiver must be able to establish that `k_h` was *authorized for signer *h** at time `sig_ts_h`, using a trust record whose validity interval **contains** `sig_ts_h`—not the receiver's `now`.
This requires three things the naive verifier lacks:
- **Retirement, not deletion.** Key rotation must publish `retired_at = T−10s` alongside `B/k7`, so the registry can answer "was `B/k7` valid at `T−40s`?" → **yes** (retirement is after signing). Deleting the key destroys the ability to answer and forces the unknown-key branch.
- **Signer-clock skew bound.** `sig_ts_h` is asserted by the signer. The receiver must accept it only if `|sig_ts_h − receiver_now| ≤ max_skew` (e.g., 300s). Without this, a compromised signer backdates `sig_ts` to land inside a key's historical validity window—reintroducing the key after retirement by claiming the signature predates it.
- **Monotonic chain ordering.** Each hop's `sig_ts` must be `≥` the previous hop's `sig_ts` (within skew). A chain where hop C signs *before* hop B is not a chain; it is a set of unrelated signatures that a confused verifier will happily fold together.
The condition fails specifically when **key lifetime is shorter than the maximum in-flight transfer latency**. If rotation can retire a key faster than a chain can traverse the mesh, every sufficiently slow transfer hits the unknown-key branch. This is the boundary: rotation cadence vs. end-to-end chain latency.
Decision Boundary
The verifier must have a single, explicit resolution for each registry lookup outcome, and the unknown-key case must **not** default to accept:
| Registry result for `k_h` | Condition | Decision | |---|---|---| | Present, `sig_ts_h ∈ [valid_from, valid_to]` | normal | **Accept hop** | | Present, `retired_at` set, `sig_ts_h < retired_at` | late-arriving valid signature | **Accept hop** (signature predates retirement) | | Present, `retired_at` set, `sig_ts_h ≥ retired_at` | signed after retirement | **Reject** — `PostRetirementSignature` | | Present, `sig_ts_h` outside `[valid_from, valid_to]` | not-yet / never valid | **Reject** — `KeyNotValidAtSigningTime` | | Absent (deleted) | registry cannot attribute | **Reject by default**, quarantine; only accept if a signed *retirement attestation* from the signer org vouches for `k_h` at `sig_ts_h` | | `sig_ts_h` violates skew bound vs. receiver clock | backdating attempt | **Reject** — `SignatureTimestampOutOfSkew` | | `sig_ts_h < sig_ts_{h-1}` | chain order violated | **Reject** — `NonMonotonicChain` |
The decision boundary is between *cryptographic verification* (necessary) and *trust attribution* (also necessary, and where the failure lives). A chain that passes `verify()` but lands in any Reject row above must be quarantined, not admitted. The A2A peer must be told *why* (which hop, which key, which timestamp) so it can re-sign with a current key—otherwise the sender retries identically and burns the transfer budget.
Operational Effect
When this boundary is unguarded, the failure is silent and *correlated*: every transfer that straddles a rotation window is admitted with an unattributable hop. Downstream auditors replaying the chain later—after the registry has fully purged the key—cannot distinguish these artifacts from forged ones, because the only thing that would have proven authenticity (the retirement attestation) was never captured at ingest. The provenance chain degrades from a proof to a *claim*.
The guardrail that bounds it: **capture the trust record at ingest, not at replay.** On admission, the receiver must persist, alongside the artifact, a snapshot of each hop's registry entry (including `retired_at` and the signer's JWKS key material) with the receiver's ingest timestamp. This makes the admission decision auditable offline and independent of later registry mutations. Combined with retirement-not-deletion on the signer side and a skew bound on `sig_ts`, the unknown-key branch disappears: there is always a record, and it always answers the "valid at `sig_ts`?" question.
The residual risk is the signer org itself lying about `retired_at` to vouch for a key it should have retired earlier. That is not solvable at the receiver; it is bounded by the signer's own key-management audit and by cross-org trust anchors—which is why the retirement attestation must be signed, and why the receiver records *who* attested, not just *that* someone did.
import time
from dataclasses import dataclass, field
from typing import Optional
class ProvenanceChainError(RuntimeError):
"""Base for all provenance-chain admission failures."""
class UnknownSigningKey(ProvenanceChainError):
"""Key absent from registry and no signed retirement attestation present."""
class PostRetirementSignature(ProvenanceChainError):
"""Hop signed at or after its key's retirement time."""
class KeyNotValidAtSigningTime(ProvenanceChainError):
"""sig_ts falls outside the key's [valid_from, valid_to] interval."""
class SignatureTimestampOutOfSkew(ProvenanceChainError):
"""sig_ts is too far from receiver clock; possible backdating."""
class NonMonotonicChain(ProvenanceChainError):
"""A hop's sig_ts precedes the previous hop's sig_ts."""
@dataclass
class TrustRecord:
key_id: str
signer_id: str
valid_from: float
valid_to: float
retired_at: Optional[float] = None # set on rotation; never delete the record
@dataclass
class Hop:
signer_id: str
key_id: str
sig_ts: float
digest_sig: bytes = b""
@dataclass
class ChainVerifier:
registry: dict[str, TrustRecord] = field(default_factory=dict)
max_skew_s: float = 300.0
def _lookup(self, key_id: str) -> Optional[TrustRecord]:
return self.registry.get(key_id)
def verify_hop(self, hop: Hop, receiver_now: float) -> None:
rec = self._lookup(hop.key_id)
if rec is None:
# Unknown key: reject by default. A signed retirement attestation
# from the signer org is the ONLY path to admit here.
raise UnknownSigningKey(
f"key {hop.key_id} for signer {hop.signer_id} absent from registry; "
f"quarantine pending signed retirement attestation"
)
if rec.signer_id != hop.signer_id:
raise ProvenanceChainError(
f"key {hop.key_id} belongs to {rec.signer_id}, not {hop.signer_id}"
)
if abs(hop.sig_ts - receiver_now) > self.max_skew_s:
raise SignatureTimestampOutOfSkew(
f"hop {hop.key_id} sig_ts={hop.sig_ts} vs now={receiver_now} "
f"exceeds skew {self.max_skew_s}s"
)
if not (rec.valid_from <= hop.sig_ts <= rec.valid_to):
raise KeyNotValidAtSigningTime(
f"key {hop.key_id} not valid at sig_ts={hop.sig_ts} "
f"(window [{rec.valid_from}, {rec.valid_to}])"
)
if rec.retired_at is not None and hop.sig_ts >= rec.retired_at:
raise PostRetirementSignature(
f"key {hop.key_id} signed at {hop.sig_ts} but retired at {rec.retired_at}"
)
def verify_chain(self, chain: list[Hop], receiver_now: float) -> None:
prev_ts: Optional[float] = None
for hop in chain:
if prev_ts is not None and hop.sig_ts < prev_ts:
raise NonMonotonicChain(
f"hop {hop.key_id} sig_ts={hop.sig_ts} precedes prior hop ts={prev_ts}"
)
self.verify_hop(hop, receiver_now)
prev_ts = hop.sig_ts
# --- reproduction of the observed failure ---
now = time.time()
registry = {
"A/k1": TrustRecord("A/k1", "orgA", now - 3600, now + 3600),
# B/k7 rotated out: deleted instead of retired -> triggers unknown-key branch
}
chain = [
Hop("orgA", "A/k1", now - 60),
Hop("orgB", "B/k7", now - 40),
]
verifier = ChainVerifier(registry=registry)
try:
verifier.verify_chain(chain, receiver_now=now)
except UnknownSigningKey as e:
print(f"QUARANTINED: {e}")
# With retirement-not-deletion, B/k7 would carry retired_at=now-10,
# and sig_ts=now-40 < retired_at -> hop admitted as late-arriving-valid.