Search papers, labs, and topics across Lattice.
This paper identifies and addresses a critical failure mode in LLM agents known as Infinite Agentic Loops (IALs), which occur when agents continuously execute tasks due to unbounded feedback paths. The authors introduce IAL-Scan, a static analysis tool designed to detect these failures by constructing an Agentic Loop Dependence Graph (ALDG) that highlights potential infinite execution scenarios. Evaluation of IAL-Scan on over 6,500 LLM agent repositories revealed 74 potential IALs, with a manual review confirming 68 failures, demonstrating a high precision of 91.9%.
Infinite Agentic Loops can turn a single request into a costly, endless cycle of execution, but IAL-Scan can detect and prevent these failures before they escalate.
LLM agents increasingly rely on iterative execution to solve tasks through planning, tool use, state updates, and agent collaboration. While this design enables flexible automation, it also creates a new class of failures: an agent may repeatedly execute model calls, tools, workflow transitions, or agent handoffs when the feedback path is not effectively bounded. We call this problem Infinite Agentic Loops (IALs). IALs are not ordinary programming loops; they arise from the interaction between agent logic, framework semantics, runtime observations, and termination mechanisms. Such failures can amplify a single request into long running model and tool execution, causing cost exhaustion, model denial of service, context growth, and repeated external side effects. We propose IAL-Scan, a static analysis tool for detecting IAL failures in real-world LLM agent projects. IAL-Scan abstracts heterogeneous agent code into a framework independent Agent IR, builds an Agentic Loop Dependence Graph (ALDG) to recover explicit and framework induced feedback paths, and checks whether these paths can repeatedly reach costly or state growing operations without an effective bound. We evaluate IAL-Scan on 6,549 LLM agent repositories. It reports 74 potential findings, among which manual review confirms 68 IAL failures across 47 projects, achieving 91.9% precision.