# What happens when an instance inherits a provenance chain it cannot cryptographically re-derive **Date of Record:** 2026 November 27 **Scope:** Applies to multi-agent systems where each agent emits signed provenance records (warrant + causal parent hash) and downstream auditors reconstruct the chain by re-hashing. Does not apply to single-agent logging, unsigned trace telemetry, or systems where provenance is stored as a mutable append-only ledger with a trusted sequencer. ## Core Distinction There are two structurally different things an auditor can mean by "verify a provenance chain": 1. **Link verification** — each record's signature checks out against the issuer's key, and the parent hash it cites matches the hash of *some* record the auditor holds. 2. **Re-derivation** — the auditor recomputes the canonical serialization of each ancestor record and confirms the hash the child cites is the hash that serialization produces. Most agent frameworks implement (1) and call it (2). The boundary condition is the gap between them: an agent instance can receive a provenance chain whose signatures are all individually valid and whose parent pointers all resolve, yet whose hashes cannot be reproduced because the *serialization* of an ancestor record is not canonical across instances. This is the provenance analogue of a Git commit whose tree hash depends on the machine's newline convention — except here the divergence is caused by probabilistic reasoning, not filesystems. The invariant that fails: **a provenance chain is only audit-grade if every instance in the chain can independently re-derive every ancestor hash from the record's declared content alone.** Signatures prove *who* said it. Only re-derivation proves *what* they said is what the child built on. ## What Was Observed A three-hop tool-using agent pipeline: planner → executor → auditor. The planner emits a plan with a `rationale` field containing free-text reasoning. The executor consumes the plan, emits a tool-call record citing the planner's record hash as `parent`. The auditor reconstructs the chain by re-hashing. The failure trace: - The planner emitted a rationale string. Its provenance record serialized the plan as `json.dumps(plan, sort_keys=True)` and hashed the UTF-8 bytes. Hash `H1`. - The executor received the plan over an MCP transport that normalized the JSON payload — specifically, it round-tripped through a parser that collapsed a `\u00a0` (non-breaking space, which the planner's tokenizer had emitted inside the rationale) into a regular space `\u0020`. The executor's tool call succeeded. Its record cited `parent: H1`. - The auditor, holding the executor's record, tried to re-derive `H1` by re-serializing the plan it received. It got `H1' ≠ H1`. The parent pointer *resolved* (the auditor had a record claiming to be `H1`) but the *content* of that record, when re-canonicalized, produced `H1'`. The chain was link-valid but re-derivation-invalid. The non-obvious part: nothing failed loudly. The executor's signature was valid. The planner's signature was valid. The parent pointer resolved. A link-verifying auditor would have passed the chain. Only an auditor performing re-derivation caught it — and only because it happened to normalize whitespace differently from the transport. This generalizes beyond Unicode. Any of the following cause the same divergence when they occur *between* the emitting instance and the re-deriving instance: - JSON key ordering when the emitter did not sort keys but the transport did. - Float formatting (`0.1` vs `0.10000000000000001`) when a reasoning step's numeric output passed through a different serializer. - Trailing-newline or BOM differences in tool outputs embedded verbatim into a record. - Timestamp precision truncation by an intermediate logging layer. - Field reordering caused by a schema migration applied to one instance's record store but not another's. Each is a *serialization non-determinism* that is invisible at the signature layer and fatal at the re-derivation layer. The probabilistic reasoning of the LLM is the upstream cause in most cases: free-text rationale, sampled numeric outputs, and tokenizer-dependent whitespace are exactly the fields that resist canonicalization, and they are exactly the fields a provenance record most wants to preserve. ## Condition of Validity The re-derivation invariant holds only if, for every record `R` and every instance `I` that holds `R`, `canonicalize(R) → hash` is a pure function of `R`'s declared content, independent of: - the transport that carried `R`, - the parser version on `I`, - the schema version `I` is running, - and the LLM's tokenizer at emit time. This requires the emitter to hash over a **canonical form it commits to explicitly**, not over whatever byte string happened to be in memory. Concretely: the record must carry a `canonicalization` field naming the exact procedure (e.g. `"rfc8785-jcs"` or `"json-sorted-utf8-nfc-v1"`), and the hash must be computed over that procedure's output. The auditor must refuse to re-derive using any procedure other than the one named. The moment an instance re-derives using its *own* default canonicalizer instead of the declared one, the invariant is silently violated — and the violation is indistinguishable from tampering. The condition also requires that free-text fields (rationale, tool output, model reasoning) be **byte-pinned at emit time**: the emitter stores the exact bytes it hashed, not a re-serialization. If the record says `rationale: "step 1\u00a0→ step 2"`, the auditor must hash those exact code points, and the transport must not normalize them. A transport that normalizes is not "lossy" in the usual sense — it is a *provenance adversary*, because it changes the hash-input without changing the signature. ## Decision Boundary The operational decision is: **when an auditor encounters a chain where link verification passes but re-derivation fails, does it treat the chain as valid-but-unverifiable, or as broken?** The correct boundary is to treat it as broken *for audit purposes* and to distinguish two sub-cases by inspecting the declared canonicalization: - **Declared canonicalization matches auditor's, re-derivation still fails** → the content was mutated after signing, or the emitter hashed non-canonical bytes. This is a tamper signal. Halt, quarantine the chain, escalate. - **Declared canonicalization differs from anything the auditor supports, or is absent** → the chain is *unverifiable*, not *invalid*. The auditor cannot conclude tampering; it can only conclude it lacks the procedure. This must be surfaced as a distinct state (`UNVERIFIABLE`), never silently downgraded to `VALID` and never conflated with `TAMPERED`. Conflating these two is the second-order failure: an auditor that treats "I can't re-derive this" as "this is forged" will produce false tamper alarms on every chain that crossed a transport boundary with a different canonicalizer — which, in a heterogeneous swarm, is most of them. An auditor that treats "I can't re-derive this" as "this is fine" will pass forged chains. The boundary must be a three-valued verdict, not a boolean. There is a hard limit here worth stating plainly: if the emitter did not commit to a canonicalization procedure at emit time, no downstream instance can recover the invariant. Re-derivation is not a property an auditor can add after the fact. It must be a property of the *record format*, enforced at the emitting instance, or it does not exist. ## Operational Effect The practical consequence for agent systems: provenance records must be treated as **canonicalization-committed artifacts**, and the emitting instance must be the one that guarantees the commitment. This shifts a burden onto the emitter that is easy to skip and expensive to retrofit: 1. Every record carries an explicit `canonicalization` identifier and a `content_hash` computed over that procedure's output. 2. Free-text and tool-output fields are stored as byte-pinned blobs, not re-serialized on read. 3. Transports that normalize payloads (JSON round-trips, schema migrations, logging layers) must be audited as potential provenance adversaries, because they are the primary source of hash-input drift. 4. Auditors emit three-valued verdicts (`VALID` / `UNVERIFIABLE` / `TAMPERED`) and never collapse `UNVERIFIABLE` into either neighbor. The failure mode this prevents is subtle and specific: a chain that looks intact at every signature check, resolves every parent pointer, and is nonetheless unreconstructable — so that when an incident actually requires audit, the auditor discovers the chain was never re-derivable in the first place, and the moment of discovery is months after the emitting instances have been decommissioned and their exact tokenizer, serializer, and schema versions are gone. At that point the chain is not merely unverifiable; it is permanently so. The invariant must be enforced at emit time precisely because it cannot be enforced at audit time. ```python import hashlib import json from dataclasses import dataclass, field from enum import Enum from typing import Optional class ProvenanceReDerivationError(RuntimeError): """Raised when a provenance chain passes link verification but fails independent re-derivation of an ancestor hash.""" pass class Verdict(Enum): VALID = "valid" UNVERIFIABLE = "unverifiable" TAMPERED = "tampered" # The only canonicalization procedure this auditor supports. A record # declaring anything else is UNVERIFIABLE, never TAMPERED. SUPPORTED_CANONICALIZATION = "json-sorted-utf8-nfc-v1" @dataclass class ProvenanceRecord: record_id: str issuer: str content: dict canonicalization: Optional[str] content_hash: str parent_hash: Optional[str] = None signature_valid: bool = True def canonicalize(content: dict, procedure: str) -> bytes: if procedure != SUPPORTED_CANONICALIZATION: raise ValueError(f"unsupported canonicalization: {procedure}") # Byte-pin: do NOT normalize free-text fields. sort_keys gives stable # key order; ensure_ascii=False preserves exact code points. return json.dumps( content, sort_keys=True, ensure_ascii=False, separators=(",", ":") ).encode("utf-8") def re_derive_hash(record: ProvenanceRecord) -> str: if record.canonicalization != SUPPORTED_CANONICALIZATION: raise ValueError("cannot re-derive with unsupported procedure") return hashlib.sha256( canonicalize(record.content, record.canonicalization) ).hexdigest() def audit_chain(records: list[ProvenanceRecord]) -> Verdict: by_hash = {r.content_hash: r for r in records} for rec in records: # Layer 1: link verification. if not rec.signature_valid: return Verdict.TAMPERED if rec.parent_hash is not None and rec.parent_hash not in by_hash: return Verdict.TAMPERED # Layer 2: re-derivation. The invariant that actually matters. if rec.canonicalization != SUPPORTED_CANONICALIZATION: # We cannot re-derive, but we also cannot conclude tampering. return Verdict.UNVERIFIABLE try: derived = re_derive_hash(rec) except ValueError as exc: raise ProvenanceReDerivationError( f"re-derivation failed for {rec.record_id}: {exc}" ) from exc if derived != rec.content_hash: # Declared procedure matches ours, yet hash diverges: the # content was mutated after signing, or the emitter hashed # non-canonical bytes. This is a tamper signal. raise ProvenanceReDerivationError( f"hash divergence on {rec.record_id}: " f"declared={rec.content_hash} derived={derived}" ) return Verdict.VALID if __name__ == "__main__": # A record whose rationale contains a non-breaking space that a # transport normalized to a regular space before re-derivation. original = ProvenanceRecord( record_id="plan-001", issuer="planner", content={"rationale": "step 1\u00a0-> step 2", "n": 3}, canonicalization=SUPPORTED_CANONICALIZATION, content_hash="", # filled below ) original.content_hash = re_derive_hash(original) mutated = ProvenanceRecord( record_id="plan-001", issuer="planner", content={"rationale": "step 1 -> step 2", "n": 3}, # NBSP normalized canonicalization=SUPPORTED_CANONICALIZATION, content_hash=original.content_hash, # signature still "valid" ) audit_chain([mutated]) # raises ProvenanceReDerivationError ```