Defining and Detecting the Defects of Large Language Model-Based Autonomous Agents
Определение и обнаружение дефектов автономных агентов на основе больших языковых моделей
2026-01-28
SCID: 54.1/u948w6wm
Discuss with AI
AgentableCode Property GraphsLLM-based autonomous agentsagent code defectsstatic analysis
Figures from the paper
Abstract (AI)
Artificial intelligence (AI) agents are systems capable of perceiving their environment, autonomously planning and executing tasks. Recent advancements in Large Language Models (LLMs) have introduced a transformative paradigm for AI agents, enabling them to interact with external resources and tools through prompt techniques. This advancement has significantly extended the capabilities of LLMs, positioning LLM-based AI Agents as an important research area. In such agents, the workflow integrates developer-written code, which manages framework construction and logic control, with LLM-generated natural language that enhances dynamic decision-making and interaction. However, inconsistencies between LLM outputs and developer logic can lead to defects, such as tool invocation failures. These issues introduce specific risks, leading to various defects in LLM-based AI Agents, including service interruptions and incorrect output. Despite the importance of these issues, there is a lack of systematic work that focuses on analyzing LLM-based AI Agents to uncover defects in their code. To address this gap, we present the first study focused on identifying and detecting defects in LLM Agents. We collected and analyzed 14,754 relevant developer reports from StackOverflow and GitHub. We further filtered 2,604 valid posts to define and classify eight types of agent code defects. Then, we designed a static analysis tool, named Agentable, to detect these defects. Agentable leverages Code Property Graphs (CPGs) and LLMs to analyze Agent workflows by efficiently identifying specific code patterns and analyzing natural language descriptions. To evaluate Agentable, we constructed two datasets: AgentSet, which consists of 84 real world Agent projects, and AgentTest, which contains 78 Agent projects specifically designed to include various types of defects. Our evaluation shows that Agentable achieves a precision of 88.79% on the real-world agent dataset and a recall of 91.03% on the manually labeled defect dataset. Furthermore, our analysis identifies 889 defects in real-world agent projects, highlighting the prevalence of these issues in practice.
Key Findings
1
Agentable achieved 88.79% precision on the real-world dataset and 91.03% recall on the defect-focused evaluation dataset.
2
Analysis of 14,754 StackOverflow and GitHub reports yielded 2,604 valid posts used to define and classify eight types of agent code defects.
3
Evaluation used AgentSet with 84 real-world agent projects and AgentTest with 78 defect-injected projects.
4
The authors developed Agentable, a static analysis tool combining Code Property Graphs and LLMs to detect code patterns and interpret natural-language workflow descriptions.
5
The study provides the first systematic analysis focused on defining and detecting defects in large language model-based autonomous agents.
Research Object
LLM-based autonomous agents and their code/workflows
Research Subject
Defects in agent code, including their types, causes, and detection
Publication Details
Publication Date
2026-01-28
Journal
Publisher
ISSN
Cited by
2
Access Type
Author Information
Download PDF
Subscribe to digest