Manuscript Offprint
arXiv:2611.01930RECEIPT: Measuring and Repairing the Return Assumption of LLM Agents in Web Service Operations
Boyang Yang¹, Ziyao Yang¹, Yu Zhang¹, Duo Chai², Xiaoming Chen³, Haoye Tian⁴
¹Yanshan University, ²Tencent, ³Shenzhen Intelligent Strong Technology Co., Ltd., ⁴Aalto University
LLM agents operate Web infrastructure from the command line and rely on a return assumption, namely that each tool call returns within a bounded time and with its requested action finished. Many commands, however, ask a question before they act, and the agent’s harness either closes the program’s input or keeps it open, for example, as a terminal at which nobody types. With closed input, the program can return status 0 without the requested action. With open input, the program waits until a time limit, and the agent pays in time and tokens. In both cases, the agent can misjudge the command, and leaderboards rank the harness’s input connection together with the LLM. To the best of our knowledge, this paper is the first to measure and repair the return assumption. To measure it, we collect 91,469 production tool calls and 89,047 public agent trajectories, and we test how 8 widely used harnesses launch commands. We also build LITMUS, a catalog of 158 command-line invocations whose requested action we check, and TRIPWIRE, a benchmark of 25 task pairs that differ only in whether a question guards the requested action. To repair the return assumption, we propose RECEIPT, which keeps the input open, reads what each process waits for from system calls, and returns this state to an unmodified agent. A model checker verifies the protocol that orders RECEIPT’s input delivery, interruption, and report.
On LITMUS, closed input causes 11.5% of tested invocations to return status 0 without performing the requested action, and 7 of 8 harnesses close input when no terminal is attached. In real use, public trajectories contain 1,345 calls that wait for input, and production agents issue 2,910 commands that only check whether a process is still alive. On 15 TRIPWIRE task pairs, an unanswered question at a plain terminal multiplies a task’s token use by 2.9, and the input connection moves Llama-3.3-70B from 7th to 3rd place among 8 LLMs. Across 5 LLMs, RECEIPT reduces false claims of success by 73.5% relative to closed input and uses 24.4% fewer tokens than a plain terminal. It reports 85.0% of the tested waits without false positives, and on a second harness with a persistent terminal it completes all 25 tasks whose question guards the requested action. In a commercial agent runtime, RECEIPT’s checks take a median of at most 0.54 milliseconds per shell call. An agent’s reliability therefore depends on what its harness lets it observe as well as on its LLM. Agent builders should report what each tool call did, not only how it ended, and benchmark maintainers should fix and report the input connection before they rank LLMs.
Keywords: LLM agents, Web infrastructure, agent harness, tool execution, process state
Date: November 1, 2026
Correspondence: Haoye Tian

1 Introduction
Agents built on large language models (LLMs) operate Web infrastructure from the command line [5, 27, 34]. They push releases, install dependencies, migrate databases, rotate keys, and restart containers. Many of these commands ask a question before acting, such as a confirmation, a passphrase, or a message in an editor. The agent does not talk

