When Code Becomes an LLM Call: An Empirical Study of Call-Site Contracts in Agentic Systems
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Software quality has long rested on specifications that state what code must do, and on testing and verification that check that the code does it. Agentic systems change this foundation: they replace parts of their logic, such as choosing the next tool, judging whether an action is allowed, or writing code to run, with calls to a large language model (LLM). The program still relies on what this logic must guarantee, but the model's behavior is not fixed by code, varies across runs, and can be steered by its input. The guarantee must therefore come from the program around each LLM call site, as a contract of pre-conditions, prompt constraints, and post-conditions. We present an empirical study of these contracts in 496 LLM call sites of 40 popular open-source agentic systems (13.4 MLOC, four languages). Using a multi-agent pipeline validated by 17,428 human judgments, we trace where every model output flows, derive an expected contract for each call site without access to its code, and compare it with the contract that the code implements. We find that 48% of LLM outputs reach control flow or execution, and 73% of these never reach a person. Programs enforce 78% of their constraints in code, but in the prompt, 67% of the constraints are only requested from the model. Although 82% of call sites are checked before and after the call, 63% of the expected constraints are unmet and only 5.3% of call sites satisfy their whole contract; ten recurring patterns explain 99% of the gaps. 38 mechanisms behind these gaps trigger at runtime, and a small code fix that enforces the expected constraint stops all 38. Our results show that the presence of checks says little about their adequacy, and we derive implications for agent developers, framework maintainers, and researchers.
Key facts. No citing papers in the map yet (data through 24 Nov 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 40 of its 76 references that are in the map. Submitted 17 Oct 2026.
Builds on
40 of 76 references.
Closest ancestors · 4
Same direction, newest first
- 2025Why Do Multi-Agent LLM Systems Fail?17 Mar
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agents23 Jul
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering6 May
- 2023AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation16 Aug
Other references · 36
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 9,589
- 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 9,360
- 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,469
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,871
- 2023A Survey on Large Language Model based Autonomous Agentscited by 2,347
- 2023WebArena: A Realistic Web Environment for Building Autonomous Agentscited by 2,232
- 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,718
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,638
- 2023AgentBench: Evaluating LLMs as Agentscited by 1,401
- 2024OSWorld: Benchmarking Multimodal Agents for Open-Ended Tasks in Real Computer Environmentscited by 1,383
- 2023HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in Hugging Facecited by 1,238
- 2023GAIA: a benchmark for General AI Assistantscited by 1,237
24 more
- 2023DSPy: Compiling Declarative Language Model Calls into Self-Improving Pipelinescited by 908
- 2023Can Large Language Models Be an Alternative to Human Evaluations?cited by 755
- 2025UI-TARS: Pioneering Automated GUI Interaction with Native Agentscited by 678
- 2023Prompt Injection attack against LLM-integrated Applicationscited by 638
- 2023Identifying the Risks of LM Agents with an LM-Emulated Sandboxcited by 637
- 2024MLE-bench: Evaluating Machine Learning Agents on Machine Learning Engineeringcited by 572
- 2025Agent Laboratory: Using LLM Agents as Research Assistantscited by 489
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 446
- 2024StruQ: Defending Against Prompt Injection with Structured Queriescited by 433
- 2023NeMo Guardrails: A Toolkit for Controllable and Safe LLM Applications with Programmable Railscited by 397
- 2024Defending Against Indirect Prompt Injection Attacks With Spotlightingcited by 319
- 2024Agent S: An Open Agentic Framework that Uses Computers Like a Humancited by 213
- 2024TradingAgents: Multi-Agents LLM Financial Trading Frameworkcited by 210
- 2024Assisting in Writing Wikipedia-like Articles From Scratch with Large Language Modelscited by 166
- 2024UFO: A UI-Focused Agent for Windows OS Interactioncited by 155
- 2024IsolateGPT: An Execution Isolation Architecture for LLM-Based Agentic Systemscited by 149
- 2019Taxonomy of Real Faults in Deep Learning Systemscited by 100
- 2023Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?cited by 72
- 2019A Comprehensive Study on Deep Learning Bug Characteristicscited by 70
- 2023LLM Platform Security: Applying a Systematic Evaluation Framework to OpenAI's ChatGPT Pluginscited by 55
- 2023Data Formulator: AI-powered Concept-driven Visualization Authoringcited by 34
- 2024Large Language Models as Software Components: A Taxonomy for LLM-Integrated Applicationscited by 19
- 2024Prompting in the Wild: An Empirical Study of Prompt Evolution in Software Repositoriescited by 19
- 2023What Kinds of Contracts Do ML APIs Need?cited by 3
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026LLM-as-Code: Agentic Programming for Agent Harness
- 2026Agentic Model Checking
- 2026AgentScript-Eval: Benchmarking LLMs and Agents for Code Generation in an Enterprise DSL
- 2026The Evolution of Tool Use in LLM Agents: From Single-Tool Call to Multi-Tool Orchestration
- 2026Taming Scylla: Understanding the multi-headed agentic daemon of the coding seas
- 2026How Consistent Are LLM Agents? Measuring Behavioral Reproducibility in Multi-Step Tool-Calling Pipelines
- 2025Tool Preferences in Agentic LLMs are Unreliable
- 2026LLM-Based Agentic Systems for Software Engineering: Challenges and Opportunities