Most agent LLM call sites miss expected contracts
Original title: When Code Becomes an LLM Call: An Empirical Study of Call-Site Contracts in Agentic Systems
In 496 call sites across 40 open-source agents, 63% of expected constraints were unmet and 5.3% of sites met the full contract.
A study of 496 LLM call sites in 40 popular open-source agentic systems, covering 13.4 million lines in four languages, compared expected contracts with implemented ones. Forty-eight percent of model outputs reach control flow or execution, and 73% of those never reach a person. Programs enforce 78% of constraints in code, while 67% of prompt constraints are only requested from the model. Ten patterns explain 99% of gaps, and a small code fix stopped all 38 runtime-triggering mechanisms.
Unconfirmed: Expected contracts were inferred without reading the call-site code, then compared with the implementation.
- Checks run before and after 82% of call sites.
- A multi-agent pipeline was validated with 17,428 human judgments.
- Thirty-eight mechanisms behind the gaps trigger at runtime.
- Expected contracts were derived without access to each call site's code.
From the original article
1 min read at arxiv.orgSoftware 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).
By Shihao Weng · arxiv.org
A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.