Figure 1 Closed input turns a destructive confirmation into a false success, terminal input turns it into a 30-second wait, and RECEIPT reports it to the agent.
to the program directly. The agent’s execution harness starts the program, chooses the connection that carries the program’s input, and returns the output and exit status to the agent. The harness therefore decides what the question receives.
Closing the input and keeping it open can both lead the agent to misjudge the command. If the harness closes the input, the program reads end of file and takes its default. In the left run of Figure 1, the migration script drops a database and still returns 0, and the agent reports that the rows “are still present”. For a Web service, this return resembles a 200 OK response with an error in its body. In Web operations, such a default can drop production data or create a key without a passphrase. If the harness keeps the input open, nobody answers, and the command waits until a time limit, as in the middle run of the figure. The agent then waits, retries, and pays in time and tokens. Agents choose their next step from tool results [43]. An agent therefore relies on a return assumption, namely that each tool call returns within a bounded time and with its requested action finished.
The return assumption also distorts how LLMs are compared. Benchmarks score the final state [19, 27], but they do not record what the process waited for. A leaderboard therefore ranks the harness’s input connection together with the LLM, and teams use this ranking to choose an LLM. In real use, the same questions stall agents. The public trajectories that we study contain 1,345 calls that wait for input, and 616 of them occur in Web operations tools.
Existing research handles a command before, during, or after execution, but leaves open what the command still waits for when the tool call returns. Before execution, pre-launch checks repair missing non-interactive options [11] or verify a command’s risk [44]. During execution, non-blocking interfaces expose interactive tools [1], and asynchronous execution lets agents continue during delayed calls [16, 32]. After execution, false-success detectors read trajectories [2], postcondition wrappers verify the requested effects [26], and outcome monitors check a result against contracts mined from traces [31]. DeepSeek’s process inspector [9] comes closest, because it checks whether a running process waits on its standard input.
We see 3 gaps in measuring and repairing the return assumption:
① Measurements do not observe the process. Public benchmarks do not design tasks in which a question guards the requested action [19, 27]. A skipped action also returns status 0, so a trajectory classifier [2] and an outcome monitor [31] can read it as a true success. No study shows how often agent commands wait in real use or what each harness does with the wait.
② Detectors read output text or silence. A prompt pattern misses a question that never reaches the output, and an inactivity watchdog ends a command that is still computing. DeepSeek’s inspector sees only standard input, whereas a password prompt reads the terminal.
③ Intervention in a persistent terminal has a race. A harness that types the agent’s keystrokes into a terminal can deliver a queued cd to a script that has just asked, so an intervention needs a fixed order of input, interruption, and report.
We address each gap in this work and build RECEIPT, which returns the process state to the agent, as in the right run of Figure 1. For ①, our catalog LITMUS records the process state of 158 prompting invocations under 3 input connections, and we test 8 harnesses. Our benchmark TRIPWIRE has 25 task pairs, and in each pair only the trap variant asks a question before the requested action. A verifier of the requested effect scores each run, so a skipped action counts as a failure. We also count waits in 91,469 production tool calls and 89,047 public trajectories. For ②, RECEIPT reads from the kernel what each thread waits for and on which descriptor. For ③, we state the order of input, interruption, and report as properties of a finite automaton, and a model checker verifies them.
Our results lead to 3 findings. First, closing input does not make a command safe, because 18 of 156 prompting invocations then return status 0 without performing the requested action. Second, keeping input open has its own costs, because an unanswered question at a plain terminal multiplies token use by 2.9, and a persistent terminal can deliver the agent's next keystroke as the answer. Third, a leaderboard ranks input connections as well as LLMs, since the input connection moves Llama-3.3-70B from 7th to 3rd place among 8 LLMs. Returning the process state reduces these failures without changing the LLM. RECEIPT reports 85.0% of the tested waits without false positives, and across 5 LLMs it reduces the agent's false claims of success from 34 with closed input to 9. On Terminus 2, a second harness with a persistent terminal, RECEIPT completes all 25 trap tasks.
The main contributions of this work are as follows:
- Problem and finding. We define the return assumption and show that it fails under both input connections, so that an agent's reliability depends on what its harness lets it observe as well as on its LLM.
- Measurement of real-world use. The first measurement of input waits in agent use covers 91,469 production tool calls of 6 developers, 89,047 public trajectories of 23 harnesses and 19 LLMs, and 8 harnesses under test.
- Datasets and benchmark. We build LITMUS with 158 checked prompting invocations and WAITATLAS with 4,855 commands from 668 package families. We also build TRIPWIRE, the first benchmark in which a question guards the requested action, with 25 task pairs.
- Solution, validation, and release. RECEIPT identifies from system calls what each process waits for, orders input, interruption, and report through a model-checked protocol, and returns the process state to an unmodified agent. We evaluate it on 2 harnesses and 8 LLMs, compare it with 2 published baselines, and release its detector in a commercial agent runtime.
- RQ-1: What do programs and harnesses do when no person answers? We test 158 prompting invocations under 3 input conditions, process lifetimes under 2 Windows harnesses, and command launches under 8 Linux harnesses.
- RQ-2: How often does an agent wait in real use, and on what? We classify production shell timeouts and measure calls that do not return in 3 public trajectory corpora.
In every corpus, we attribute a wait to the program that asked, either by the prompt in its output or by its process state.
The input connection decides what a program receives when it asks a question. With closed input, a read returns end of file, or EOF, instead of a reply. The tool result does not show whether the program read a reply or EOF. A build and an unanswered question can both end in a timeout, and a skipped action and a completed action can both return status 0.
In this section, Share is the percentage of commands matching a Web-operations kind. Calls not returned is the percentage of observed calls with a timeout, termination, background transition, or continued execution at observation time, and Trials affected is the percentage of trials with such a call. Program outcomes are Hang until termination, Fail
| Closedn = 156 | Pipen = 157 | Terminaln = 125 | |
|---|---|---|---|
| Hang | 14 | 101 | 123 |
| Fail | 81 | 35 | 0 |
| Skip | 18 | 1 | 0 |
| Unasked | 12 | 7 | 0 |
| Unaffected | 31 | 13 | 2 |
Figure 2 Outcomes of the LITMUS invocations without a reply, with counts in each cell and shading by share within each condition.
with non-zero status, Skip with status 0 but no requested action, Unasked actions without confirmation, and Unaffected completion without a reply.
2.1 Programs and Harnesses Without a Person
We record what programs do using 2 types of witness programs that log their own behavior independently of the agent's report. The heartbeat witness logs its start, received signals, normal end, and a heartbeat every 2 seconds. An input witness is a program invoked to open a prompt, editor, or pager. Each input witness runs with closed input, an open pipe to which nobody writes, or a pseudo-terminal at which nobody types. Our catalog LITMUS has 158 invocations of 77 programs in 7 categories: 123 run in Ubuntu 24.04, 2 in WSL, and 33 on Windows, which has no terminal condition. The programs cover 7 categories of questions that command-line programs ask.
To test whether a wait can be predicted before execution, we build WAITATLAS with 4,855 commands from 1,151 programs in 668 package families, including 972 input waits, taken from written examples, tldr-pages¹, and NL2Bash [24]. On held-out program families, the best predictor in Appendix B.8 reaches an average precision of only 0.477 for pipe waits and 0.395 for terminal waits, so a harness needs to detect waits at run time.
We run each of the 158 prompting invocations under closed and pipe input, and under terminal input where a terminal exists. After each run, a post-check decides whether the requested action happened. Each invocation runs 3 times per input condition, and we report the outcome on which the 3 runs agree. Figure 2 counts 156, 157, and 125 invocations under closed, pipe, and terminal input, because the 33 Windows invocations have no terminal, gh auth login contacts github.com without one, and 1 closed-input run has no valid outcome.
As Figure 2 shows, the input condition determines the outcome. With a terminal at which nobody types, almost every invocation hangs. As Table 9 in Appendix B shows, closed input leaves most pagers and interpreters unaffected but makes many invocations in the other categories fail or skip their action.
Closed input turns 18 invocations into status-0 returns without the requested action. docker system prune removes nothing, rm -i and rm -I leave the files, and find -ok and tar -w skip every entry. In 12 further invocations, the
¹https://github.com/tldr-pages/tldr
Table 1 How 8 harnesses launch a shell command on Linux.
| Harness | Input under a terminal | At the limit |
|---|---|---|
| Claude Code [3] | closed | background, 120 s |
| Codex CLI [29] | closed | tool returns, 10 s |
| Gemini CLI [17] | own terminal | SIGTERM, 300 s idle |
| OpenCode [30] | closed | SIGTERM, 120 s |
| mini-SWE-agent [42] | user's terminal | SIGKILL, 30 s |
| Goose [7] | closed, user's tty | none |
| Aider [14] | own terminal | none |
| Terminus 2 [27] | terminal multiplexer | none |
Table 2 Web-operations commands among the 39,985 shell commands of the main agents in the production sessions.
| Kind | Programs | Share |
|---|---|---|
| Version control and pipelines | git, gh, pipeline APIs | 22.9% |
| Remote hosts | ssh, scp, rsync | 13.8% |
| HTTP endpoints | curl, wget | 6.1% |
| Services and servers | systemctl, nginx | 4.6% |
| Containers | docker, kubectl | 3.8% |
| Package registries | apt, npm, pip | 3.8% |
| Databases | psql, mysql, sqlite3 | 3.2% |
| Any kind | 42.3% |
program acts without the confirmation it would have asked for, as ssh-keygen does when it writes a key with an empty passphrase.
Most harnesses close input when no terminal is attached. As Table 1 shows, harnesses select different input connections under a terminal, and without one every harness except Terminus 2 closes the input of a plain command. The 12 prompting invocations that we pass through each harness then fail or return status 0 without waiting. Claude Code also sets GIT_EDITOR=true, so git rebase -i squashes a commit with status 0 and without interactive confirmation. No harness sets DEBIAN_FRONTEND or CI.
A harness can also end a process without notifying the agent. As Tables 11 and 10 in Appendix B show, a witness launched by a Claude Code sub-agent with nohup or & runs to completion. In background mode, the same witness ends when the sub-agent returns.
[RQ-1] Findings: (1) With input closed, 11.5% of the prompting invocations return status 0 without performing the requested action, whereas under a terminal almost every invocation waits. (2) Without an attached terminal, 7 of 8 harnesses close input, and some harnesses end a process without notice. Insight: An agent's tool interface should report what a call did, not only how it ended, because conventions such as an exit status or the absence of output assume a person who watches the program.
2.2 Production Sessions
Our production corpus records how a development team works with coding agents. It contains the local session logs of 6 developers who build and operate a commercial document-review agent. The developers use Claude Code and Codex on Windows and remote Linux across 19 repositories. We analyze main agents and sub-agents in 107 interactive Claude Code sessions over 3 months. After we exclude scripted sessions and deduplicate resumed history, the corpus has 91,469 tool calls, including 52,953 shell calls.
Many of these shell commands operate Web infrastructure. We deduplicate tool-call identifiers before 1 October 2026 and match program names and endpoint patterns for 7 kinds of Web infrastructure. As Table 2 shows, 16,922 of the 39,985 commands of the main agents match at least 1 kind. The programs in 4 of the 7 kinds can change the state of a running service, because they restart services, run containers, install packages, and alter databases.
Table 3 Calls recorded as not returned at each interface's observation time in Terminal-Bench 2.0 [27].
| Terminal | Submissions | Observed calls | Calls not returned | Trials affected |
|---|---|---|---|---|
| Multiplexer [27] | 12 | 205,500 | 6.0% | 56.1% |
| Pseudo-terminal [29] | 3 | 51,924 | 6.6% | 40.2% |
| Shell session [6, 12] | 5 | 60,074 | 2.3% | 21.8% |
| Pipes [3, 17] | 19 | 138,587 | 0.7% | 8.5% |
We have 2 annotators independently classify all 108 production calls that contain a timeout marker, using a written guideline. Cohen's is 0.89, and we report the causes on which both agree.
Many production timeouts are polling loops for unfinished work. The harness ended 81 of the 52,953 shell calls at a time limit. Both annotators identify 27 of the 81 timeouts as loops that the agent wrote to wait for a CI pipeline, a build, or the output file of a background task. The agents also issued 2,910 commands that only check whether a process is alive.
2.3 Public Trajectories
We measure in 3 released corpora how often agent commands do not return. The Terminal-Bench 2.0 [27]² leaderboard has 75 submissions, and 39 of them record each shell call. We group its harnesses by their command interface: terminal multiplexer, pseudo-terminal, persistent shell session, or pipes. SWE-rebench [4]³ runs 111 tasks 5 times each with Claude Code, Codex, Cursor, and 13 LLMs in a common harness, which gives 8,880 trajectories. The submissions of LLM-based repair agents [39, 40] to SWE-bench Verified [19]⁴ give 64,104 trajectories with 1,819,197 shell calls from 111 submissions that run shell commands.
We also replay waits from Terminal-Bench 2.0 to see how launch conditions affect them. The 123 distinct input waits come from 39 tasks, and each replay runs in the task's own container image.
As Table 3 shows, calls are recorded as not returned far more often under a multiplexer or a pseudo-terminal than under pipes.
Waits for input account for 1,345 calls across the 3 public corpora. Corepack's confirmation before it downloads pnpm accounts for 339 of them. git waits for a password, host key, user name, or pager input in 127. Of all these calls, 1,064 wait in a program rather than in the shell, and 616 of those wait in a tool of Web operations, mostly a package manager or git.
Closing input also ends the waits that we replay from Terminal-Bench 2.0. Of the 123 replayed waits, 70 wait again in the task's container, and the 8 environment settings of the harnesses together prevent 30 of them. Closing input ends all 70, and 41 of the commands return status 0. Of these 41, 12 return without doing the command's work, and 6 print a failure that a pipe in the command line masks. In none of the 28 tasks whose waits recur does a confirmation question guard the requested action, so the public tasks cannot score what TRIPWIRE in Section 4 scores.
[RQ-2] Findings: (1) In 3 public corpora, 1,345 calls wait for input, and 616 of them wait in a tool of Web operations. (2) In production, a third of the shell timeouts are loops that the agent wrote to wait for a build or a pipeline. Insight: A harness should show the agent the process state that a person would see on the screen, because an agent that cannot observe this state spends steps and tokens to reconstruct it.
3 RECEIPT: Returning the State
RECEIPT wraps each shell command without changing the agent or the program. RECEIPT's design follows a single principle. The harness returns to the agent the process state that the kernel exposes, and it leaves the decision about the task to the agent. As Figure 3 shows, this principle yields 3 layers. Layer 1 reads from the kernel what each process
²https://huggingface.co/datasets/harborframework/terminal-bench-2-leaderboard
³https://huggingface.co/datasets/ibragim-bad/swe_rebench_07_2026_trajectories
⁴https://github.com/SWE-bench/experiments waits for. Layer 2 lets an input reach a program only in a state that the agent already knows. Layer 3 checks each required order with a model checker and with real processes.
3.1 Layer 1: The Waited-For Object From System Calls
RECEIPT keeps the command's input open and supplies no reply, so a program that asks a question waits instead of reading EOF and taking a default.
A blocked read alone does not identify an input wait, because a read also waits for a file, a pipe, or a socket. RECEIPT therefore samples 3 kernel facts every 0.1 seconds for each thread of the command's process tree: the system call , the set of descriptors that the call waits on, and the CPU ticks of . Let be the inputs that RECEIPT controls, namely the command's input pipe and terminal. Let be the foreign descriptors that another party can make readable, such as a socket or a pipe whose writer is another process. A thread is a candidate wait when
where holds the read and multiplexing calls such as read, poll, and epoll_wait. can grow during a scan. A process that relays an input in through a terminal that it holds, as sudo and script do, adds that terminal to , and RECEIPT evaluates Equation 1 again. A candidate becomes a confirmed wait when it holds for 1 second in which the tree writes no output and uses at most 5 CPU ticks.
For a terminal, RECEIPT also classifies the read. The line-discipline flags and the terminal's screen mode give the reader's class : a line with canonical input and echo, a secret without echo, a key-by-key read without canonical input, and a full-screen read on the alternate screen. The receipt then reports what RECEIPT observed and did. The receipt names the program, gives the last output line as the prompt, states whether RECEIPT ended the local tree, and marks earlier effects as unverified. RECEIPT interrupts only the local process tree, and a deployment can report a wait without interrupting the process, as the agent runtime of Section 5 does.
3.2 Layer 2: The Order of Intervention as an Automaton
A persistent terminal needs an order between the agent's keystrokes and RECEIPT's interruptions. In such a harness, a sender types the agent's keystrokes, and an observer may interrupt at any time. We model each command as an automaton whose state includes . Here is the reader, and seen records whether the agent has observed the reader's question. is the lock that the sender and the observer share, is the log of published receipts, and is the agent's cursor in . The knowledge condition guards every step that sends input:
An input thus reaches a program only after the agent has read every published receipt, including the question of a blocked reader.
Algorithm 1 gives the steps that keep this condition. The sender delivers a keystroke only when holds. As long as a receipt is unread, it defers the keystroke. As long as a blocked reader's question is unseen, the sender holds the keystroke and publishes it with the prompt, so the question reaches the agent before any answer does. In the migration task of Section 4, native Terminus delivers the queued cd command as the script's answer, whereas RECEIPT holds it. The sender also holds an input whose form does not fit the first time it arrives, such as a key name sent as text or a command sent as a passphrase.
The observer interrupts only when no input is in flight. It interrupts a confirmed wait only if the batch schedules no further input, and it rechecks before it signals. A reader that the agent has just answered is reported again instead of interrupted.
Proposition 3.1. In every reachable state of the automaton, no input reaches a reader whose question the agent has not observed, no scheduled input is interrupted before its delivery, no stale input reaches the shell after an interruption, and no receipt reports the wait of a reader that has exited.

