Why does an instance reject a valid signed provenance chain when a peer re-signs an inherited attestation instead of countersigning it?

**Date of Record:** 2026 December 2 **Scope:** Applies to cross-organizational agent handoffs where each hop appends a cryptographic attestation over a decision record and the downstream auditor verifies the full chain. Does not apply to single-tenant chains where one signing key governs every hop, nor to opaque hash-chained logs that are never re-verified by an independent party.

Core Distinction

There are two structurally different ways an agent can add its authority to an inherited decision record, and only one of them preserves lineage:

The failure is non-obvious because both paths produce a chain that *looks* complete to a naive verifier: N hops, N signatures, each cryptographically valid. The divergence only surfaces when the auditor attempts to reconstruct *who asserted what, in which order, under which key at the time*. Re-signing launders provenance: it converts a chain of attributable assertions into a chain of unattributable restatements. The invariant that breaks is **transitive non-repudiation**: a signature at hop *k* must be verifiable against the exact payload that hop *k−1* committed to, not against a semantically equivalent restatement.

What Was Observed

A three-organization workflow: Org A's planner agent emits a decision record `R` (a tool-invocation plan with cost bounds). Org B's executor agent receives `R` over A2A, executes a subset of steps, and appends a delta `D_B`. Org C's auditor agent verifies the lineage before releasing funds.

On the wire, B's executor was configured with a generic "attest result" helper that took a dict, stripped transport metadata, and signed the canonical JSON. That helper's contract was `attest(payload: dict) -> SignedEnvelope`. The executor passed `{**R.claims, **D_B}` — a dict merge. The prior envelope object, including A's signature bytes, was treated as transport metadata and dropped by the serializer before signing.

The resulting chain verified cleanly at C:

The auditor's check was `all(verify(sig_i, canonical(payload_i)) for i in hops)`. It passed. The chain was accepted.

