arXiv:2611.06563cs.SENov 2026

Manuscript Offprint

arXiv:2611.06563

EPISTEME: Trustworthy Coding Agents Through Tool Call Intent

Sofia Bobadilla, Carmine Cesarano, Raphina Liu, Javier Ron, Martin Monperrus

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

Sofia Bobadilla, Carmine Cesarano, Raphina Liu, Javier Ron, Martin Monperrus KTH Royal Institute of Technology, Stockholm, Sweden

Abstract— Coding agents change software through tool calls. Tool calls mutate the local state. For good? For bad? Nobody knows. Agents never say why a tool call is made. We propose the epistemic agent design, in which the harness guarantees that the model declares why a tool call is made. The harness then records what the command actually did and checks the self-reported declaration against these effects. The result is a journal 1) that can guard calls before they run and 2) that supports audits and forensics. For evaluation, we use ImpossibleBench, whose tasks can be passed only by cheating, and demonstrate that forcing the agents to say why results in exposed cheating. Across 49 reward-hacking runs of two open-weight models, the journal exposed 90%.

Coding agents increasingly change software on their own. An agent is a large language model working in a loop: it receives a task, proposes a tool call, such as running a shell command or editing a file, sees the result, and decides what to do next. The harness runs this loop and executes the tool calls. The model decides; the harness acts.

This is a safety problem. With a tool call, an agent changes the world. Every consequence is mediated through tool calls. On a developer's machine, a single call can delete files, read credentials, or rewrite the tests that sit in the way of the agent. With internet access, the same mechanism reaches beyond the machine: a call can push code, send messages, install packages, call production APIs, or change remote systems, often irreversibly. The more autonomy and connectivity agents have, the more safety rests on what each call does.

Today, tool calls are monitored and audited in three ways: 1) permission rules allow or deny commands by matching their text; 2) logs and transcripts record the calls, and a reviewer reads them after the fact; 3) LLM monitors read the calls and the agent's reasoning to flag suspicious behavior.

All three are fundamentally limited, because a tool call does not carry its intent. Suppose an agent asked to make a failing test suite pass runs sed -i '22 s/^/# /' test.py and then the tests. Was it simply exploring, or did it switch off an assertion it could not satisfy? The command does not say.

Rules or LLM monitors on command text cannot tell

Figure

FIGURE 1. The epistemic harness design, with a journal entry for the sed command from the introduction.

the two apart. Shell commands are open-ended, and the same malicious effect can be written in unboundedly many ways. A log records what happened but not why, so a reviewer must reconstruct intent from effects. Regulated domains such as medical devices, avionics, automotive, and infrastructure, which expect a record of what was done and why, cannot accept agent work at face value.

We propose the epistemic agent design: a coding agent design where the harness refuses to run a command unless the model declares what kind of action it is, and why. The harness guarantees this information is present. From there, the harness can check what the command actually did against the declared intent. We call our implementation EPISTEME.

This design supports automatic checking. The declaration is a claim made by the model; the record of effects is an observation made by the harness. The core value is checking the first against the second: a mismatch between declared intent and observed effects is a signal that no command string or log alone can give. The epistemic declaration can be used online or offline. Online, it acts as a guardrail: the harness can refuse a call by its declared kind before it runs, for example a read-only declaration on a command that looks like an edit. Offline, it acts as forensics: a reviewer, or an automated auditor, replays the recorded declarations and finds the steps whose effects contradict their declared intent.

This paper makes the following contributions:

  • Concept. The epistemic agent design, in which the harness makes intent a mandatory part of every tool call. The declared intent is checked against the observed effects after each call, and can guard calls before they run (online) or be audited afterwards (offline).
  • Evaluation. On ImpossibleBench [1], the journal exposes 44 of 49 reward-hacking runs (90%), and the same journals reveal how each agent works.

Concept: The Epistemic Agent

The epistemic agent makes intent first class in the agent design: intents become part of the tool interface, at the point where the agent acts. A harness specifies each tool's name, short description, and argument schema to the model. A standard shell tool takes a single argument, command.

The epistemic harness adds two required arguments to the shell tool, type and reason, so the model cannot run a command without declaring what kind of act it is and why. Together, they form the call's epistemic declaration.

Figure 1 shows what the epistemic harness does with each tool call. It ① checks that the declaration is well-formed and rejects it otherwise, ② runs the command, ③ records the call's effects by comparing the workspace before and after, ④ checks the declaration against the effects and records each problem as a finding, and ⑤ appends an entry to the journal: the declaration, supplied by the model, next to the effects and findings, produced by the harness.