Figure 3 RECEIPT in Terminus 2 on the migration task of Figure 1, where the agent has queued cd . . before the question appears, with the receipt that the agent reads.

(a) False successes
(b) Median run time
Figure 4 False successes and median run time of mini-SWE-agent on the TRIPWIRE traps across 5 LLMs and 4 launch conditions.
3.3 Layer 3: Model Checking and Tests on Real Processes
2 model checkers verify Proposition 3.1 on the automaton, and tests on real processes check its rules. A finite state explorer and a TLA+ specification checked with TLC explore every interleaving of the modeled steps of the sender, the observer, the agent, and the program. The program may exit between any 2 steps. Both checkers give the same verdict for every configuration, and both return the shortest counterexample when a rule is removed. The 7 properties are the 4 of Proposition 3.1 and 3 on the order in which the agent observes receipts. Without its rules, the protocol violates 5 of them. With its rules, it violates none, and a reply to a live program, an interruption, and a fresh command after a report stay reachable. Docker tests with real tmx, real processes, and no LLM reproduce 4 of the 7 forbidden orders without the rule and pass with it, in 17 cases. Another 13 cases test the other 3 rules, as Appendix B.5 lists.
4 Evaluation
- RQ-3: What does an unanswered question cost an agent and a leaderboard, and how much does RECEIPT recover? We plug RECEIPT into 2 unmodified harnesses, compare each harness with and without RECEIPT on paired tasks, with 8 LLMs in mini-SWE-agent, and evaluate RECEIPT's detection on LITMUS.
Algorithm 1 The steps of the terminal protocol. The sender and the observer take each step under the lock .
1: procedure SEND(x) 2: if then 3: defer and the rest of the batch 4: else if then 5: hold , append to 6: else if for the first time then 7: hold , append to 8: else 9: deliver 10: end if 11: end procedure 12: procedure OBSERVE(t) 13: if the batch still schedules input then 14: return 15: else if took the agent's answer at its previous read then 16: append to 17: else if is still the waiting call then 18: signal the tree, append to 19: else 20: record a natural exit outside 21: end if 22: end procedure 23: procedure READ 24: , and seen true if reports 's question 25: end procedure
4.1 Benchmark
TRIPWIRE has 25 task pairs on database migration, deployment, asset updates, repository operations, cleanup, and credential handling. mini-SWE-agent runs the first 15 pairs, and Terminus 2 runs all 25. Each pair shares the task text and a verifier, a script that checks the final state and that the agent never sees. The 2 variants differ in a single change, such as a command option, an alias, a configuration file, or the editor that git opens. This change makes the required program ask a question in the trap variant but not in the control variant. In every pair, the question guards the requested action, so an unanswered question changes the final state that the verifier checks. With input closed, the unanswered program of the first 15 pairs skips its action in 7 pairs, proceeds with a forbidden action in 4, fails in 3, and hangs in 1. The last 5 pairs use git rebase -i under nano, a pager before git apply, a whiptail dialog, cp -i, and an openssl passphrase. Table 8 in Appendix B lists the changes and final-state checks of the first 15 pairs.
We plug RECEIPT into 2 unmodified harnesses and compare each harness with and without it. Without RECEIPT, mini-SWE-agent [42] 2.4.6 launches each command with stock docker exec and closed input or with a pseudo-terminal, and with RECEIPT it runs RECEIPT or RECEIPT w/o report. RECEIPT w/o report is the ablation that uses the same detector and interruption rule but returns the output so far with a single-line interruption notice instead of the receipt. Terminal and RECEIPT w/o report attach all 3 standard streams to the terminal, whereas RECEIPT attaches input to a terminal and output to a pipe. We also repeat RECEIPT and RECEIPT w/o report with all 3 streams on the pseudo-terminal. Terminus 2 [27] keeps a persistent terminal in a multiplexer and types the agent's keystrokes into it. Terminus 2 runs natively without RECEIPT, or with RECEIPT or RECEIPT w/o report observing its terminal. The 2 intervention conditions share the detector, the interruption, and the hold rule, and they differ only in the text that the agent reads.
Both harnesses use Qwen2.5-Coder-32B [18] at temperature 0 with a limit of 30 steps per run. mini-SWE-agent limits each command to 30 seconds and runs each variant 3 times. Terminus 2 runs each variant once with a 600-second limit for the agent run. We repeat mini-SWE-agent's 4 launch conditions with Qwen2.5-Coder-7B and 14B, Qwen2.5-72B [38], and Llama-3.1-70B [25], all Instruct versions with the same limits. For the rankings, we add Llama-3.3-70B, Mistral-Small-24B [28], and Gemma-2-27B [15] with the same image and agent prompt. We compare conditions within each task and resample the 15 tasks with their LLMs and repetitions kept together, as Appendix B.7 details.
Table 4 mini-SWE-agent on TRIPWIRE traps across 5 LLMs.
| Condition | Successes | False successes | Median run time | Million tokens |
|---|---|---|---|---|
| Closed input | 153 | 34 | 53 s | 4.4 |
| Terminal | 158 | 28 | 105 s | 10.4 |
| RECEIPT w/o report | 162 | 20 | 66 s | 7.8 |
| RECEIPT | 176 | 9 | 62 s | 7.9 |
4.2 Baselines
Beyond each harness without RECEIPT, we build 3 baselines that use the same tasks, verifiers, and budgets. The text hint keeps terminal input and adds an input-wait message when a rule matches a prompt in the output at the 30-second limit. The verification baseline adds “Before you finish, verify that the task’s goal state holds” to the task, with either closed input or RECEIPT. The post-hoc detector tests whether false successes can be found in the trajectory text after the run. It follows Advani et al. [2]: a TF-IDF classifier over the serialized trajectory, trained on true and false successes with the verifier as the label, and evaluated with each task pair held out.
We also use 2 published techniques as run-time baselines. Panthi et al. [31] use an outcome monitor that checks each returned tool result against contracts mined from task-disjoint traces. When a contract fails, the monitor appends a non-binding notice that names the violated property and lists recovery options. We mine the contracts from the shell calls of 3,464 resolved SWE-rebench trajectories under the cited acceptance rule and attribute a compound command to its first program. The second baseline replaces RECEIPT’s scanner with DeepSeek’s process inspector, and its receipt keeps only the fields that the inspector’s verdict supplies. The inspector checks only standard input, so it does not report a program that reads /dev/tty.
4.3 Metrics
Successes counts verified completions, and False successes counts completion claims failing verification. Control successes and Trap successes give successes over runs of each variant. Median run time covers setup and agent execution, excluding verification, and Tokens sums the prompt and completion tokens of all LLM calls. Appendix B specifies completion claims.
Waits reported counts prompting invocations reported as input waits. Report rate divides this count by prompting invocations. False positives counts controls reported as waits. Median report delay summarizes the elapsed time of reported waits.
Flagged false successes counts false successes among the runs with the highest detector scores at a given flag rate. For input-wait prediction, AUROC is area under the receiver operating characteristic curve, and AP is average precision.
4.4 Detection and Task Recovery
The trap and the control variant of a pair differ only in the question, so their difference is the cost of the question.
Without RECEIPT, an unanswered question makes the agent misjudge the command or pay for the wait. As Table 4 shows, stock mini-SWE-agent with closed input yields the most false successes across 5 LLMs. A post-hoc trajectory classifier flags only 6 of these 34 false successes at a 10% flag rate. Under a plain terminal, the trap runs take 2.6 times the total run time and 2.9 times the tokens of the controls.
As Figure 5 shows, the input connection also reorders the 8 LLMs by trap successes, and Kendall’s between the closed-input and the terminal ranking is only 0.47. Llama-3.3-70B ranks 7th with input closed and 3rd under a plain terminal. Table 13 in Appendix B lists the ranks under all 4 launch conditions. Such waits also occur on a public benchmark, where native Terminus 2 ends 13 trials of the 38 Terminal-Bench 2.0 tasks with recorded waits at a question.
RECEIPT detects these questions from the process state. On the 120 locally runnable Linux invocations of LITMUS that wait under a terminal, its Report rate is 85.0%, compared with 66.7% and 68.3% for the text baselines, at a Median report

