# Agent Flight Recorder: Tamper-Evident Audit Trails with On-Chain Anchoring for Long-Horizon Tool-Using Agents

Crypto.world

> Long-horizon agents execute thousands of tool calls over hours or days, so their characteristic failure is a wrong sequence of actions — a deleted production database, a prompt injection that…

**arXiv**: 2609.01931

**Published**: 2026-09-01

**Authors**: Laurent Bindschaedler, Quentin Botha, Christoph Siebenbrunner

## AI summary

## Overview

**Research area:** Cryptography and security for autonomous AI agents — specifically tamper-evident audit logging, Merkle-based integrity proofs, and blockchain (on-chain) anchoring of audit commitments.

**Technical level:** Advanced. The paper assumes fluency in hash chains, Merkle trees, HKDF key derivation, deterministic CBOR serialization, EVM/L2 gas economics, and agent tool-calling frameworks.

**Scope (one sentence):** The paper designs, implements, and empirically evaluates a "flight recorder" that records each action of a long-horizon tool-using agent as a canonically serialized, hash-chained, Merkle-batched event whose epoch roots are anchored on a public chain, so that a third party can verify the record without trusting the operator.

## What This Paper Is About

Long-horizon agents execute thousands of tool calls over hours or days, so their characteristic failure is a wrong *sequence* of actions — a deleted production database, a prompt injection that propagates across agents, an unauthorized privilege escalation — rather than a single wrong answer. Existing agent observability stacks (OpenTelemetry spans, LangSmith, Langfuse, framework callbacks) assume a cooperative operator with mutable internal logs, so they cannot settle disputes in which the operator itself may have tampered with the record. The paper's goal is an evidentiary architecture: capture agent actions in an agent-semantic schema, make them tamper-evident locally, and commit them publicly so any verifier holding the disclosed payload and Merkle proof can check the record independently, with no pre-agreed trusted intermediary.

## Key Contributions

1. **An agent-semantic event schema and tamper-evident audit architecture.** Each event binds eight semantic fields — intent, policy evaluation, human approval, execution, effects, context provenance, code provenance, and delegation provenance — serialized with deterministic CBOR (RFC 8949, §4.2), and composed with SHA-256 hash chaining, Merkle batching, and epoch-root chaining for on-chain anchoring.
2. **A trust-model analysis comparing five anchoring mechanisms** (no anchor, signed digest, transparency log, timestamping authority, on-chain) across six dimensions, identifying the precise conditions under which on-chain anchoring provides unique value over signed digests, transparency logs, and TSAs.
3. **An empirical evaluation across five cumulative ablation configurations** (Baseline, Schema, Chain, Merkle, Full), measuring per-event latency and storage overhead, tamper detection for four attack classes, on-chain anchoring cost measured on Base Sepolia, and forensic query precision on three incident-response scenarios.
4. **A selective-disclosure key hierarchy** using HKDF, so an auditor investigating a few events in an epoch can be given only those events' decryption keys.

## Main Findings

