DefenderBench: A Toolkit for Evaluating Language Agents in Cybersecurity Environments

📄 arXiv: 2506.00739v4 📥 PDF

作者: Chiyu Zhang, Marc-Alexandre Cote, Michael Albada, Anush Sankaran, Jack W. Stokes, Tong Wang, Amir Abdi, William Blum, Muhammad Abdul-Mageed

分类: cs.CL

发布日期: 2025-05-31 (更新: 2025-10-14)

备注: Accepted by NeurIPS 2025 Workshop Scaling Environments for Agents (SEA)

🔗 代码/项目: GITHUB


💡 一句话要点

DefenderBench:用于评估语言智能体在网络安全环境中表现的工具包

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 网络安全 大型语言模型 智能体评估 开源工具包 漏洞分析

📋 核心要点

  1. 现有方法缺乏对LLM智能体在网络安全领域全面、标准化的评估工具,难以充分挖掘其潜力。
  2. DefenderBench提供了一个开源工具包,包含攻防和知识任务,旨在促进LLM在网络安全中的应用。
  3. 实验表明,Claude-3.7-sonnet表现最佳,Llama 3.3 70B作为开源模型也表现出色,验证了工具包的有效性。

📝 摘要(中文)

大型语言模型(LLM)智能体在人类语言理解和推理方面表现出令人印象深刻的能力,但它们在网络安全领域的潜力尚未得到充分探索。我们推出了 DefenderBench,这是一个实用的开源工具包,用于评估语言智能体在攻击、防御和基于网络安全知识的任务中的表现。DefenderBench 包括网络入侵、恶意内容检测、代码漏洞分析和网络安全知识评估等环境。它旨在经济实惠且易于研究人员访问,同时提供公平和严格的评估。我们使用标准化的智能体框架对几种最先进(SoTA)和流行的 LLM(包括开源和闭源模型)进行了基准测试。结果表明,Claude-3.7-sonnet 的 DefenderBench 得分最高,为 81.65,其次是 Claude-3.7-sonnet-think,得分为 78.40,而最佳开源模型 Llama 3.3 70B 的得分也不甘落后,为 71.81。DefenderBench 的模块化设计允许无缝集成自定义 LLM 和任务,从而提高可重复性和公平比较。DefenderBench 的匿名版本可在 https://github.com/microsoft/DefenderBench 获取。

🔬 方法详解

问题定义:论文旨在解决如何有效评估大型语言模型(LLM)智能体在网络安全领域的能力的问题。现有的评估方法要么不够全面,无法覆盖网络安全领域的各种任务(如攻击、防御和知识问答),要么缺乏标准化,导致不同模型之间的比较不公平,阻碍了LLM在网络安全领域的应用和发展。

核心思路:论文的核心思路是构建一个实用、开源且易于访问的工具包,即 DefenderBench,用于对LLM智能体在网络安全领域的各种任务进行全面、公平和可重复的评估。通过提供标准化的环境和评估指标,DefenderBench旨在促进LLM在网络安全领域的应用研究和模型开发。

技术框架:DefenderBench 包含以下主要模块: 1. 网络入侵环境:模拟真实的网络环境,评估智能体检测和防御网络攻击的能力。 2. 恶意内容检测环境:评估智能体识别恶意代码、恶意链接等恶意内容的能力。 3. 代码漏洞分析环境:评估智能体分析代码并发现潜在漏洞的能力。 4. 网络安全知识评估环境:评估智能体对网络安全知识的掌握程度。

DefenderBench 使用标准化的智能体框架,允许用户轻松集成自定义 LLM 和任务。它还提供了一套评估指标,用于衡量智能体在不同任务上的表现。

关键创新:DefenderBench 的关键创新在于其全面性、易用性和可扩展性。它不仅覆盖了网络安全领域的各种任务,还提供了标准化的环境和评估指标,方便研究人员进行公平比较。此外,DefenderBench 的模块化设计允许用户轻松集成自定义 LLM 和任务,促进了社区的参与和贡献。

关键设计:DefenderBench 的关键设计包括: 1. 模块化设计:允许用户根据需要选择和组合不同的环境和任务。 2. 标准化的智能体框架:方便用户集成自定义 LLM。 3. 全面的评估指标:用于衡量智能体在不同任务上的表现。 4. 开源代码和文档:促进社区的参与和贡献。具体参数设置、损失函数、网络结构等技术细节取决于所使用的LLM智能体。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,Claude-3.7-sonnet 在 DefenderBench 上取得了最高的 81.65 分,其次是 Claude-3.7-sonnet-think,得分为 78.40。开源模型 Llama 3.3 70B 也表现出色,得分为 71.81。这些结果验证了 DefenderBench 的有效性,并为研究人员选择合适的 LLM 提供了参考。

🎯 应用场景

DefenderBench 可应用于网络安全教育、智能安全工具开发、自动化漏洞挖掘与修复等领域。通过客观评估LLM在网络安全任务中的表现,可以加速相关技术落地,提升网络安全防御能力,并为未来的智能安全系统提供有力支持。

📄 摘要(原文)

Large language model (LLM) agents have shown impressive capabilities in human language comprehension and reasoning, yet their potential in cybersecurity remains underexplored. We introduce DefenderBench, a practical, open-source toolkit for evaluating language agents across offense, defense, and cybersecurity knowledge-based tasks. DefenderBench includes environments for network intrusion, malicious content detection, code vulnerability analysis, and cybersecurity knowledge assessment. It is intentionally designed to be affordable and easily accessible for researchers while providing fair and rigorous assessment. We benchmark several state-of-the-art (SoTA) and popular LLMs, including both open- and closed-weight models, using a standardized agentic framework. Our results show that Claude-3.7-sonnet performs best with a DefenderBench score of 81.65, followed by Claude-3.7-sonnet-think with 78.40, while the best open-weight model, Llama 3.3 70B, is not far behind with a DefenderBench score of 71.81. DefenderBench's modular design allows seamless integration of custom LLMs and tasks, promoting reproducibility and fair comparisons. An anonymized version of DefenderBench is available at https://github.com/microsoft/DefenderBench.