arXiv(opens in a new tab)cs.CESep 2026Cited by 3 papers on PaperVantage

Manuscript Offprint

arXiv:2609.35659

Tracekit: Tamper-Evident Intent-Reasoning-Action Auditing for Autonomous Coding Agents

Bravish Ghosh

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Autonomous coding agents now read untrusted files, run shell commands and spawn sub-agents with little human supervision, yet the record of what they did is usually an editable log of outputs. We present Tracekit, an open-source, dependency-free system that captures three channels for every agent session: what the human asked (intent), what the model said about its own reasoning (self-report), and what it actually executed (actions). These are written to a hash-chained, externally anchorable ledger and cross-checked against each other. Tracekit hooks into Claude Code's lifecycle events, reconstructs multi-agent hierarchies, gates tool calls with a pre-execution policy, accepts events from any other agent through an SDK or HTTP API, and renders a live terminal-style observer that re-verifies the ledger in the browser.

We evaluate Tracekit in five experiments. (1) Across 1,600 random mutations, the chain detects every edit, deletion, reordering, forged insertion and torn write; tail truncation and full re-chaining are invisible to the chain alone and are caught only by anchors, with detection falling to 0.47 at an anchoring interval of 300 records, matching a closed-form model. (2) A hook costs 23.9 ms at the median, flat up to 100,000 ledger records, and the chain stays correct under 16 concurrent writers. (3) A regular-expression gate blocks only 18 of 44 harmful tool calls (41%) while wrongly blocking 3 of 40 benign ones; trivial rewrites evade it. (4) In 14 real Claude Code runs, the agent never acted on any of four planted indirect prompt injections and disclosed every one. The provider withheld the text of all 27 thinking blocks, so self-report was limited to visible prose. (5) Because real agents rarely misbehave, we introduce seeded-fault splicing: inserting concealed misaligned steps into real traces. Over 63 traces and 126 reviewer calls, rule flags caught 40/49 (82%) of faulted traces and an independent LLM reviewer caught 98/98 (100%), with a false-positive rate of 1/14 on unmodified traces. We release the system, evaluation harness and all traces.

1 Introduction

Coding agents such as Claude Code, Codex and Cursor operate as long-running loops: they read a repository, reason, call tools (shell, file edits, network), and increasingly delegate to sub-agents running in parallel. Each step can have side effects outside the repository. At the same time, the text these agents read is attacker-controllable: a README, a code comment or a test's error message can carry instructions aimed at the model, the classic indirect prompt injection [6, 9, 27].

Operators who want to trust such agents face three gaps. First, observability: most tooling records outputs, token counts and latencies for debugging, not a complete, attributable record of every action by every sub-agent. Second, integrity: those logs are ordinary files the agent itself can often write to. Third, explanation: the model’s account of why it acted is not a reliable account of the computation that produced the action. Unfaithful chain-of-thought is well documented [4, 17, 25], and optimising against reasoning monitors can teach models to hide intent [2, 14].

Tracekit takes a deliberately modest position. It does not claim to read a model’s internal state. It treats the self-report as testimony and the executed actions as evidence, records both with the human’s request in a tamper-evident ledger, and makes disagreements between the three channels visible and machine-checkable. Our contributions are:

  1. A three-channel audit design (section 4): hook-level capture of intent, self-report and actions for Claude Code, including sub-agent attribution, with a pre-execution policy gate. Any other agent can join through an SDK and an HTTP ingest API.

  2. A hash-chained ledger with external anchoring and a live observer that re-verifies the chain client-side (sections 4.2 and 4.5).

  3. Seeded-fault splicing, an evaluation method for agent monitors when real agents rarely misbehave (section 5.5).

  4. An empirical study (section 5) with deliberately reported negative results: the limits of syntactic gating, the need for anchors, the unavailability of reasoning text in practice, and what rule-based and model-based cross-checks do and do not catch.

References (34)