- **Per-event overhead is small relative to I/O.** The Full configuration adds ~48 μs median latency per event and 512 bytes per event. Median latencies across configurations at N = 10K events: Baseline 20.3 μs, Schema 6.0 μs, Chain 48.2 μs, Merkle 48.8 μs, Full 47.6 μs.
- **CBOR is faster but larger than JSON.** Schema (deterministic CBOR) is faster than Baseline (JSON via `json.dumps`) at the median, 6.0 μs vs. 20.3 μs, because CBOR avoids Python's JSON overhead on nested dicts — at the cost of 75% more bytes per event (476 vs. 272).
- **Tail latency is dominated by epoch sealing.** Merkle batching leaves the median nearly unchanged but pushes P99 to ~4.1 ms (4067.6 μs) because every 100th event seals an epoch; the Full configuration adds ECDSA transaction signing and reaches ~30 ms at P99 (30020.9 μs), roughly ~26 ms of signing cost amortized over the epoch and asynchronous in production.
- **Storage grows 88%** from 272 bytes/event (Baseline) to 512 bytes/event (Full), attributable to the structured schema, hash pointers, and epoch metadata.
- **Real-trace validation holds the pattern.** Replaying five SWE-agent trajectories from SWE-bench (38 events total; 47% shell commands, 34% file edits, 18% file reads), Full adds ~14 μs median over Baseline (2.4 μs), with signing overhead at P95; absolute latencies are lower because real events populate fewer fields, and no delegation or approval events appear in coding tasks.
- **Full tamper detection with zero false positives.** Baseline and Schema detect 0% of all attacks. Chain detects edit at 90%, delete at 90%, reorder at 100%, and forks at 0%. Merkle reaches 100% on edit, delete, and reorder but 0% on equivocation. Full reaches 100% on all four, including equivocation/fork. The single Chain miss is the final event (N−1), which has no successor to expose a broken `prev_hash`; the penultimate event (N−2) is caught.
- **Equivocation needs anchoring, not just chaining.** A forked chain is internally valid on each branch, so single-log verification cannot detect it; in the Full configuration each forked epoch produces a root that mismatches the anchor, yielding 100% detection across all ten fork positions.
- **Anchoring cost is trivial on L2.** Mean gas per `anchor()` call is 91,800 (71,680 for the first cold-storage write, 91,976 for warm writes), measured over 100 transactions on Base Sepolia. At 100-event epochs, 100K events cost $6,885 on L1 versus $2.30 on L2 — a 3,000× reduction — and L2 cost is still only $22.95 at 10-event epochs.
- **Cost scales inversely with epoch size, and so does the compromise window.** At epoch size 10 the window is 10 seconds but L1 cost is $68,850; at epoch size 1000 L1 cost is $688.50 but the window widens to ~17 minutes. Cost projections assume 1 event/s, 30 Gwei on L1, 0.01 Gwei on L2, and ETH at $2,500.
- **Structured fields dominate unstructured search in forensics.** Baseline's grep for guardrail evaluations returns 79 matches for one true positive (precision 1.3%, i.e. 0.013), while exact-field lookup achieves 1.0 precision and recall on all five Scenario A queries. On the delegation query, grep matches all 13 delegation events (precision 0.077) versus 1.0 for the relational lookup on `delegation.parent_event`. In Scenario B, grep for "staging" returns two events (precision 0.5) while structured search on `context_provenance.environment` returns exactly one. Baseline cannot reconstruct the causal chain at all (0.0 precision/recall on Q5).
- **Only on-chain anchoring enables neutral verification.** All configurations resolve the Scenario C cross-organizational dispute from the logs, but only Full enables neutral third-party verification; without a public commitment the verifier must trust one party's key or log server.

## Methodology in Plain English

The authors built a ~1,500-line Python prototype with three parts. A **local recorder** intercepts each tool call, serializes it into deterministic CBOR (a byte-exact encoding, so hashes are stable), computes a pointer to the previous event's hash, and appends the record to an append-only store; a single-writer path serializes concurrent calls, and each event carries a monotonic `logical_clock` plus an optional `concurrency_group` tag. An **anchorer** groups every N events into a Merkle tree, computes an epoch root that also chains to the previous epoch root, and submits a 32-byte commitment to an EVM chain through a ~30-line Solidity contract that stores only the root and a back-pointer. A **verifier** takes an event record (or a disclosed payload), a Merkle proof, and an anchor reference, and outputs *verified*, *tampered*, or *incomplete*.

Payloads are stored off-chain and encrypted by default. A master secret derives a per-epoch key via HKDF, which derives per-event keys, so an operator can hand an auditor keys for three specific events without revealing the rest of the epoch.

For evaluation, they generated synthetic workloads of 100, 1K, and 10K tool calls across eight tool categories, with ~15% concurrent events modeled as groups of 2–3, seed 42 for determinism, and 30 runs with different seeds for the latency measurements. They compared five configurations that each add one layer: Baseline (plain JSON, no integrity), Schema (+ CBOR schema), Chain (+ SHA-256 hash chain), Merkle (+ 100-event Merkle batches), and Full (+ on-chain anchoring). They injected four attack types — edit, delete, reorder, and equivocation/fork — at ten positions in a 10,000-event log (eight interior plus the two terminal positions N−2 and N−1). They deployed the contract to Base Sepolia, measured gas over 100 transactions, and swept epoch sizes of 10, 50, 100, 500, and 1000 for a 100K-event workload. Forensic queries were run on three planted incident scenarios. All experiments ran on a single Apple M-series machine with 16 GB RAM and Python 3.11.

