When Agents Do Not Stop: Uncovering Infinite Agentic Loops in LLM Agents

πŸ“… 2026-07-01
πŸ“ˆ Citations: 0
✨ Influential: 0
πŸ“„ PDF
πŸ€– AI Summary
This study addresses the critical issue of infinite agent loops (IAL) in large language model (LLM) agents, which can arise from missing or ineffective termination conditions during iterative execution, leading to resource exhaustion and denial-of-service. The work presents IAL-Scan, the first systematic approach to detecting IAL vulnerabilities, leveraging a unified intermediate representation to abstract heterogeneous agent code, constructing agent loop dependency graphs, and applying path reachability analysis to identify high-risk feedback loops. Evaluated on 6,549 open-source projects, IAL-Scan identified 74 potential IAL instances; manual validation confirmed 68 true positives across 47 projects, achieving a precision of 91.9%. This demonstrates IAL-Scan’s effectiveness in enabling cross-framework, high-precision discovery of IAL vulnerabilities.
πŸ“ Abstract
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.
Problem

Research questions and friction points this paper is trying to address.

Infinite Agentic Loops
LLM agents
termination mechanisms
feedback paths
agent execution
Innovation

Methods, ideas, or system contributions that make the work stand out.

Infinite Agentic Loops
Static Analysis
Agent IR
Loop Dependence Graph
LLM Agents
πŸ”Ž Similar Papers