本仓库包含我们项目的代码与实验,该项目旨在防御工具集成式大型语言模型(LLM)智能体免受对抗性攻击。
我们基于 Agent Security Bench(ASB)构建,评估集成工具与结构化推理(例如思维链、反思)如何影响 LLM 智能体在多种任务场景下对对抗性提示的脆弱性。
本仓库包含:
本项目改编并扩展了官方 ASB 仓库的代码:
Agent Security Bench (ASB): Formalizing and Benchmarking Attacks and Defenses in LLM-based Agents
GitHub: https://github.com/agiresearch/ASBench
Paper: https://openreview.net/forum?id=V4y0CpX4hK
我们感谢 ASB 作者公开其框架。
pip install -r requirements.txt
评估 DPI:
python attack_launcher.py --cfg_path ./config/DPI.yml
评估 IPI:
python attack_launcher.py --cfg_path ./config/IPI.yml
评估 MP:
python attack_launcher.py --cfg_path ./config/MP.yml
评估后门攻击:
python agent_attack_pot.py