DefenderBench: A Toolkit for Evaluating Language Agents in Cybersecurity Environments

Chiyu Zhang, Marc-Alexandre Côté, Michael Albada, Anush Sankaran, Jack W Stokes, Tong Wang, Amir H. Abdi, William Blum, Muhammad Abdul-Mageed

TL;DR

This paper introduces DefenderBench, a novel, open-source toolkit designed to rigorously evaluate the capabilities of Large Language Model (LLM) agents in a variety of cybersecurity tasks, including offense, defense, and knowledge assessment. The toolkit and its benchmark results reveal that while top-tier proprietary models like Claude-3.7-sonnet currently lead, leading open-weight models like Llama 3.3 70B are rapidly closing the gap, highlighting the growing potential of LLMs in this critical domain.

What Problem Does This Paper Address?

The rapid advancement of LLMs has opened up exciting possibilities for automating complex tasks. However, their application in cybersecurity, a field demanding constant vigilance and sophisticated problem-solving, remains largely underexplored. Existing benchmarks often focus on narrow cybersecurity sub-domains or lack the interactive, agentic framework needed to truly assess how LLMs can operate within dynamic security environments. This leaves a significant gap in our understanding of LLM agents' real-world cybersecurity potential, hindering fair comparisons and the development of robust AI-driven security solutions.

Methods

DefenderBench tackles this challenge by providing a comprehensive, modular, and accessible toolkit. Its core components include:

  • Task Environments: These simulate realistic cybersecurity scenarios, ranging from network intrusion simulations (using CyberBattleSim) to malicious content detection, code vulnerability analysis, and cybersecurity knowledge assessment. These environments are designed to be text-based, allowing LLM agents to interact through natural language commands.
  • Standardized Agentic Framework: The toolkit employs a consistent agent interface, enabling seamless integration of various LLMs, both open- and closed-weight. This ensures fair comparisons by using a standardized approach to data preprocessing, task execution, and result reporting.
  • Modular Design: DefenderBench is built with extensibility in mind, allowing researchers to easily integrate their own LLMs, custom agents, and even new cybersecurity tasks through a plugin system. This promotes reproducibility and encourages community contributions.
  • Baseline Agent: A simple baseline agent is provided to establish a performance floor and facilitate initial evaluations.

Datasets

DefenderBench leverages several publicly accessible datasets and environments, including:

  • CyberBattleSim (CBS): For network intrusion simulation.
  • MALICIOUS-TEXT and MALICIOUS-WEB: Datasets for malicious content and phishing detection, adapted from existing sources.
  • CodeXGLUE and Devign: For code vulnerability detection.
  • CVEFix: For code vulnerability fixing.
  • CTI-MCQA: A dataset for cyber threat intelligence multiple-choice questions.

The paper also highlights the importance of preprocessing these datasets to create interactive environments suitable for LLM agents.

Key Insights and Ideas

  • LLMs are surprisingly capable in cybersecurity: The results demonstrate that even without extensive domain-specific fine-tuning, LLM agents can perform remarkably well across a range of cybersecurity tasks.
  • Model size matters, but not always: While larger models generally perform better, the performance gains are not always linear, and some smaller, specialized models can achieve competitive results in specific tasks.
  • Interactive tasks are a significant challenge: Network intrusion, an inherently interactive task, proved more difficult for LLMs than static detection or knowledge-based tasks, highlighting the need for better strategic planning and adaptive learning.
  • Few-shot learning and CoT prompting offer significant boosts: Augmenting LLM inputs with examples (few-shot learning) and encouraging step-by-step reasoning (Chain-of-Thought prompting) demonstrably improves performance, especially for more complex tasks.
  • Code vulnerability tasks remain difficult: Detecting and fixing code vulnerabilities are still challenging areas for LLMs, suggesting that further advancements in program understanding and reasoning are needed.

Key Results

  • Overall Performance: Claude-3.7-sonnet achieved the highest DefenderBench score of 81.65.
  • Top Open-Weight Model: Llama 3.3 70B secured the highest score among open-weight models at 71.81, closely followed by other Llama models.
  • Network Intrusion: Top LLMs like LLaMA 3.3 70B and Claude-3.7-sonnet achieved perfect winning rates on simpler network intrusion scenarios, demonstrating their ability to exploit predictable patterns. However, performance dropped significantly in more complex, dynamic environments.
  • Malicious Content Detection: Most proprietary LLMs and several open-weight models showed strong performance (Macro-F1 scores above 90 for some tasks).
  • Vulnerability Detection: This task proved challenging, with most models performing only slightly better than a random baseline. GPT-4-turbo and GPT-3 performed best among proprietary models, while Llama 3.3 70B led the open-weight models.
  • Code Fixing: None of the LLM agents outperformed a simple copy-paste baseline in terms of CodeBLEU scores, indicating that current metrics may not fully capture patch quality for small edits.

Limitations and Future Work

The authors acknowledge several limitations:

  • Limited Task Scope: DefenderBench currently covers only five cybersecurity tasks, which is not exhaustive of the domain's breadth.
  • Data Hosting: The toolkit relies on publicly accessible datasets and environments, rather than hosting the data directly.
  • Model Selection: The rapid pace of LLM development means that the evaluated models represent a snapshot in time, and newer models may not be included.

Future work includes expanding the benchmark with more tasks and evaluation metrics, encouraging community contributions, and exploring more advanced LLM architectures and training methodologies to address the identified challenges, particularly in code vulnerability analysis and interactive environments.

Summary updated

BibTeX
@inproceedings{zhang2025defenderbench,
  author = {Chiyu Zhang and Marc-Alexandre Côté and Michael Albada and Anush Sankaran and Jack W Stokes and Tong Wang and Amir H. Abdi and William Blum and Muhammad Abdul-Mageed},
  title = {{DefenderBench: A Toolkit for Evaluating Language Agents in Cybersecurity Environments}},
  booktitle = {SEA @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=BtZBwwjO5d},
}
Figure