Notably, the ablation transition from Baseline to Schema changes both the event structure and the encoding, so those differences reflect the combined effect, not schema alone. The authors also state they did **not** include a non-blockchain integrity baseline (signed digest files or TSA-timestamped logs), leaving head-to-head comparison against deployed alternatives to future work.

## Why This Matters

**Impact on research.** The paper argues that agent audit is a distinct problem from agent observability, and that the cryptographic primitives are standard while the contribution is the agent-semantic integration into an "evidentiary settlement architecture." It provides a measured, ablated baseline — including a negative result (hash chaining alone cannot detect equivocation, and no local layer can) — that later work on agent auditability can build on or contest. It also draws an explicit Schneier–Kelsey boundary: after full host compromise, no system can guarantee the truth of newly written entries, only the integrity of pre-compromise history.

**Real-world applications:**

- **Destructive-action postmortems.** Determining, for a database deletion, which tool call ran, which guardrail evaluated it, and whether a human approved.
- **Prompt injection forensics.** Tracing which retrieved document influenced each downstream action by binding context provenance to every event.
- **Cross-organizational disputes.** Verifying "who asked whom" across agent boundaries with a neutral third party that trusts neither operator, using the delegation provenance field and anchored roots.
- **Regulatory audit trails.** Supporting the EU AI Act's Article 12 mandate for automatic event recording in high-risk AI systems, with selective disclosure balancing accountability against confidentiality (the paper frames this as schema support, not legal sufficiency).

**Industry relevance.** The cost profile is the headline for practitioners: $2.30 per 100K events at 100-event epochs on an L2 makes sub-minute compromise windows practical, and the ~48 μs median overhead fits inside any tool call involving I/O. The authors are explicit about when *not* to use public chains: internal audit can use hash chains with WORM storage, and bilateral relationships with pre-agreed auditors may be better served by a transparency log or TSA on cost and simplicity.

## Future Directions

- **Zero-knowledge inclusion proofs.** Proving that an event occurred and matched a policy without revealing its payload — proposed as a stronger alternative to the current HKDF scheme, which breaks if the auditor obtains the epoch key itself (e.g. via subpoena).
- **Trusted execution environment attestation of the tool gateway.** The paper identifies completeness as a fundamental boundary: actions that bypass the instrumented gateway, and events suppressed within an epoch, are undetectable. Remote attestation would shift the assumption from "the operator did not disable instrumentation" to "the attested code measurement matches a published build."
- **Head-to-head comparison against deployed alternatives.** Implementing signed digest files, transparency logs, and TSA-timestamped logs to measure them empirically against on-chain anchoring, which the paper explicitly leaves as future work.
- **Operationalizing data availability and watchdog monitoring.** On-chain anchoring removes the need to pre-agree on a commitment medium but not the need for an off-chain payload store and disclosure policy; separately, the threat of strategic anchoring delay is noted to require an external watcher, whose design is not specified.

## Target Audience

Security and cryptography researchers working on verifiable logging and blockchain-anchored audit; AI agent safety and reliability engineers who need incident-grade records rather than debugging traces; platform and infrastructure teams building agent middleware who must weigh the ~48 μs and 512-byte-per-event cost against their tool-call latency budget; and compliance, audit, and legal-technology specialists dealing with cross-organizational disputes, prompt-injection forensics, and EU AI Act Article 12 reporting obligations. Readers without background in Merkle proofs, HKDF, or L2 gas economics will find Sections III and IV demanding, though the evaluation tables in Section VI are readable in isolation.

## Authors’ abstract

Long-horizon agents execute thousands of actions, resulting in sequential failures rather than isolated errors. When a coding agent deletes a production database or a prompt injection spreads across agents, the incident raises questions of causality, authority, and non-repudiable third-party verification. The Agent Flight Recorder captures each agent action as a structured, canonically serialized event binding eight semantic fields from intent through execution to…

[The full abstract on arXiv](https://arxiv.org/abs/2609.01931)

[Read the original paper](https://arxiv.org/abs/2609.01931)

---

Canonical: https://crypto.world/paper/agent-flight-recorder-tamper-evident-audit-trails-with-on-chain-2609.01931
