Automated Penetration Testing with LLM Agents and Classical Planning
Authors:
- Ziyu LiZLZiyu Li
- Wenyuan ChenWCWenyuan Chen
Preprint
Abstract
While penetration testing plays a vital role in cybersecurity, achieving fully automated, hands-off-the-keyboard execution remains a significant research challenge. In this paper, we introduce the "Planner-Executor-Perceptor (PEP)" design paradigm and use it to systematically review existing work and identify the key challenges in this area. We also evaluate existing penetration testing systems, with a particular focus on the use of Large Language Model (LLM) agents for this task. The results show that the out-of-the-box Claude Code and Sonnet 4.5 exhibit superior penetration capabilities observed to date, substantially outperforming all prior systems. However, a detailed analysis of their testing processes reveals specific strengths and limitations; notably, LLM agents struggle with maintaining coherent long-horizon plans, performing complex reasoning, and effectively utilizing specialized tools. These limitations significantly constrain its overall capability, efficiency, and stability. To address these limitations, we propose CHECKMATE, a framework that integrates enhanced classical planning with LLM agents, providing an external, structured "brain" that mitigates the inherent weaknesses of LLM agents. Our evaluation shows that CHECKMATE outperforms the state-of-the-art system (Claude Code) in penetration capability, improving benchmark success rates by over 20%. In addition, it delivers substantially greater stability, cutting both time and monetary costs by more than 50%.Keywords
All Related Versions
This publication has 9 references indexed in Scilit:
- Large Language Model-Based Agents for Software Engineering: A SurveyACM Transactions on Software Engineering and Methodology, 2026
- AutoPentester: An LLM Agent-based Framework for Automated Pentesting2025
- Agents in software engineering: survey, landscape, and visionAutomated Software Engineering, 2025
- Mitigating spatial hallucination in large language models for path planning via prompt engineeringScientific Reports, 2025
- A Survey on Penetration Path Planning in Automated Penetration TestingApplied Sciences, 2024
- Lost in the Middle: How Language Models Use Long ContextsTransactions of the Association for Computational Linguistics, 2024
- Hierarchical reinforcement learning for efficient and effective automated penetration testing of large networksJournal of Intelligent Information Systems, 2022
- Autonomous Penetration Testing Based on Improved Deep Q-NetworkApplied Sciences, 2021
- Fast planning through planning graph analysisArtificial Intelligence, 1997