The break appeared only under **replay divergence**: when C independently re-fetched `R` from A's registry (A publishes its signed records), the canonical bytes of `R.claims` at A differed from the canonical bytes B had merged and signed, because B's serializer had reordered keys and normalized a float (`0.1 + 0.2` → `0.30000000000000004` locally, `0.3` in A's canonical form). B's signature was valid over *B's* view of A's claims, not over *A's* claims. C's naive check never compared B's signed payload against A's signed payload — it only checked each signature against its own local payload. The lineage was two independent assertions glued by a shared dict, not a chain.

The decision-relevant consequence: C could no longer prove that the plan B executed was the plan A authorized. It could only prove that B asserted some plan. Non-repudiation collapsed to mutual assertion.

Condition of Validity

The invariant holds if and only if every hop's signed payload contains, as a structural member, the **canonical byte string** (or its collision-resistant digest) of the immediately prior signed envelope, and the verifier enforces linkage rather than mere per-hop validity. Formally, for hop *k*:

payload_k = { "prev": H(envelope_{k-1}), "delta": D_k }
envelope_k = Sign_{k}(canonical(payload_k))

Verification must be **link-checking**, not set-checking:

verify_chain(envs):
    for k in 1..n:
        assert H(envs[k-1]) == envs[k].payload.prev
        assert Verify(envs[k].pubkey, canonical(envs[k].payload), envs[k].sig)

Two preconditions bound this:

  1. **Canonicalization must be pinned and shared.** If hops canonicalize independently (different JSON libraries, float formatting, Unicode normalization), the digest of the same logical record differs across hops and the link check fails — or worse, is skipped to avoid the false negative. The canonicalization function must be part of the protocol contract, versioned, and its identifier carried in the envelope so a verifier rejects chains built under an unknown canonicalizer rather than guessing.
  2. **The prior envelope must be treated as opaque bytes, not parsed.** Any hop that deserializes the prior envelope into a dict and re-serializes it has already lost the byte identity the digest depends on. The prior envelope is a blob; the delta is structured; they are concatenated in a defined framing.

Decision Boundary

The boundary between acceptable re-signing and lineage-destroying re-signing is whether the prior signature is **preserved inside the signed payload** or **discarded before signing**.

The operational test is one line: **does the new signature's signed payload, when hashed, equal the digest of the prior envelope?** If the implementation cannot answer this without re-parsing, it is re-signing, not countersigning.

This boundary is crossed silently whenever an agent framework's default "attest" primitive takes a dict. Dict-taking attestation APIs are structurally incapable of preserving byte identity, because the dict is the parsed form. The failure is not a bug in any single hop; it is an API shape that makes the correct behavior unexpressible.

Operational Effect

Downstream auditors that rely on set-checking verification will accept laundered chains and report false lineage confidence. The failure is invisible until an adversarial or forensic replay compares each hop's signed payload against the upstream registry's canonical bytes — at which point the chain is revealed as a set of independent assertions with no ordering guarantee.

The bounded guardrail is to make linkage the *only* verifiable path: envelopes carry `prev_digest` and `canon_version` as mandatory fields; verifiers reject any envelope whose `prev_digest` does not match the hash of the preceding envelope as received; attestation APIs accept `(prior_envelope: bytes, delta: dict)` rather than a merged dict, so the correct behavior is the default and the incorrect one requires deliberate unwrapping. Chains that fail the link check must be treated as **unattributed**, not as **invalid** — the distinction matters because an unattributed record may still be usable with reduced authority, whereas an invalid signature indicates tampering.

Python

import hashlib
import json
from dataclasses import dataclass


class ProvenanceLinkError(RuntimeError):
    """Raised when a provenance chain fails transitive non-repudiation checks."""


@dataclass(frozen=True)
class Envelope:
    signer: str
    canon_version: str
    prev_digest: str          # hex digest of prior envelope bytes, or "" for genesis
    signed_payload: bytes     # canonical bytes actually covered by sig
    signature: bytes


CANON_VERSION = "cf-json-v1"


def canonical(obj: dict) -> bytes:
    # Pinned canonicalization: sorted keys, no float drift, UTF-8.
    return json.dumps(obj, sort_keys=True, separators=(",", ":"), ensure_ascii=False).encode("utf-8")


def digest(envelope_bytes: bytes) -> str:
    return hashlib.sha256(envelope_bytes).hexdigest()


def countersign(prior: Envelope, prior_bytes: bytes, delta: dict, signer: str, sign) -> Envelope:
    """Correct path: prior envelope preserved byte-exact inside the new payload."""
    payload = {
        "prev": digest(prior_bytes),
        "delta": delta,
    }
    body = canonical(payload)
    return Envelope(
        signer=signer,
        canon_version=CANON_VERSION,
        prev_digest=digest(prior_bytes),
        signed_payload=body,
        signature=sign(body),
    )


def resign_laundered(prior: Envelope, delta: dict, signer: str, sign) -> Envelope:
    """Incorrect path: merges claims, drops prior bytes. Kept to demonstrate the failure."""
    merged = {**json.loads(prior.signed_payload), **delta}
    body = canonical(merged)
    return Envelope(
        signer=signer,
        canon_version=CANON_VERSION,
        prev_digest="",  # linkage deliberately absent
        signed_payload=body,
        signature=sign(body),
    )


def verify_chain(chain: list[tuple[Envelope, bytes]], verify_sig) -> None:
    """
    chain: list of (envelope, envelope_bytes) in hop order.
    Enforces linkage, not merely per-hop signature validity.
    """
    for i, (env, env_bytes) in enumerate(chain):
        if env.canon_version != CANON_VERSION:
            raise ProvenanceLinkError(
                f"hop {i}: unknown canon_version {env.canon_version!r}; refusing to guess canonicalization"
            )
        if not verify_sig(env.signer, env.signed_payload, env.signature):
            raise ProvenanceLinkError(f"hop {i}: signature invalid for signer {env.signer!r}")
        if i == 0:
            if env.prev_digest != "":
                raise ProvenanceLinkError(f"hop 0: genesis envelope must have empty prev_digest")
            continue
        expected = digest(chain[i - 1][1])
        if env.prev_digest != expected:
            raise ProvenanceLinkError(
                f"hop {i}: prev_digest {env.prev_digest[:12]}... does not match "
                f"actual prior digest {expected[:12]}...; chain is unattributed, not invalid"
            )