mlsanityData to 14 Oct 2026

Guided Reasoning in LLM-Driven Penetration Testing Using Structured Attack Trees

arXiv 2509.07939 ↗First posted 9 Sep 2025cs.CR cs.LGcited by 2

On the map: LLM reasoning → Reasoning for agents, planning and code

also in 1 more
Abstract (arXiv)

Recent advances in Large Language Models (LLMs) have driven interest in automating cybersecurity penetration testing workflows, offering the promise of faster and more consistent vulnerability assessment for enterprise systems. Existing LLM agents for penetration testing primarily rely on self-guided reasoning, which can produce inaccurate or hallucinated procedural steps. As a result, the LLM agent may undertake unproductive actions, such as exploiting unused software libraries or generating cyclical responses that repeat prior tactics. In this work, we propose a guided reasoning pipeline for penetration testing LLM agents that incorporates a deterministic task tree built from the MITRE ATT&CK Matrix, a proven penetration testing kll chain, to constrain the LLM's reaoning process to explicitly defined tactics, techniques, and procedures. This anchors reasoning in proven penetration testing methodologies and filters out ineffective actions by guiding the agent towards more productive attack procedures. To evaluate our approach, we built an automated penetration testing LLM agent using three LLMs (Llama-3-8B, Gemini-1.5, and GPT-4) and applied it to navigate 10 HackTheBox cybersecurity exercises with 103 discrete subtasks representing real-world cyberattack scenarios. Our proposed reasoning pipeline guided the LLM agent through 71.8%, 72.8%, and 78.6% of subtasks using Llama-3-8B, Gemini-1.5, and GPT-4, respectively. Comparatively, the state-of-the-art LLM penetration testing tool using self-guided reasoning completed only 13.5%, 16.5%, and 75.7% of subtasks and required 86.2%, 118.7%, and 205.9% more model queries. This suggests that incorporating a deterministic task tree into LLM reasoning pipelines can enhance the accuracy and efficiency of automated cybersecurity assessments

Key facts. Cited by 2 papers in the map (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 5 of its 40 references that are in the map. First posted on arXiv 9 Sep 2025.

Builds on

5 of 40 references.

References · 5

  1. 2023A Survey of Large Language Modelscited by 2,576
  2. 2023A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questionscited by 1,601
  3. 2024Cybench: A Framework for Evaluating Cybersecurity Capabilities and Risks of Language Modelscited by 164
  4. 2023The Troubling Emergence of Hallucination in Large Language Models -- An Extensive Definition, Quantification, and Prescriptive Remediationscited by 131
  5. 2024KnowAgent: Knowledge-Augmented Planning for LLM-Based Agentscited by 61

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 2.

2 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Automated Penetration Testing with LLM Agents and Classical Planning
  2. 2025From Capabilities to Performance: Evaluating Key Functional Properties of LLM Architectures in Penetration Testing
  3. 2025Construction and Evaluation of LLM-based agents for Semi-Autonomous penetration testing
  4. 2026What Makes a Good LLM Agent for Real-world Penetration Testing?
  5. 2024HackSynth: LLM Agent and Evaluation Framework for Autonomous Penetration Testing
  6. 2026Hackers or Hallucinators? A Comprehensive Analysis of LLM-Based Automated Penetration Testing
  7. 2026ZERO-APT: A Closed-Loop Adversarial Framework for LLM-Driven Automated Penetration Testing under Intelligent Defense ↗
  8. 2026Staying on the Attack Path: Structured State for Long-Horizon Automated Penetration Testing