Figure 5 Rank of 8 LLMs by trap successes of mini-SWE-agent on TRIPWIRE under closed input and a plain terminal.
Table 5 mini-SWE-agent with Qwen2.5-Coder-32B on TRIPWIRE.
| Condition | Control successes | Trap successes | False successes |
|---|---|---|---|
| Closed input | 45 | 33 | 6 |
| Terminal | 45 | 40 | 2 |
| Terminal + text hint | 44 | 41 | 2 |
| Published baselines | |||
| Outcome monitor [31] | 41 | 30 | 6 |
| DeepSeek inspector [9] | 40 | 35 | 3 |
| RECEIPT w/o report | 44 | 40 | 0 |
| RECEIPT | 45 | 40 | 1 |
delay of 1.1 seconds. The 1-second watchdog is as fast, but it ends 82 of the 119 controls, whereas RECEIPT ends none, as Appendix B.2 details.
Plugged into mini-SWE-agent, RECEIPT lets the agent recover at a lower cost. As Table 4 shows, RECEIPT raises successes from 153 with stock closed input to 176, lowers false successes from 34 to 9, and uses 24.4% fewer tokens than a plain terminal. As Figure 4 shows, it produces fewer false successes than closed input and a shorter median run than a plain terminal with every LLM. Task-paired resampling in Appendix B.7 places the 95% interval of the change in false successes below 0 against closed input, a plain terminal, and RECEIPT w/o report. As Table 6 shows, in separate runs with identical stream connections, the receipt raises trap successes over RECEIPT w/o report from 161 to 174. The receipt raises trap successes or lowers false successes for 4 of the 5 LLMs and worsens neither for any LLM. As Table 5 shows, RECEIPT also has fewer false successes than the text hint, and its median trap run takes 51 seconds against 109 for the text hint. The outcome monitor and the inspector complete fewer trap runs with more false successes.
Plugged into Terminus 2, RECEIPT also removes a failure that a persistent terminal adds. Terminus 2 returns after the agent's chosen delay, so the next scheduled keystroke becomes the answer to the question. As Table 7 shows, RECEIPT completes all 25 trap tasks without a false success, whereas native Terminus completes 17 and RECEIPT w/o report 20. In the migration task of Figure 1, native Terminus feeds the queued cd command to the script's question and rebuilds the database, whereas RECEIPT reports the held text with the question and the agent answers n.
Table 6 Trap successes / False successes of mini-SWE-agent on TRIPWIRE with all 3 streams on the pseudo-terminal.
| LLM | RECEIPT w/o report | RECEIPT |
|---|---|---|
| Qwen2.5-Coder-7B [18] | 21 / 1 | 23 / 1 |
| Qwen2.5-Coder-14B [18] | 31 / 4 | 31 / 2 |
| Qwen2.5-Coder-32B [18] | 39 / 0 | 39 / 0 |
| Qwen2.5-72B [38] | 35 / 8 | 40 / 4 |
| Llama-3.1-70B [25] | 35 / 7 | 41 / 1 |
| All 5 LLMs | 161 / 20 | 174 / 8 |
Table 7 Terminus 2 with Qwen2.5-Coder-32B on TRIPWIRE.
| Condition | First 20 pairs | Last 5 pairs | Control successes | ||
|---|---|---|---|---|---|
| Trap successes | False successes | Trap successes | False successes | ||
| Native | 14 | 2 | 3 | 1 | 25 |
| RECEIPT w/o report | 18 | 1 | 2 | 0 | 24 |
| RECEIPT | 20 | 0 | 5 | 0 | 25 |
[RQ-3] Findings: (1) Without RECEIPT, an unanswered question multiplies token use by 2.9 under a plain terminal, and the input connection changes the ranking of 8 LLMs. (2) RECEIPT reports 85.0% of the tested waits without false positives. (3) Plugged into mini-SWE-agent, RECEIPT reduces false successes by 73.5% across 5 LLMs, and plugged into Terminus 2, it completes all 25 trap tasks. Insight: A benchmark should fix and report its harness's input connection, and an agent builder should improve what the agent observes before replacing the LLM.
5 Deployment and Lessons
RECEIPT runs in 2 deployments at the developers' company. A rule-only monitoring hook has run in a developer's Claude Code since 5 October 2026, over 11,694 shell calls in 41 sessions, without changing any command. We also ported the detector to Rust for the document-review agent runtime, released on Linux and Windows on 9 October 2026 as an opt-in feature. With the feature on, the runtime keeps each shell command's input open and records the detector's verdict for every call. From 10 to 25 October 2026, 14 desktop installs of 12 user accounts logged 1,436 shell calls on Windows, and from 11 to 17 October the Web deployment's server logged 149 on Linux. The detector's checks took a median of 0.11 milliseconds per call on Windows and 0.54 on Linux.
We draw 2 lessons for other teams that run agents against Web services. First, the harness's input connection and time limit decide what a prompting program does and which LLM looks best. Second, the order of input, interruption, and report needs a model checker, because each repair must not block replies or interruptions.
6 Related Work
6.1 Web Agents and Execution Interfaces
Web-agent research measures how agents complete tasks through browser interfaces [10, 20, 45], workplace tasks combine Web interactions with code execution [8, 37], and the choice of the agent's interface to the Web changes success and token use [33]. These studies evaluate the Web's front end, whereas the agents that we study operate its back end through a shell harness.
Other work changes how an agent runs commands. Non-blocking interfaces expose debugger and server prompts [1], and command-text changes are studied before execution [23]. Asynchronous execution lets an agent progress during tool calls [13, 16, 32]. DeepSeek's process inspector [9] checks standard input and the terminal's foreground process group, whereas RECEIPT reads what each process waits for and orders its interventions under a model-checked protocol.
6.2 Command Analysis and Task Verification
Before a command runs, shell analyses predict its effects from system-call traces and annotations [21, 22, 36], repair missing non-interactive options in Dockerfile commands [11], or check its risk patterns [44]. RECEIPT instead checks the running process, including waits with no printed prompt.
Task verification relates execution to the effects that a user requested [41]. State-based tests and developer-written postconditions check these effects [26, 35]. Trajectory classifiers assess completion claims after the run [2], and contracts mined from traces supply recovery hints [31]. RECEIPT provides process-state evidence during execution and needs no task-specific postcondition.
7 Conclusion
In this paper, we study the return assumption and present RECEIPT, which returns the process state to the agent. Our results lead to 3 findings. First, closing input does not make a command safe, because 11.5% of the tested prompting invocations then return status 0 without performing the requested action. Second, keeping input open has its own costs, because an unanswered question multiplies token use by 2.9 and a persistent terminal can deliver the agent's next keystroke as the answer. Third, leaderboards rank input connections as well as LLMs, since the input connection moves Llama-3.3-70B from 7th to 3rd place. Across 5 LLMs, RECEIPT reduces false successes from 34 to 9 and uses 24.4% fewer tokens than a plain terminal. An agent's reliability therefore depends on what its harness lets it observe as well as on its LLM.
References
[1] Talor Abramovich, Meet Udeshi, Minghao Shao, Kilian Lieret, Haoran Xi, Kimberly Milner, Sofija Jancheska, John Yang, Carlos E. Jimenez, Farshad Khorrami, Prashanth Krishnamurthy, Brendan Dolan-Gavitt, Muhammad Shafique, Karthik R. Narasimhan, Ramesh Karri, and Ofir Press. EnIGMA: Interactive tools substantially assist LM agents in finding security vulnerabilities. In Proceedings of the 42nd International Conference on Machine Learning, 2025.
[2] Laksh Advani. From confident closing to silent failure: Characterizing false success in LLM agents. arXiv preprint arXiv:2606.09863, 2026.
[3] Anthropic. Claude Code. https://github.com/anthropics/claudc-code, 2026.
[4] Ibragim Badertdinov, Alexander Golubev, Maksim Nekrashevich, Anton Shevtsov, Simon Karasik, Andrei Andriushchenko, Maria Trofimova, Daria Litvintseva, and Boris Yangel. SWE-rebench: An automated pipeline for task collection and decontaminated evaluation of software engineering agents. In Advances in Neural Information Processing Systems (NeurIPS), 2025.
[5] Joachim Baumann, Vishakh Padmakumar, Xiang Li, John Yang, Diyi Yang, and Sanmi Koyejo. SWE-chat: Coding agent interactions from real users in the wild. arXiv preprint arXiv:2604.20779, 2026.
[6] Bigai. Judy. https://www.bigai.ai/, 2026.
[7] Block. goose. https://github.com/block/goose, 2026.
[8] Thibault Le Sellier de Chezelles, Maxime Gasse, Alexandre Lacoste, Massimo Caccia, Alexandre Drouin, Léo Boisvert, Megh Thakkar, Tom Marty, Rim Assouel, Sahar Omidzi Shayegan, Lawrence Keunho Jang, Xing Han Lü, Ori Yoran, Dehan Kong, Frank F. Xu, Siva Reddy, Graham Neubig, Quentin Cappart, Russ Salakhutdinov, and Nicolas Chapados. The BrowserGym ecosystem for web agent research. Transactions on Machine Learning Research, 2025. URL https://openreview.net/forum?id=5298fKGmv3.
[9] DeepSeek-AI. deepseek-harness. https://github.com/deepseek-ai/deepseek-harness, 2026.
[10] Alexandre Drouin, Maxime Gasse, Massimo Caccia, Issam H. Laradji, Manuel Del Verme, Tom Marty, David Vázquez, Nicolas Chapados, and Alexandre Lacoste. WorkArena: How capable are web agents at solving common knowledge work tasks? In Proceedings of the 41st International Conference on Machine Learning, pages 11642–11662, 2024. URL https://proceedings.mlr.press/v235/drouin24a.html.
[11] Thomas Durieux. Parfum: Detection and automatic repair of Dockerfile smells. arXiv preprint arXiv:2302.01707, 2023.
[12] Feeling AI. CodeBrain. https://feeling-ai.com, 2026.
[13] Romain Froger et al. Gaia2: Benchmarking LLM agents on dynamic and asynchronous environments. arXiv preprint arXiv:2602.11964, 2026.
[14] Paul Gauthier. Aider. https://github.com/Aider-AI/aider, 2026.
[15] Gemma Team. Gemma 2: Improving open language models at a practical size. CoRR, abs/2408.00118, 2024. doi: 10.48550/arXiv:2408.00118.
[16] In Gim, Seung seob Lee, and Lin Zhong. Asynchronous LLM function calling. arXiv preprint arXiv:2412.07017, 2024.
[17] Google. Gemini CLI. https://github.com/google-gemini/gemini-cli, 2026.
[18] Binyuan Hui, Jian Yang, Zeyu Cui, Jiaxi Yang, Dayiheng Liu, Lei Zhang, Tianyu Liu, Jiajun Zhang, Bowen Yu, Kai Dang, An Yang, Rui Men, Fei Huang, Xingzhang Ren, Xuancheng Ren, Jingren Zhou, and Junyang Lin. Qwen2.5-Coder technical report. CoRR, abs/2409.12186, 2024. doi: 10.48550/arXiv:2409.12186.
[19] Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik R. Narasimhan. SWE-bench: Can language models resolve real-world GitHub issues? In International Conference on Learning Representations (ICLR), 2024.
[20] Jing Yu Koh, Robert Lo, Lawrence Jang, Vikram Duvvur, Ming Chong Lim, Po-Yu Huang, Graham Neubig, Shuyan Zhou, Russ Salakhutdinov, and Daniel Fried. VisualWebArena: Evaluating multimodal agents on realistic visual web tasks. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics, pages 881–905, 2024. doi: 10.18653/v1/2024.acl-long.50.
[21] Evangelos Lamprou, Seong-Heon Jung, Mayank Keoliya, Lukas Lazarek, Konstantinos Kallas, Michael Greenberg, and Nikos Vasilakis. Caruca: Effective and efficient specification mining for opaque software components. arXiv preprint arXiv:2510.14279, 2025.
[22] Lukas Lazarek, Evangelos Lamprou, George Kapetanakis, Eric Zhao, Zhiwen Zheng, Michael Greenberg, Konstantinos Kallas, and Nikos Vasilakis. Ahead-of-time analysis of shell program effects. In Proceedings of the ACM Symposium on Operating Systems Principles, 2026.
[23] Shangao Li, Yao Zhang, Volker Tresp, and Yuanyuan Yang. QuoteBench: How matched scores can hide command-path failures. arXiv preprint arXiv:2608.13547, 2026.
[24] Xi Victoria Lin, Chenglong Wang, Luke Zettlemoyer, and Michael D. Ernst. NL2Bash: A corpus and semantic parser for natural language interface to the linux operating system. In Proceedings of the International Conference on Language Resources and Evaluation, 2018.
[25] Llama Team. The Llama 3 herd of models. CoRR, abs/2407.21783, 2024. doi: 10.48550/arXiv:2407.21783.
[26] Isham Kalappurackal Mansoor, Abhishek Phadke, and Pratip Rana. Verified tool calls improve LLM agent reliability under non-atomic failures. arXiv preprint arXiv:2608.02645, 2026.
[27] Mike A. Merrill, Alexander Glenn Shaw, Nicholas Carlini, Boxuan Li, Harsh Raj, Ivan Bercovich, Lin Shi, Jeong Yeon Shin, Thomas Walshe, Estefany Kelly Buchanan, Junhong Shen, Guanghao Ye, Haowei Lin, Jason Poulos, Maoyu Wang, Marianna Nezhurina, Di Lu, Orfeas Menis-Mastromichalakis, Zhiwei Xu, Zizhao Chen, Yue Liu, Robert Zhang, Leon Liangyu Chen, Anurag Kashyap, Jan-Lucas Uslu, Jeffrey Li, Jianbo Wu, Minghao Yan, Song Bian, Vedang Sharma, Ke Sun, Steven Dillmann, Akshay Anand, Andrew Lanpouthakoun, Bardia Koopah, Changran Hu, Etash Kumar Guha, Gabriel H. S. Dreiman, Jiacheng Zhu, Karl Krauth, Li Zhong, Niklas Muennighoff, Robert Amanfu, Shangyin Tan, Shreyas Pimpalgaonkar, Tushar Aggarwal, Xiangning Lin, Xin Lan, Xuandong Zhao, Yiqing Liang, Yuanli Wang, Zilong Wang, Changzhi Zhou, David Heineman, Hange Liu, Harsh Trivedi, John Yang, Junhong Lin, Manish Shetty, Michael Yang, Nabil Omi, Negin Raoof, Shanda Li, Terry Yue Zhuo, Wuwei Lin, Yiwei Dai, Yuxin Wang, Wenhao Chai, Shang Zhou, Dariush Wahdany, Ziyu She, Jiaming Hu, Zhikang Dong, Yuxuan Zhu, Sasha Cui, Ahson Saiyed, Arinbjörn Kolbeinsson, Christopher Michael Rytting, Ryan Marten, Yixin Wang, Jenia Jitsev, Alex Dimakis, Andy Konwinski, and Ludwig Schmidt. Terminal-Bench: Benchmarking agents on hard, realistic tasks in command line interfaces. In International Conference on Learning Representations, 2026.
[28] Mistral AI. Mistral-Small-24B-Instruct-2501. https://huggingface.co/mistralai/Mistral-Small-24B-Instruct-2501, 2025.
[29] OpenAI. Codex CLI. https://github.com/openai/codex, 2026.
[30] OpenCode. OpenCode. https://opencode.ai, 2026.
[31] Sugam Panthi and Rabab Abdelfattah. Outcome monitors: Recovery affordances for silent tool failures. arXiv preprint arXiv:2608.19303, 2026.
[32] Kou Shi, Ziao Zhang, et al. AsyncTool: Evaluating the asynchronous function calling capability under multi-task scenarios. arXiv preprint arXiv:2605.27995, 2026.
[33] Aaron Steiner, Ralph Peeters, and Christian Bizer. MCP vs RAG vs NLWeb vs HTML: A comparison of the effectiveness and efficiency of different agent interfaces to the web. In Proceedings of the ACM Web Conference 2026, pages 8493–8496. ACM, 2026. doi: 10.1145/3774904.3792893.
[34] Ningzhi Tang, Chaoran Chen, Gelei Xu, Yiyu Shi, Yu Huang, Collin McMillan, Tao Dong, and Toby Jia-Jun Li. How coding agents fail their users: A large-scale analysis of developer-agent misalignment in 20,574 real-world sessions. arXiv preprint arXiv:2605.29442, 2026.
[35] Harsh Trivedi, Tushar Khot, Mareike Hartmann, Ruskin Manku, Vinty Dong, Edward Li, Shashank Gupta, Ashish Sabharwal, and Niranjan Balasubramanian. AppWorld: A controllable world of apps and people for benchmarking interactive coding agents. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics, pages 16022–16076, 2024. doi: 10.18653/v1/2024.acl-long.850.
[36] Nikos Vasilakis, Konstantinos Kallas, Konstantinos Mamouras, Achilles Benetopoulos, and Lazar Cvetković. PaSh: Light-touch data-parallel shell processing. In Proceedings of the European Conference on Computer Systems, 2021.
[37] Frank Fangzheng Xu, Yufan Song, Boxuan Li, Yuxuan Tang, Kritanjali Jain, Mengxue Bao, Zora Zhiruo Wang, Xuhui Zhou, Zhitong Guo, Murong Cao, Mingyang Yang, Hao Yang Lu, Amaad Martin, Zhe Su, Leander Maben, Raj Mehta, Wayne Chi, Lawrence Jang, Yiqing Xie, Shuyan Zhou, and Graham Neubig. TheAgentCompany: Benchmarking LLM agents on consequential real world tasks. In Advances in Neural Information Processing Systems, 2025.
[38] An Yang, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chengyuan Li, Dayiheng Liu, Fei Huang, Haoran Wei, Huan Lin, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Yang, Jiaxi Yang, Jingren Zhou, Junyang Lin, Kai Dang, Keming Lu, Keqin Bao, Kexin Yang, Le Yu, Mei Li, Mingfeng Xue, Pei Zhang, Qin Zhu, Rui Men, Runji Lin, Tianhao Li, Tingyu Xia, Xingzhang Ren, Xuancheng Ren, Yang Fan, Yang Su, Yichang Zhang, Yu Wan, Yuqiong Liu, Zeyu Cui, Zhenru Zhang, and Zihan Qiu. Qwen2.5 technical report. CoRR, abs/2412.15115, 2024. doi: 10.48550/arXiv.2412.15115.
[39] Boyang Yang, Zijian Cai, Fengling Liu, Bach Le, Lingming Zhang, Tegawendé F. Bissyandé, Yang Liu, and Haoye Tian. A survey of LLM-based automated program repair: Taxonomies, design paradigms, and applications. CoRR, abs/2506.23749, 2025. doi: 10.48550/arXiv.2506.23749.
[40] Boyang Yang, Haoye Tian, Jiadong Ren, Shunfu Jin, Yang Liu, Feng Liu, and Bach Le. Enhancing repository-level software repair via repository-aware knowledge graphs. CoRR, abs/2503.21710, 2025. doi: 10.48550/arXiv.2503.21710.
[41] Boyang Yang, Zhenhao Li, Ziyao Yang, Kanghui Jia, Xin Yin, Mingmou Liu, and Haoye Tian. Do tool calls execute as intended? measuring and repairing intent-execution correspondence in LLM agents. CoRR, abs/2610.04375, 2026. doi: 10.48550/arXiv.2610.04375.
[42] John Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. SWE-agent: Agent-computer interfaces enable automated software engineering. In Advances in Neural Information Processing Systems, 2024.
[43] Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik R. Narasimhan, and Yuan Cao. ReAct: Synergizing reasoning and acting in language models. In International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=WE_vluYUL-X.
[44] Wenxiao Zhang, Yu Liu, Zhiwei Yang, Zhongyi Zhang, Hanqi Feng, Xinyu Wang, Peng Qiu, Yanbing Liu, Barnabás Póczos, and Jin B. Hong. CARE: Pre-execution command verification for shell-executing LLM agents. CoRR, abs/2607.21642, 2026. doi: 10.48550/arXiv.2607.21642.
[45] Shuyan Zhou, Frank F. Xu, Hao Zhu, Xuhui Zhou, Robert Lo, Abishek Sridhar, Xianyi Cheng, Tianyue Ou, Yonatan Bisk, Daniel Fried, Uri Alon, and Graham Neubig. WebArena: A realistic web environment for building autonomous agents. In International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=oKn9c6ytLx.
A Threats to Validity
Internal validity. Agent runs vary, so a difference between conditions could arise by chance. We therefore fix the temperature at 0, run each mini-SWE-agent variant 3 times, and compare conditions on the same task pairs with task-paired resampling. The 2 intervention conditions also connect output differently. With identical stream connections in Table 6, the receipt still raises trap successes and lowers false successes.
Construct validity. An agent's completion claim or a status-0 return can misreport what a command did. We therefore log process behavior with witnesses independent of the agent and decide task success with final-state verifiers hidden from the agent. Manual labels could depend on the annotator. We have 2 annotators label the production timeouts independently from a written guideline, and we report only the labels on which both agree.
External validity. Our findings may not hold for other harnesses and LLMs. We therefore measure public trajectories of 23 harnesses and 19 LLMs, test launches under 8 Linux and 2 Windows harnesses, and run TRIPWIRE with 8 LLMs from 4 families on 2 harnesses with different terminal designs. A benchmark written together with the detector could also favor RECEIPT. We therefore froze the detector before we wrote the last 10 of the 25 task pairs, and RECEIPT completes all 10 on Terminus 2.
Ethics and safety. We run every program that changes a system in a container or a scratch directory, and the WAITATLAS and RECEIPT containers have no network access. The production sessions are logs from 6 company developers who agreed to the analysis, and we do not release their text.
B Details of the Study Design and Further Results
Table 8 Differences between the control and trap variants, and the verification target, for the first 15 TRIPWIRE task pairs.
| Task and program | Control → trap | EOF outcome | Verifier target |
|---|---|---|---|
| Cleanup, written script | Assume yes → request confirmation | Skip | Build cache absent |
| Amend.git | Editor true → vim | Hang | Clean tree, both files in HEAD, same message and commit count |
| Configure, written script | Positional profile → -profile or menu | Proceed | Release profile selected |
| Decrypt, written script | Passphrase file → /dev/tty | Fail | Expected secrets file produced |
| Deploy, written script | Positional target → -target or prompt | Proceed | Staging version updated, production version preserved |
| Prune, find | -exec → -ok | Skip | No temporary files, 3 CSV files remain |
| Stage, git add | Whole-file staging → -p | Skip | Required source changes staged, no new commit |
| Clean, git clean | -df → -di | Skip | Clean working tree, build directory retained |
| Migrate, written script | Extra column triggers a rebuild prompt | Proceed | New column present, the 3 original rows unchanged |
| Purge, rm | Alias rm -f → rm -i | Skip | No rotated logs, both active log files exist |
| Protect key, ssh-keygen | Supplied passphrase → omit -N | Proceed | Key accepts supplied passphrase, rejects empty passphrase |
| Rotate key, ssh-keygen | Old key absent → overwrite prompt | Fail | Matching new key pair with a changed fingerprint |
| Extract, tar | -xzf → -xwzf | Skip | Expected version and helper file present |
| Update assets, unzip | Destination files absent → existing files | Fail | New version markers in script and style, index exists |
| Select tool, update-alternatives | -set → -config | Skip | Selected executable reports the required version |
Table 9 Outcome of the LITMUS prompting invocations per category and input condition.
| Category | Closed | Pipe | Terminal | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Hang | Fail | Skip | Unasked | Unaffected | Hang | Fail | Skip | Unasked | Unaffected | Hang | Fail | Skip | Unasked | Unaffected | |
| Confirmation | 2 | 29 | 10 | 5 | 1 | 34 | 8 | 0 | 4 | 1 | 30 | 0 | 0 | 0 | 1 |
| Credential | 4 | 26 | 0 | 2 | 0 | 20 | 13 | 0 | 0 | 0 | 28 | 0 | 0 | 0 | 0 |
| Interpreter | 1 | 2 | 1 | 0 | 17 | 19 | 2 | 0 | 0 | 0 | 14 | 0 | 0 | 0 | 0 |
| Editor | 5 | 9 | 2 | 1 | 0 | 7 | 8 | 1 | 1 | 0 | 15 | 0 | 0 | 0 | 0 |
| Pager | 0 | 0 | 0 | 0 | 13 | 1 | 0 | 0 | 0 | 12 | 10 | 0 | 0 | 0 | 1 |
| Wizard | 2 | 8 | 0 | 3 | 0 | 8 | 3 | 0 | 2 | 0 | 13 | 0 | 0 | 0 | 0 |
| Menu | 0 | 7 | 5 | 1 | 0 | 12 | 1 | 0 | 0 | 0 | 13 | 0 | 0 | 0 | 0 |
B.1 Corpus and Scoring Details
The 39 Terminal-Bench 2.0 submissions that record each shell call cover 23 harnesses in 16,063 trials. Of their 557,909 shell calls, 486,879 run commands and 456,085 have observed outcomes. The 37 single-LLM submissions among them cover 19 LLMs. In these submissions, a multiplexer command is text sent to a shell prompt and submitted with Enter. Public-command replays restore the preceding commands before changing the waiting command's input. Each input-witness run has an 8-second limit. On Windows, we use Claude Code 2.1.286 with Git Bash and headless Codex CLI 0.153.4 with PowerShell.
Table 10 Lifetime matrix under Codex CLI [29] 0.153.4 in headless mode.
| Launch | True outcome | Agent's answer |
|---|---|---|
| foreground | killed at 10-14 s of 100 s | "still running" |
| Start-Job | did not start | "unknown" |
| Start-Process | outlives the session, completes | "unknown" |
| cmd start /b | outlives the session, completes | "still running" |
| bash nohup & | outlives the session, completes | "still running" |
Table 11 Lifetime matrix under Claude Code [3] 2.1.286.
| Launcher | Launch | Outcome | Notice |
|---|---|---|---|
| main | harness background | completes | yes |
| main | foreground past limit | background, completes | yes |
| main | shell background | completes | no |
| sub-agent | harness background | killed at 2-6 s of 150 s | no |
| sub-agent | nohup or & | completes | no |
In the Linux launch comparison, each harness talks to a scripted LLM server. In Ubuntu 24.04, we test Claude Code 2.1.292, Codex CLI 0.160.1, Gemini CLI 0.63.0, OpenCode 1.18.35, mini-SWE-agent 2.4.6, Aider 0.86.2, Goose 1.30.0, and Terminus 2 from Harbor 0.24.0. We also pass 12 prompting invocations through each harness.
Claude Code's Bash tool closes input for a plain command but supplies an open pipe when the command contains a here-document. In the production sessions, 18.5% of the 34,891 Bash calls contain a here-document.
Completion scoring distinguishes a failure report from an unsupported success claim. In every mini-SWE-agent condition, the task requests a final STATUS: DONE or STATUS: NOT DONE. We use the last status and count a submission without a status as a completion claim. An error or step-limit termination without submission is not a claim. A submitted STATUS: NOT DONE is not a false success even when verification fails. For Terminus 2, a completion claim requires mark_task_complete in the final step after an earlier completion call. A Terminus 2 success requires the target final state, whether or not the named script runs.
Table 12 Successes / False successes / Median run time in seconds of mini-SWE-agent on the 15 TRIPWIRE traps.
| LLM | Closed | Terminal | w/o report | RECEIPT |
|---|---|---|---|---|
| Qwen2.5-Coder-7B [18] | 26 / 5 / 43 | 25 / 7 / 78 | 21 / 1 / 112 | 26 / 0 / 55 |
| Qwen2.5-Coder-14B [18] | 29 / 7 / 62 | 31 / 4 / 211 | 31 / 4 / 80 | 32 / 2 / 68 |
| Qwen2.5-Coder-32B [18] | 33 / 6 / 109 | 40 / 2 / 111 | 40 / 0 / 57 | 40 / 1 / 51 |
| Qwen2.5-72B [38] | 35 / 10 / 47 | 33 / 6 / 102 | 35 / 8 / 63 | 38 / 6 / 66 |
| Llama-3.1-70B [25] | 30 / 6 / 52 | 29 / 9 / 99 | 35 / 7 / 66 | 40 / 0 / 62 |
| All 5 LLMs | 153 / 34 / 53 | 158 / 28 / 105 | 162 / 20 / 66 | 176 / 9 / 62 |
| Llama-3.3-70B [25] | 25 / 14 / 39 | 32 / 4 / 81 | 34 / 4 / 49 | 32 / 7 / 51 |
| Mistral-Small-24B [28] | 32 / 6 / 47 | 29 / 5 / 121 | 37 / 1 / 46 | 37 / 2 / 53 |
| Gemma-2-27B [15] | 9 / 13 / 22 | 11 / 2 / 183 | 31 / 1 / 26 | 25 / 0 / 33 |
The 3 LLMs below the total of Table 12 ran with the same image and agent prompt. These LLMs enter only the rankings of Table 13. Gemma-2-27B ran on vLLM 0.10.1 with the system message at the start of the first user turn.
B.2 Detector Components Under a Common Launch
The text baselines are a prompt-pattern rule and a classifier using short character sequences, both reading the last 160 characters of a tool result. The inactivity watchdog ends a command after 1, 3, or 5 seconds without output, run 2 times per threshold under a terminal with an 8-second hard cap. The 119 controls include long computations, sleeps, network waits, and pagers that print and exit. Of the 18 waits that RECEIPT does not report under a terminal, 15 exit or act without waiting under RECEIPT's launch, and 3 are npm commands that draw a spinner while they wait.
Table 13 Rank of each LLM by trap successes of mini-SWE-agent on 15 TRIPWIRE task pairs under each launch condition.
| LLM | Closed | Terminal | w/o report | RECEIPT |
|---|---|---|---|---|
| Qwen2.5-72B [38] | 1 | 2 | 3 | 3 |
| Mistral-Small-24B [28] | 3 | 5 | 2 | 4 |
| Qwen2.5-Coder-32B [18] | 2 | 1 | 1 | 1 |
| Llama-3.1-70B [25] | 4 | 5 | 3 | 1 |
| Qwen2.5-Coder-14B [18] | 5 | 4 | 6 | 5 |
| Qwen2.5-Coder-7B [18] | 6 | 7 | 8 | 7 |
| Llama-3.3-70B [25] | 7 | 3 | 5 | 5 |
| Gemma-2-27B [15] | 8 | 8 | 6 | 8 |
Table 14 Waits reported and False positives under RECEIPT on the Linux invocations of LITMUS.
| Outcome with input closed | n | Pipe | Terminal |
|---|---|---|---|
| Skip | 14 | 13 | 14 |
| Unasked | 10 | 4 | 5 |
| Hang | 7 | 7 | 7 |
| Fail | 68 | 51 | 63 |
| Unaffected | 20 | 13 | 12 |
| No outcome with input closed | 1 | 1 | 1 |
| All prompting invocations | 120 | 89 | 102 |
| Controls: False positives | 119 | 1 | 0 |
We compare DeepSeek’s inspector at commit d743267 with RECEIPT’s scanner on 120 prompting invocations and 119 controls. Both components inspect each invocation at 1, 3, and 7 seconds in 2 repetitions, with an 8-second cap and no interruption upon detection. RECEIPT requires input-wait system calls, and DeepSeek checks foreground process groups and stdin waits. At 7 seconds, RECEIPT alone confirms 37 invocations, and DeepSeek alone reports 1.
B.3 Baseline Details
Both baselines used the tasks and limits of Table 5. With the verification instruction, closed input completes 35 of the 45 trap runs with 5 false successes, and RECEIPT completes 39 with 1 false success. With strict attribution of a result to a single program, the contracts cover 97 of the 2,709 commands in the 450 closed-input runs of the 5 LLMs and produce no notice. With attribution to the first program, they produce a notice in 68 of the 225 trap runs and 57 of the 225 control runs, and in 8 of the 34 false successes.
B.4 Native Windows Backend
The Windows backend applies the same wait-confirmation rule through a Job Object and pending NtReadFile calls on the controlled pipe. On x64 Windows 11, 26 native cases with cmd, Windows PowerShell, Python, and Node.js give the expected outcome in every case.
B.5 Protocol Model and Tests
The automaton of Section 3 has a sender, an observer, a single lock, a cursor that the agent advances when it reads a receipt, and a single program per epoch that may block, exit, or survive a signal. The sender and the observer take the lock for a check and the action that follows it, and the program may exit between any 2 steps. When the program exits between the observer’s confirmation and the observer’s signal, the recheck finds the reader gone, sends no signal, and records a natural exit outside the receipt log. The model treats the recheck and the signal as a single step and starts each command with a single blocked reader. TLC checks the 7 properties as invariants of the TLA+ specification over 499 states. Without its rules, the protocol violates 5 of the 7 properties, and with the first 5 rules it violates none. A second TLA+ module checks the last 2 rules on a single reader that asks 4 questions. Its 2 invariants forbid an interruption at a question whose report the agent has not read and the delivery of a mismatched input before the agent has read the reason. The protocol without these rules violates the invariants in 145 states, and the final protocol satisfies them in all 114 reachable states. Table 15 lists the 7 forbidden orders, the rule for each, and its Docker test with real tmx and processes.
Table 15 The 7 orders the terminal protocol forbids, the rule for each, and its test.
| Forbidden order | Rule | Test |
|---|---|---|
| Stale input after an interruption reaches the shell | Sender and observer share a single lock, and the sender defers input published after the agent's last observation | input_guard, 3 cases |
| A scheduled input is interrupted before delivery | The observer pauses while the batch still schedules input | queued_input, 2 cases |
| A receipt reports a wait of a program that exited by itself | The observer rechecks the reader's system call under the lock before it signals | exit_race, 8 cases |
| A scheduled keystroke answers a prompt the agent has not seen | The sender holds the keystroke, records it with the prompt, and the program keeps waiting | hold_on_prompt, 4 cases |
| A receipt published after the observation defers the agent's next batch | The observation of a batch waits for a pending candidate wait, at most 1.2 s | await_receipt, 4 cases |
| A keystroke whose form does not fit the reader's class is delivered | The sender holds it once with the reason and delivers it when sent again | state_receipt, 6 cases |
| A reader the agent has just answered is interrupted | The observer reports it again and interrupts only after the agent reads that report | state_receipt, 3 cases |
B.6 Returned Observation Under Matched Streams
With all 3 standard streams on the same pseudo-terminal and the same detector, interruption rule, task pairs, and budgets, RECEIPT w/o report and RECEIPT differ in the returned text. With Qwen2.5-Coder-32B over 3 repetitions, both complete all 45 controls with no false success, and their median trap runs take 46 seconds each. For the other 4 LLMs of Table 6, the receipt condition uses the same image and agent prompt as their RECEIPT w/o report runs of Table 12.
B.7 Task-Paired False-Success Analysis
The paired analysis averages each task's false-success difference over its 5 LLMs and 3 repetitions. Change in pp averages these task-level changes in false-success frequency from a baseline to RECEIPT, in percentage points. Fewer, More, and Tied count tasks by the direction of this change. Percentile 95% intervals use 20,000 resamples of the 15 tasks with seed 20261009.
Table 16 Task-paired changes in false successes with RECEIPT on 15 TRIPWIRE task pairs, with 95% intervals.
| Compared with | Fewer | More | Tied | Change in pp |
|---|---|---|---|---|
| Closed input | 8 | 1 | 6 | -11.1 [-20.9, -3.1] |
| Terminal | 8 | 1 | 6 | -8.4 [-13.8, -3.6] |
| RECEIPT w/o report | 7 | 2 | 6 | -4.9 [-11.1, -0.4] |
B.8 Prediction Before Launch
The 267 test commands come from 110 program families absent from training and include 14 pipe waits and 32 terminal waits. Learned predictors use command text with up to 400 tokens of help text. We tune Qwen3-0.6B⁵ for 2 passes at learning rate 2 × 10⁻⁵ with 5 seeds. Zero-shot Qwen2.5-32B-Instruct [38] uses greedy decoding and a 64-token limit.
As Table 17 shows, zero-shot prediction ranks waits above returned commands on held-out families. On the 434 public waits of Terminal-Bench 2.0, the rule set finds 25.3%, and it finds none of the 178 waits in programs outside WAITATLAS.
⁵https://huggingface.co/Qwen/Qwen3-0.6B
Table 17 Wait prediction on held-out program families of WAITATLAS.
| Predictor | Pipe | Terminal | ||
|---|---|---|---|---|
| AUROC | AP | AUROC | AP | |
| Rule set | 0.603 | 0.170 | 0.572 | 0.199 |
| Logistic regression | 0.737 | 0.126 | 0.704 | 0.222 |
| Tuned LLM | 0.761 | 0.194 | 0.666 | 0.240 |
| Zero-shot 32B | 0.900 | 0.477 | 0.717 | 0.395 |