TLDR: xOffense is a new AI-driven, multi-agent framework for autonomous penetration testing that uses a fine-tuned, mid-scale open-source LLM (Qwen3-32B). It assigns specialized agents to reconnaissance, vulnerability scanning, and exploitation, coordinated by an orchestration layer. The framework leverages Chain-of-Thought fine-tuning and grey-box prompting to enhance reasoning and decision-making. Evaluated on AutoPenBench and AI-Pentest-Benchmark, xOffense consistently outperforms larger commercial LLMs and existing automated systems in task and sub-task completion rates, offering a cost-effective and reproducible solution for offensive security.
In the ever-evolving landscape of cybersecurity, penetration testing, or ‘pentesting,’ remains a crucial method for evaluating the security of computer systems. Traditionally, this has been a labor-intensive process, relying heavily on human experts. While automated approaches using Machine Learning (ML) and Deep Learning (DL) have emerged, they often struggle with simplified actions, high computational costs, and weak reasoning across the complex stages of reconnaissance, vulnerability analysis, and exploitation.
Recent advancements have seen Large Language Models (LLMs) like GPT-4 and LLaMA3-70B being leveraged for pentesting. However, these powerful models come with their own set of challenges: high operational costs, significant resource consumption, and sometimes a lack of adaptability to very specific security tasks, leading to issues like ‘hallucinations’ or losing context in multi-step workflows.
Introducing xOffense: A New Approach to Autonomous Pentesting
A new research paper, xOffense: An AI-driven autonomous penetration testing framework with offensive knowledge-enhanced LLMs and multi agent systems, introduces an innovative solution to these problems. Developed by Phung Duc Luong, Le Tran Gia Bao, Nguyen Vu Khai Tam, Dong Huu Nguyen Khoa, Nguyen Huu Quyen, Van-Hau Pham, and Phan The Duy, xOffense is an AI-driven, multi-agent framework designed to automate penetration testing, shifting from manual efforts to scalable, machine-executable workflows.
At its core, xOffense utilizes a fine-tuned, mid-scale open-source LLM called Qwen3-32B. This 32-billion-parameter model is specifically adapted for penetration testing tasks, enabling it to perform precise reasoning and make informed decisions throughout the pentest process. Instead of relying on a single, monolithic model, xOffense employs a multi-agent system where specialized agents collaborate. These agents are assigned distinct roles for reconnaissance (gathering information), vulnerability scanning (identifying weaknesses), and exploitation (taking advantage of vulnerabilities), with an orchestration layer ensuring smooth coordination between them.
Key Innovations of xOffense
The framework incorporates several key innovations to overcome the limitations of previous systems:
- Domain-Adapted Mid-Scale LLM: By fine-tuning Qwen3-32B with Chain-of-Thought penetration testing data, xOffense can generate accurate tool commands and perform consistent multi-step reasoning, making it highly effective for complex security tasks.
- Multi-Agent System: Specialized agents mimic human red teams, focusing on specific phases like reconnaissance, vulnerability analysis, and exploitation. This modular design helps manage complexity and maintain context.
- Grey-Box Phase Prompting: This context-aware mechanism provides agents with partial system insights (e.g., observed services, prior scan summaries). This allows for more informed decisions without full system disclosure, balancing realism with agent effectiveness.
- Task Coordination Graph (TCG): A structured planning system that breaks down pentest objectives into a sequence of tasks with clear dependencies. It dynamically updates based on execution outcomes, allowing for reflection and re-planning in case of failures.
- Information Aggregator: To combat the limited context windows of LLMs, this component consolidates verbose outputs from one phase into concise, actionable summaries for the next, optimizing token usage and preventing information overload.
- Action Executor with MemAgent: This component executes tool-specific commands in a simulated Kali Linux environment. It uses the MemAgent framework to efficiently handle and filter arbitrarily long outputs, ensuring critical information is retained for analysis.
Performance and Evaluation
xOffense was rigorously evaluated on two prominent benchmarks: AutoPenBench and AI-Pentest-Benchmark. The results were impressive, demonstrating that xOffense consistently outperforms contemporary methods, including larger commercial LLMs like GPT-4o and Llama3.1-405B, as well as leading open-source baselines like PentestGPT and VulnBot.
The framework achieved a sub-task completion rate of 79.17% and an overall task completion rate of 72.72%. Notably, the fine-tuned Qwen3-32B model, despite its smaller size compared to some competitors, showed a significant performance leap, validating the effectiveness of domain-specific fine-tuning and structured multi-agent orchestration. The integration of Retrieval-Augmented Generation (RAG) further boosted performance on complex real-world exploitation chains, allowing the model to leverage curated cybersecurity knowledge.
Also Read:
- Large Language Models Transform Security Operations Centers: A Survey of Capabilities and Future Directions
- Securing the AI Frontier: A Deep Dive into Threats and Defenses for LLM Systems
Conclusion
The findings highlight the significant potential of domain-adapted mid-scale LLMs, when integrated within structured multi-agent systems, to deliver superior, cost-efficient, and reproducible solutions for autonomous penetration testing. xOffense represents a substantial step forward in automating offensive security operations, making advanced pentesting more accessible and scalable.
Future work aims to further optimize command generation, enhance the robustness of long-running process handling, and extend capabilities to include advanced web and GUI interactions via browser automation, broadening the scope of xOffense’s application.


