Metraipolis › archive › dc_0c4c84778f1f
StateMirror: Pre-Execution Detection of Hallucinated Tool Calls in Coding Agents — arXiv:2610.32648
- Source
- arXiv (en)
- Original
- https://arxiv.org/abs/2610.32648
- License (as archived)
- CC0-1.0
- Archived
- 2026-10-26T20:15:42.408Z
- SHA-256 of the archived text
2084630739b1ac03bf4430ffe64a5abb98e974afdc27aa80d1c24d994dcb4c9f- Stable URL of this page
https://metraipolis.com/documento/dc_0c4c84778f1f
How to cite
StateMirror: Pre-Execution Detection of Hallucinated Tool Calls in Coding Agents — arXiv:2610.32648 — arXiv (en), https://arxiv.org/abs/2610.32648 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_0c4c84778f1f (Metraipolis archive dc_0c4c84778f1f, sha256 2084630739b1ac03bf4430ffe64a5abb98e974afdc27aa80d1c24d994dcb4c9f)
BibTeX
@misc{dc0c4c84778f1f,
title = {StateMirror: Pre-Execution Detection of Hallucinated Tool Calls in Coding Agents — arXiv:2610.32648},
howpublished = {arXiv (en)},
url = {https://arxiv.org/abs/2610.32648},
note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_0c4c84778f1f; sha256 2084630739b1ac03bf4430ffe64a5abb98e974afdc27aa80d1c24d994dcb4c9f},
year = {2026}
}Archived text
Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2610.32648. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
Large language model (LLM)-based coding agents may propose invalid actions that are not applicable in the execution environment, such as accessing non-existent paths or missing packages. We term this mismatch hallucinated tool use. A preliminary study of 4,398 agent trajectories reveals that these hallucinations are pervasive and costly, requiring a median of 3 additional interaction steps and 22.4K tokens to recover. Existing frameworks rely on reactive, post-execution feedback, wasting runtime resources. Nevertheless, since an agent's execution environment is grounded in concrete codebase and harness components, many action prerequisites can be extracted and validated prior to execution. To this end, we introduce StateMirror, a lightweight pre-execution detector. StateMirror intercepts actions at the harness boundary, extracts state predicates via AST and command analysis, and deterministically validates them against the live repository. By pinpointing exact environment mismatches before execution, StateMirror preempts invalid actions and subsequent recovery cycles. Evaluation on 2,508 actions shows StateMirror achieves 0.940 precision and 0.817 F1 in detecting such hallucinations, surpassing the strongest LLM judge by 35.3% in F1 while reducing median detection latency from 17.73 s to 1.50 ms with zero token consumption. For practical mitigation, StateMirror's pre-execution feedback enables agents to rectify over 95% of hallucinated tool calls. During live mitigation on 79 tasks, StateMirror reduces agent execution time by 15.8% and token consumption by 11.8% while maintaining task resolution. Tema degli esploratori: calcolo e infrastrutture (elenco arXiv cs.SE, nuovi lavori del giorno). Categorie arXiv: Software Engineering (cs.SE). Pagina del lavoro: https://arxiv.org/abs/2610.32648 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito). Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina. Letto il 2026-10-26T19:49:18.381Z dalla pagina https://arxiv.org/list/cs.SE/new (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).