Paper reveals that LLM agent tool calls are rewritten during execution paths, and proposes IntAct as a fixDo Tool Calls Execute as Intended? Measuring and Repairing Intent-Execution Correspondence in LLM Agents
The authors propose the IEC protocol and IntAct, finding that tool calls are easily silently tampered with across multiple hops in the execution path, and after repairing the corresponding hops, 79.2% of failures are recovered on IEC-Bench.
- LLM agents call external tools through execution paths, and each hop in the path can silently tamper with calls, causing programs to execute unintended actions. Existing evaluations and trajectory attribution misattribute path-caused failures to models, masking the true cause of failures.
- Proposes the IEC protocol, which locates the first hop where a change occurs through a witness mechanism that does not execute the call and the receiver's own parser; proposes IntAct, which at a specified hop converts the call into an unresolved channel form that the hop cannot tamper with, and explicitly rejects when delivery is impossible.
- All 10 tested frameworks tamper with calls; under fixed-action replay, IntAct recovered 79.2% of changed failures in IEC-Bench and reduced token overhead for passed tasks by 2.4 times; trajectory attribution misattributes 95.1% of production failures to models.
- Only the receiving end with a parser and tested frameworks are covered; rewritten calls may affect permission rule determination; interactive frameworks with dynamic input to the terminal and future new launch methods are not covered; tests cover only 4 primary tested models and specific operating system configurations.
- Evaluated models
- qwen3-coder-plusQwen2.5-Coder-32BQwen2.5-72BHermes-3-Llama-3.1-70B (Hermes-3)
- Benchmarks
- IEC-BenchTerminal-Bench 2ToolHopToolathlonCLI-1MWindows corpusLinux corpus
- Metrics
- changed-call ratePass@kTokens per passed itemcost ratioRecovered pairsCohen's kappafalse-confirmation rate
Researchers from Yanshan University, Zhejiang University, and other institutions propose the intent-execution consistency (IEC) concept, referring to the fact that after a tool call passes through multiple hops such as serialization, host wrappers, shell parsing, process interfaces, and target parsers, the action actually executed may differ from the call that was issued. Replay of 47,828 shell calls across 261 production sessions showed a mutation rate of 10.0% for exposed calls; Claude Code's Bash tool mutated 12.0% of calls carrying code, escape sequences, or long text; 80.7% of merged calls with backslashes executed the wrong action without any error. All 10 tested harnesses rewrote calls, and trajectory-based judgment attributed 95.1% of production failures to the LLM, while the path actually caused more than half. IntAct has been deployed in production and in a commercial product, and is released as a Claude Code mod, shell shim, and MCP server. The authors report that the numbers come from a limited production corpus and their own benchmark, with limited representativeness and no independent replication yet.
Why it was selectedThe paper quantifies the proportion of tool calls rewritten by the execution path and provides a locally reproducible hop-by-hop detection and repair approach.
Paper analysis
What problem does this paper attempt to solve?
Tool calls are frequently subject to covert tampering at various hops in the execution path, and existing analyses mistakenly attribute path failures to the model, lacking cross-hop observation and repair mechanisms.
Tool calls are easily silently tampered with during multi-hop transmission through the execution path, causing executed actions to deviate from agent intent, while existing benchmarks and attribution methods misattribute such path failures to LLMs.
- Execution paths cause intent-execution deviation: Agents build and run software through tool calls; commands start from the framework and must pass through multiple hops (Hop) including argument serialization, host wrappers, Shell parsing, process interfaces, and target parsers. Any hop may tamper with the call text or argument structure without reporting errors, causing the victim system to execute unintended actions.
- Blind spots in existing benchmarks and attribution methods: Mainstream benchmarks only evaluate the issued calls or final system state, assuming commands execute as-is; trajectory-level attribution methods only review call text and return results, cannot observe what each hop actually receives, and thus misattribute execution-path-induced failures to LLM generation defects.
- Core observation and cascading masking effect: The authors find that tampered hops mask changes at subsequent hops, and some path failures are completely invisible until the first tampered hop is repaired; additionally, silent tampering causes models to execute wrong actions, while explicit failures with misleading error messages induce models to tamper with their originally correct initial intent.
- Proposed protocol and repair framework: The paper defines intent-execution correspondence (IEC), proposes the IEC protocol that captures transmitted content hop by hop without actual execution and uses receiver-side parsers to judge deviations, builds the evaluation benchmark IEC-Bench, and proposes the repair framework IntAct that safely passes calls through unresolved channels at specific hops.
What related research exists?
Existing work focuses on trajectory-level failure attribution, self-correction, and single-hop wrapper analysis, lacking execution-free observation of multi-hop execution paths and systematic skip-level repair.
Existing research mainly revolves around failure attribution at the agent trajectory level, self-correction retries, and interception defenses against specific single hops, without establishing an execution-free observation system for the multi-hop process of command execution paths.
- Agent evaluation and trajectory-level attribution research: Who&When (Zhang et al., 2025) uses LLM judges to analyze failure trajectory logs and determine responsible agents and steps; Causal Agent Replay (Shah, 2026) locates responsible steps through counterfactual replay at specific steps; Gupta et al. (2026) returns structured execution feedback to agents. The authors point out that such methods only analyze call text and return results, cannot observe the actual payloads received between hops, leading to extremely low attribution consistency among judges on path failures.
- Self-correction and environment perturbation testing: Reflexion (Shinn et al., 2023) relies on environment feedback to prompt agents to reflect and retry; ToolBench-X (Tian et al., 2026) injects explicit tool environment risks into agents. The authors point out that when execution paths produce misleading error feedback, simply increasing retry rounds cannot fix underlying path-level defects, but instead multiplies overhead.
- Command execution path and security defense research: QuoteBench (Li et al., 2026) uses a single reference path (temporary files) across 56 tasks to record wrapper single-hop performance; BatBadBut reveals Windows batch argument passing issues; Su and Wassermann (2006), AgentSpec (Wang et al., 2026), and CARE (Zhang et al., 2026) focus on injection detection and pre-execution validation. The authors point out that such security analyses mainly focus on whether calls are allowed to execute, not whether the program fully receives the original intent; QuoteBench only covers a single hop and cannot detect tampering at subsequent hops such as process interfaces.
- Baseline methods and benchmark datasets: Attribution comparison baselines include Who&When's 3 LLM judges (all-at-once, step-by-step, binary search), Causal Agent Replay, and QuoteBench's fixed-reply replay; repair comparison baselines include QuoteBench's temporary files and explicit boundary contracts, Gupta et al.'s structured execution feedback, and Reflexion self-correction; evaluation benchmarks cover IEC-Bench, Terminal-Bench 2, Toolathlon, ToolHop, CLI-1M, and real enterprise production conversation corpora.
- Positioning differences from this work: The authors state that this work differs from previous single-hop or trajectory-level work, being the first to measure intent-execution correspondence across multiple hops using receiver-side official parsers without executing calls, and revealing error masking characteristics across hops.
How does the paper address this problem?
Define intent-execution correspondence, use witness mechanisms and receiver-side parsers to locate the first deviating hop without execution, and apply channel rendering and rejection at the corresponding hop via IntAct.
The paper proposes the IEC protocol and the IntAct framework, which respectively achieve execution-free cross-hop divergence localization and channel rendering repair for specific hops.
Problem Setting and Formalization
- Intention-Execution Correspondence (IEC): The semantics referred to by the call text issued by the agent under a tool contract is defined as the intended action a. For an execution path Pi = <b_1, ..., b_m> containing m hops, each hop undergoes sender-side serialization and receiver-side parsing, and the action parsed by the receiver is denoted r_i. The path satisfies correspondence if and only if all hops satisfy r_i = a.
- First Divergence Hop Definition: The first hop that receives an action different from the intended one is defined as the First Divergence:
FD(a, Π) = min{i ∣ ri ≠ a} The formula denotes the index of the first hop in the path that breaks intention-execution correspondence. Divergences are divided into silent divergence (the returned result has no error) and explicit divergence (returns a parsing or quoting error).
- Four Tampering Mechanisms: The authors summarize four mechanisms by which hops break calls: quote secondary parsing consumption (quote consumption), interactive environment literal re-expansion (re-expansion), text truncation caused by the runtime environment (truncation, such as MSYS2 environment truncation and cmd.exe newline truncation), and argument splitting or dropping (arity change).
Witness Mechanism: Observing Hops Without Execution
- Harmless Replacement Probe: Directly re-executing historical calls has side effects and is not repeatable. The witness mechanism (Witness) preserves the framework's startup configuration, replacing only the program that actually executes the command with a probe that captures and reports the received text.
- Environment and Process Interception: For Bash, the BASH_ENV environment variable is used to load the witness script before the command string is executed; for PowerShell, append startup is used, and the parsing script is computed based on powershell.exe command-line rules; at the process interface, an argv probe intercepts the argument vector received by the native program, and an argv sentry records ancestor processes to identify wrapper structures; for structured tools, the actual bound argument values of the tool function are recorded.
Receiver-Side Parsing and Attribution Determination
- Own Parser Arbitration: Instead of relying on string literal comparison or subjective LLM judgment, the official parser of the hop's receiver is directly invoked to parse the syntactic structure (comparing Bash operators, lexical tokens, and heredocs, PowerShell syntax analysis trees, and native program argument vectors), thereby eliminating false positives from equivalent syntax.
- Explicit Fault Attribution Process: With execution disabled, first the target interpreter parses the original text issued by the agent; if it fails syntax parsing, it is attributed to a large model generation error; if the text is legal but the input captured by the witness probe differs, or the error line number exceeds the original text range (originating from wrapper-appended logic), it is attributed to a path error; if the text is fully passed but invoking a deeper interpreter causes failure, it is attributed to a nested hop error.
IntAct: Channel Rendering and Safe Rejection for Specified Hops
- Channel Rendering Mechanism: The root cause of hop tampering with calls is that it parses the text. IntAct encapsulates the call into a physical channel that the hop does not parse (such as sourcing a separate script file, standard input, Base64-encoded arguments, etc.), so that the hop cannot change the content.
- Native Argument Rendering Rules: For the parsing defect when PowerShell 5.1 passes constant arguments to native programs, IntAct applies dedicated escaping rendering to each argument s:
native(s) = \begin{cases} "" & s = \varepsilon \\ " esc(s) \beta(s) " & s \text{ contains whitespace} \\ esc(s) & \text{otherwise} \end{cases}In the formula, esc escapes double quotes and doubles leading backslashes, and \beta(s) repeats trailing backslashes to ensure the closing quote maintains delimiter semantics, which the C runtime parses to restore the original argument s.- Multi-Hop Composition and Safe Rejection: When the path contains multiple tampering hops (such as PowerShell append startup having both wrapper and process interface issues), IntAct composes rendering in reverse order (first completing process interface rendering, then encoding as -EncodedCommand arguments for delivery to the wrapper). If the call text exceeds the carrying domain of the target channel (for example, cmd.exe cannot receive multi-line text), IntAct directly rejects execution before startup and returns an error indicating the faulty hop, preventing unnoticed silent divergence.
What experiments did the paper conduct?
Covering production sessions, public benchmarks, and injection tests, all 10 tested frameworks exhibited hop-level tampering, and IntAct recovered 79.2% of changed failures under fixed actions.
Experiments cover real production session replay, IEC-Bench benchmark evaluation, fault injection, and ablation analysis, confirming that all tested frameworks have hop tampering issues, and skip-level repair can recover execution losses.
Experimental Setup
- Tested models: IEC-Bench main evaluation covers qwen3-coder-plus (API), Qwen2.5-Coder-32B, Qwen2.5-72B, Hermes-3-Llama-3.1-70B (Hermes-3, vLLM deployment); attribution baselines use Qwen2.5-72B and qwen3-coder-plus; repair recovery tasks additionally cover 15 LLMs from 4 vendors.
- Datasets and corpora: Covers Windows enterprise production corpus (47,828 Shell calls, 11,982 exposed calls), Linux production corpus (71 sessions), IEC-Bench (67 pattern pairs, 10 multi-line programs, 135 ToolHop chains, 46 Terminal-Bench 2 tasks), Toolathlon, CLI-1M, and 203,710 public trajectories.
- Execution frameworks and paths: Covers 10 frameworks (Claude Code, Codex, Qwen Code, OpenCode, DeepSeek Harness, Gemini CLI, Aider, OpenHands, SWE-ReX, Terminus-2) and 18 MCP servers, with evaluation covering 6 transmission paths.
- Evaluation metrics: changed-call rate, silent change proportion, Pass@k (pass@1 and pass@10), Tokens per passed item, cost ratio, recovery rate (Recovered pairs), attribution consistency Cohen's kappa, false confirmation rate.
- Review and ground truth labels: Use execution-free witnesses combined with receiver-side parsers to judge deviations; task status is compared against an expected-state Oracle computed without Shell; attribution is double-blind labeled by 2 annotators according to specifications (kappa 0.79 and 0.89 respectively), with execution evidence adjudicating disagreements.
- Repetition settings: IEC-Bench main experiments are evaluated once at temperature=0 (pass@1); Reflexion and IntAct comparison experiments are evaluated over 10 trials (pass@10); recovery tasks are repeated 3 times per model at temperature=0.6.
Main Results
The following table presents the total number of passed tasks for 3 LLMs (Qwen2.5-Coder-32B, Qwen2.5-72B, Hermes-3) under different launch paths and intervention methods (from Table 7):
Swipe horizontally to read the table
Launch path and task category (total) Original launch (None) IntAct (1 time) Temporary file [25] Reflexion (10 times) [39] IntAct (10 times) One-argument launch, pattern pairs (201) 104 129 103 148 172 One-argument launch, tool chains (405) 35 74 39 81 155 Appended launch, pattern pairs (201) 26 127 103 50 181 Appended launch, tool chains (405) 9 74 39 36 150 Claude Code Bash, pattern pairs (201) 109 125 125 131 162 Typed Bash, Linux, pattern pairs (90) 74 86 not reported 86 88 - Launch path lowers task pass performance: The authors point out that under PowerShell appended launch with call changes, the 3 LLMs pass only 26 task pairs and 9 tool chains without repair; after a single IntAct repair, these increase to 127 and 74 respectively.
- IntAct outperforms self-correction baselines under the same trial budget: The authors point out that under a 10-trial budget, IntAct passes more items than Reflexion on all Windows launches (e.g., appended launch task pairs reach 181 vs. Reflexion's 50), and the authors believe path corruption cannot be solved solely by the agent's intrinsic retries.
- Model rankings are distorted by execution paths and restored after repair: The authors point out that under appended and one-argument launches, the original performance order among models is reversed, and after IntAct repairs the corresponding hops, the relative ranking of models returns to the level of the control baseline.
Real Production Sessions and Cross-Framework Call Change Measurement (RQ-1)
- Test content: On Windows and Linux production corpora, public trajectories, and 16 MCP servers, measure the frequency and mechanisms of tool call tampering at each hop via witness mechanisms.
- Experimental results: Among 11,982 exposed Windows calls, 1,199 were changed (changed-call rate 10.0%, Table 2); Claude Code's Bash tool had a change rate of 12.0% when carrying code or long text (902 of 7,491 tampered at the host wrapper); of 663 calls where backslashes were merged, 535 silently executed wrong actions without reporting any error (80.7% silent, Figure 3b); all 10 tested frameworks and 10 MCP servers showed call changes.
- Author interpretation: The authors believe call changes originate from launch paths rather than the platform or model itself, and frameworks must be engineered and tested hop by hop.
Failure Attribution Effectiveness and Replay Comparison (RQ-3)
- Test content: On 102 production failure samples and 115 text pairs, compare the IEC protocol with Who&When's LLM judges, QuoteBench's fixed-reply replay, and ablation variants.
- Experimental results: The IEC protocol achieves Cohen's kappa 0.77 agreement with human annotation on 102 failure attributions (correctly identifying 54 path failures, misjudging 1, Table 5); Who&When judges achieve a maximum kappa of only 0.04, and the all-at-once judge attributes 97 failures directly to the model; QuoteBench's single reference path detects only 37.2% of path losses (detecting all 20 wrapper losses, but 0 of 48 process interface losses, Table 6).
- Author interpretation: The authors point out that trajectory records do not include the data actually received at hops, so trajectory-level judges produce systematic misattribution; reference paths that bypass only a single hop cannot detect losses at other hops.
Loss Recovery and Ablation under Fixed-Action Replay (RQ-4)
- Test content: Fixing the actions issued by the agent, replay 360 reproduced failing task pairs on IEC-Bench to evaluate IntAct's recovery performance after repairing the named hops.
- Experimental results: Among 173 failing task pairs with call changes, IntAct recovered 137 (recovery rate 79.2%, Table 1); none of the 187 failing task pairs without changes were recovered (Fisher's exact test p < .001);在追加启动中,仅修复进程接口恢复0个,仅修复包装器恢复31个,两跳均修复恢复69个(Figure 5a)。
- 作者解读:作者认为早期跃点会遮蔽后续跃点的篡改,复合路径必须按路径顺序修复每个被定名的跃点。
其他消融与分析
- 故障注入定位(168次注入):30次发生接收变更的故障全部被首偏离跳准确定位(Figure 5b)。
- 文本变异检测(297个变体):Bash执行产生差异的262个变体全部被语法比对检测出。
- 显式边界契约消融:Qwen2.5-Coder-32B在15个正则任务中因改用&&连接全部失败,通过数从50降至36。
- 证据回传消融:在工具结果中回传发送与接收文本后,Qwen2.5链路通过数无显著变化(p >= .500).
- Tokens per passed task: Token consumption for passed tasks under original launch is 2.4 times that of IntAct, reaching 12.3 times on appended launch chains.
- Agent false confirmation rate: Among 949 dangerous variant and multi-line program failing runs, agents falsely reported 665 as completed (70.1%).
Under fixed-action replay, 36 of the failing task pairs with call changes were not recovered by IntAct (see Table 1 discussion), of which 22 failed due to actions without tampering, 12 gave up during retries due to misleading feedback, and 2 used syntactic structures beyond the rendering channel's capacity.
What are some points that can be further explored?
The authors note the need to extend terminal-typing measurements and account for framework permission systems; current experiments mainly cover hop types with parsers and a specific evaluation configuration.
The directions for future work noted by the authors mainly focus on extending terminal typing measurement and accounting for framework permission systems, while the current experimental coverage is limited by the hop types with parsers and the specific evaluation environment.
Limitations and future directions noted by the authors
- Extension of interactive terminal typing measurement (Section 8): The authors plan to extend the measurement to execution frameworks that type commands directly into the terminal.
- Adaptation to new launch methods (Section 8): The authors plan to extend the measurement to entirely new launch methods that appear after this study is completed.
- Maintaining permission determination rules (Section 8): The authors note that the repair mechanism for rewritten calls must ensure that the framework's permission rules are still determined based on the original call, as implemented in their released mod.
- Channel payload domain limitations and refusal (Section 2.4): The authors note that IntAct's rendering depends on the valid payload domain of the physical channel; for calls without a corresponding safe channel, such as cmd.exe terminating upon encountering a newline, only explicit refusal can be performed and the call cannot be transmitted.
Experimental coverage
- Receiving-end parser dependency: The IEC protocol only covers hop types where the receiving end has a syntax parser (such as Bash, PowerShell, and program argument lists), and does not cover unstructured receiving ends without a parser.
- Tested frameworks and platform environments: The experiments evaluated 10 programming agent frameworks and 18 MCP servers, with the primary operating system environment being Windows 11 (with Git Bash and PowerShell 5.1) and some Linux distributions.
- Number of benchmark evaluation models: The full IEC-Bench benchmark covers 4 primary tested large language models (qwen3-coder-plus, Qwen2.5-Coder-32B, Qwen2.5-72B, Hermes-3-Llama-3.1-70B).
- Production corpus collection scope: The real conversation corpus comes from Windows calls (47,828) generated by 6 developers from a single company over 11 weeks and Linux calls from 9 developers, supplemented by holdout data from 2 external developers.
- Hyperparameters and step budgets: In IEC-Bench evaluation, task pairs are limited to at most 10 steps (120 seconds per command), tool chains are limited to at most 15 steps (60 seconds each), the temperature is fixed at 0 for the main experiments, and the paper does not report generalization performance under other sampling temperatures.
Summarize the main content of the paper
The paper defines the problem of intent deviation in tool calls along the execution path, proposes a non-execution attribution protocol and hop-level repair, and provides evaluation and design guidelines for agent engineering.
- Research Positioning: Addressing the fidelity issue of large language model agent tool calls in the underlying execution path, the paper defines the concept of intention-execution correspondence and proposes the execution-free divergence detection protocol IEC and the hop-level repair framework IntAct.
- Core Problem: Commands often undergo covert tampering during multi-hop transmission through host wrappers, Shell parsing, process interfaces, etc. Existing evaluations assume calls are executed as-is by default, causing many path defects to be systematically misattributed to the large language model.
- Method Design: The IEC protocol uses harmless witness probes and the receiver's own parser to locate the first divergence hop without executing the command; IntAct uses non-parsing channels (such as file injection, argument escaping, Base64 encoding) for targeted rendering and delivery based on the named hop, or safely rejects out-of-domain calls.
- Key Experimental Results:
- In production sessions, 10.0% of exposed Shell calls were tampered with by the path, Claude Code's Bash tool had a tampering rate of 12.0% when transmitting long text or code, and 80.7% of backslash merging failures reported no error (Figure 3a, Figure 3b).
- Traditional trajectory evaluation misjudged 95.1% of production failures as model responsibility, while the IEC protocol achieved a Cohen's kappa of 0.77 with human attribution (Table 5).
- In fixed-action replay, IntAct recovered 79.2% of failed tasks with call changes in IEC-Bench (Table 1); in agentic closed-loop testing, it reduced the average token consumption of passed tasks by 2.4 times (Table 7).
- Author Conclusions and Implications: The authors believe that whether tool calls execute correctly mainly depends on the startup path rather than the large model itself; agent frameworks must conduct hop-by-hop engineering testing in hop order, and benchmark evaluations should fix and report the startup path to ensure fairness in model scoring.
Related papers
- Beneath the Surface: What We Overlook When We Talk About Agent EvolutionAnalysis / interpretabilityarXiv