mlsanityData to 14 Oct 2026

Pentest-R1: Towards Autonomous Penetration Testing Reasoning Optimized via Two-Stage Reinforcement Learning

arXiv 2508.07382 ↗First posted 10 Aug 2025cs.AI cs.LGcited by 5

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

Abstract (arXiv)

Automating penetration testing is crucial for enhancing cybersecurity, yet current Large Language Models (LLMs) face significant limitations in this domain, including poor error handling, inefficient reasoning, and an inability to perform complex end-to-end tasks autonomously. To address these challenges, we introduce Pentest-R1, a novel framework designed to optimize LLM reasoning capabilities for this task through a two-stage reinforcement learning pipeline. We first construct a dataset of over 500 real-world, multi-step walkthroughs, which Pentest-R1 leverages for offline reinforcement learning (RL) to instill foundational attack logic. Subsequently, the LLM is fine-tuned via online RL in an interactive Capture The Flag (CTF) environment, where it learns directly from environmental feedback to develop robust error self-correction and adaptive strategies. Our extensive experiments on the Cybench and AutoPenBench benchmarks demonstrate the framework's effectiveness. On AutoPenBench, Pentest-R1 achieves a 24.2% success rate, surpassing most state-of-the-art models and ranking second only to Gemini 2.5 Flash. On Cybench, it attains a 15.0% success rate in unguided tasks, establishing a new state-of-the-art for open-source LLMs and matching the performance of top proprietary models. Ablation studies confirm that the synergy of both training stages is critical to its success.

Key facts. Cited by 5 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 27 of its 44 references that are in the map. First posted on arXiv 10 Aug 2025.

Builds on

27 of 44 references.

Closest ancestors · 1

Same direction, newest first

  1. 2024OpenAI o1 System Card21 Dec

Other references · 26

  1. 2023GPT-4 Technical Reportcited by 18,396
  2. 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
  3. 2025Qwen3 Technical Reportcited by 8,820
  4. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
  5. 2024GPT-4o System Cardcited by 4,588
  6. 2025Gemini 2.5: Pushing the Frontier with Advanced Reasoning, Multimodality, Long Context, and Next Generation Agentic Capabilitiescited by 3,796
  7. 2025Search-R1: Training LLMs to Reason and Leverage Search Engines with Reinforcement Learningcited by 1,444
  8. 2023Gemini: A Family of Highly Capable Multimodal Modelscited by 872
  9. 2025Group-in-Group Policy Optimization for LLM Agent Trainingcited by 497
  10. 2024LLaVA-CoT: Let Vision Language Models Reason Step-by-Stepcited by 454
  11. 2025RAGEN: Understanding Self-Evolution in LLM Agents via Multi-Turn Reinforcement Learningcited by 386
  12. 2024Cybench: A Framework for Evaluating Cybersecurity Capabilities and Risks of Language Modelscited by 164
14 more
  1. 2025A Minimalist Approach to LLM Reasoning: from Rejection Sampling to Reinforcecited by 145
  2. 2024Marco-o1: Towards Open Reasoning Models for Open-Ended Solutionscited by 144
  3. 2025Competitive Programming with Large Reasoning Modelscited by 119
  4. 2025Reinforcement Learning with Verifiable Rewards: GRPO's Effective Loss, Dynamics, and Success Amplificationcited by 110
  5. 2024AutoAttacker: A Large Language Model Guided System to Implement Automatic Cyber-attackscited by 96
  6. 2024LLaMA-Berry: Pairwise Optimization for O1-like Olympiad-Level Mathematical Reasoningcited by 91
  7. 2024o1-Coder: an o1 Replication for Codingcited by 78
  8. 2025VulnBot: Autonomous Penetration Testing for A Multi-Agent Collaborative Frameworkcited by 31
  9. 2025Real-World Doctor Agent with Proactive Consultation through Multi-Agent Reinforcement Learningcited by 27
  10. 2024From Novice to Expert: LLM Agent Policy Optimization via Step-wise Reinforcement Learningcited by 22
  11. 2024AutoPenBench: Benchmarking Generative Agents for Penetration Testingcited by 21
  12. 2025CAI: An Open, Bug Bounty-Ready Cybersecurity AIcited by 14
  13. 2025Can LLMs Hack Enterprise Networks? Autonomous Assumed Breach Penetration-Testing Active Directory Networkscited by 12
  14. 2020Autosploit: A Fully Automated Framework for Evaluating the Exploitability of Security Vulnerabilitiescited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 1; 2026: 4.

5 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024Mind the Gap: Towards Generalizable Autonomous Penetration Testing via Domain Randomization and Meta-Reinforcement Learning
  2. 2026Pen-Strategist: A Reasoning Framework for Penetration Testing Strategy Formation and Analysis
  3. 2026Ask the Expert: LLM-Guided Reinforcement Learning for Autonomous Cyber Defense
  4. 2025AutoPentest: Enhancing Vulnerability Management With Autonomous LLM Agents
  5. 2024Knowledge-Informed Auto-Penetration Testing Based on Reinforcement Learning with Reward Machine
  6. 2026Big Enough to Break Out: Tracking the Rising Capability of LLM Penetration-Testing Agents
  7. 2024HackSynth: LLM Agent and Evaluation Framework for Autonomous Penetration Testing
  8. 2025Guided Reasoning in LLM-Driven Penetration Testing Using Structured Attack Trees