From Capabilities to Performance: Evaluating Key Functional Properties of LLM Architectures in Penetration Testing

Lanxiao Huang, Daksh Dave, Tyler Cody, Peter A. Beling, Ming Jin

TL;DR

Large Language Models (LLMs) show promise in automating penetration testing (PT), but their effectiveness is hindered by issues like context loss and brittle planning. This paper systematically evaluates LLM agents across realistic PT tasks, identifying key functional properties (like context retention and adaptive planning) that significantly improve performance when augmented.

What Problem Does This Paper Address?

Penetration testing (PT) is a critical cybersecurity practice, but it's labor-intensive and requires deep expertise. While traditional PT relies on human experts and rule-based automation, recent advancements in Large Language Models (LLMs) offer a more flexible approach. LLMs can potentially automate reconnaissance, craft exploits, and respond dynamically to network feedback. However, their application in PT faces significant challenges: minor errors in generated commands can derail attacks, specialized tools require precise syntax, and multi-step attacks demand long-range memory and reasoning, which are strained by LLM context limitations. This paper aims to bridge this gap by comprehensively evaluating LLM-based PT agents and identifying architectural augmentations that enhance their performance and reliability.

Methods

The authors developed a comprehensive evaluation framework for LLM-based penetration testing agents. They tested various LLM architectures, including single-agent and modular designs, across realistic PT scenarios. To understand the impact of specific capabilities, they introduced and evaluated five targeted augmentations:

  • Global Context Memory (GCM): Enhances context coherence and retention.
  • Inter-Agent Messaging (IAM): Improves inter-component coordination and state management.
  • Context-Conditioned Invocation (CCI): Boosts tool usage accuracy and selective execution.
  • Adaptive Planning (AP): Supports multi-step strategic planning and error detection/recovery.
  • Real-Time Monitoring (RTM): Addresses real-time dynamic responsiveness.

They measured performance using Subtask Completion Rate (SCR), False Rate (FR), and ease of use metrics (user interactions, human interventions, knowledge level).

Datasets

The evaluation used vulnerable machines from platforms like Hack The Box (HTB) and Metasploitable. These machines were chosen to cover a wide range of attack vectors and difficulty levels, spanning multiple MITRE ATT&CK tactics. The paper does not mention training datasets for the LLMs themselves, as they focused on evaluating pre-trained models.

Key Insights and Ideas

  • Functional Properties are Key: The study strongly suggests that an LLM agent's success in PT depends less on its architectural type (single vs. modular) and more on how well it embodies core functional properties like context retention, planning, and error recovery.
  • Modular Agents Benefit from Augmentations: While single-agent LLMs (like GPT-4 and Claude) perform well on simpler tasks, modular agents significantly improve when augmented with specific capabilities, especially for complex, multi-step scenarios.
  • MITM Attacks Expose Real-Time Limitations: All tested models failed on Man-in-the-Middle (MITM) attacks, highlighting a critical gap in LLMs' ability to handle real-time, dynamic network environments and event-driven adaptation.
  • Failure Modes are Traceable: The research effectively maps high-level failure modes (e.g., hallucinations, looping) to specific root causes (e.g., prompt ambiguity, missing inter-agent memory), providing clear targets for improvement.
  • LLM Roles are Dynamic: The roles of LLMs in cybersecurity (autonomous attacker, augmented assistant, hybrid) are not fixed but rather dynamic configurations influenced by task complexity, risk, and the agent's functional scaffolding.

Key Results

  • Augmentations Boost Performance: Targeted augmentations, particularly Adaptive Planning (AP) and Global Context Memory (GCM), showed significant improvements in Subtask Completion Rate (SCR) for modular agents. For instance, PenHeal with AP achieved a 72.4% SCR.
  • MITM Failure is Universal: All models achieved 0% SCR on MITM tasks, underscoring a fundamental limitation in real-time responsiveness.
  • Complexity Impacts Performance: Performance generally dropped with increasing task complexity, especially for post-exploitation and Active Directory tasks.
  • Failure Mode Distribution: Hallucinations and syntax errors were common, but issues like looping and context loss were also significant, particularly in multi-step scenarios.
  • Ease of Use Varies: Models like GPT-4 and Claude required minimal intervention, while others like Gemini and AutoAttacker frequently stalled, indicating issues with coherence and tool execution logic.

Limitations and Future Work

Limitations: * The study focused on specific LLM versions and configurations, which are subject to ongoing updates. * The evaluation relied on text-based command parsing rather than direct integration with network monitoring tools. * The testbed was limited to specific platforms (HTB, Metasploitable), which may not fully represent larger enterprise networks. * Ethical and regulatory aspects were considered in a controlled lab environment and may differ in real-world engagements.

Future Work: The authors suggest embedding the identified functional capabilities more natively within agent architectures. This includes persistent memory, inter-agent grounding, and temporal sensitivity to support more robust and autonomous offensive security systems.

Summary updated

BibTeX
@inproceedings{huang2025from,
  author = {Lanxiao Huang and Daksh Dave and Tyler Cody and Peter A. Beling and Ming Jin},
  title = {{From Capabilities to Performance: Evaluating Key Functional Properties of LLM Architectures in Penetration Testing}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
}
Figure