LogicHunter: Testing LLM Agent Frameworks with an Agentic Oracle

📅 2026-07-07
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Current LLM agent frameworks lack effective automated testing mechanisms, with defects often manifesting as silent semantic errors that complicate test oracles. To address this challenge, this work proposes LogicHunter, a specification-aware active fuzzing approach that integrates Pydantic type constraints with real-world usage patterns to generate semantically extreme yet structurally valid inputs. Furthermore, it introduces the first Agentic Oracle mechanism, which leverages a ReAct-based architecture to dynamically retrieve documentation, analyze source code, and inspect runtime states for proactive bug identification. Evaluated across three major LLM agent frameworks, LogicHunter uncovered 40 previously unknown vulnerabilities—30 confirmed and 26 already patched—with the Agentic Oracle achieving a 91.17% accuracy, substantially outperforming the best passive oracle method (29.27%).
📝 Abstract
Large Language Model (LLM) agent frameworks such as LangChain, LlamaIndex, and CrewAI have become critical infrastructure powering production AI systems, yet they remain severely under-tested due to fundamental challenges in automated testing. Unlike traditional software, where crashes serve as reliable oracles, defects in these pure Python frameworks manifest as ordinary exceptions or silent semantic failures, creating profound oracle ambiguity. This problem is exacerbated by strict type governance through Pydantic schemas and complex protocol requirements that cause existing fuzzers to generate overwhelming invalid inputs, while traditional test generators produce only trivial cases with weak regression assertions. We present LogicHunter, a fuzzing framework that addresses both the generation and oracle challenges through active specification-aware testing. LogicHunter employs specification-driven generation that systematically fuses formal type constraints with authentic usage patterns from real-world repositories, synthesizing inputs that are valid by construction yet semantically extreme, equipped with behavioral probes to expose silent failures. To resolve oracle ambiguity, we introduce the Agentic Oracle, which transcends passive classification by actively retrieving documentation, navigating source code, and inspecting runtime states through a ReAct-based architecture with Dual-Layer State Management and Dual-Stream Memory. Evaluated on three widely deployed frameworks, LogicHunter discovered 40 previously unknown bugs with 30 confirmed and 26 fixed by developers, while state-of-the-art baselines reported no bugs as final findings. The Agentic Oracle achieves 91.17% precision, surpassing the best passive approach at 29.27% by 61 percentage points.
Problem

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

LLM agent frameworks
automated testing
oracle ambiguity
semantic failures
fuzzing
Innovation

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

Agentic Oracle
Specification-aware Fuzzing
LLM Agent Testing
Semantic Failure Detection
ReAct-based Debugging