arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2407.16667cs.CRcs.AIcs.CL
收藏

RedAgent:利用上下文感知的自主语言智能体对大型语言模型进行红队测试

RedAgent: Red Teaming Large Language Models with Context-aware Autonomous Language Agent

The State Key Laboratory of Blockchain and Data Security, Zhejiang University(浙江大学区块链与数据安全国家重点实验室);School of Cyber Science and Technology, Zhejiang University(浙江大学网络科学与技术学院);Palo Alto Networks(派拓网络);University of North Texas(北得克萨斯大学)

Huiyu Xu, Wenhui Zhang, Zhibo Wang, Feng Xiao, Rui Zheng, Yunhe Feng, Zhongjie Ba, Kui Ren

AI总结:

提出多智能体系统RedAgent,通过建模“越狱策略”并利用上下文反馈自我反思,生成上下文感知的越狱提示词,高效发现黑盒LLM及定制应用的安全漏洞。

摘要:

最近,诸如GPT-4等先进的大型语言模型已被集成到许多现实世界的应用中,例如Code Copilot。这些应用显著扩大了LLM的攻击面,使其面临各种威胁。其中,通过越狱提示词诱导有害响应的越狱攻击引发了严重的安全担忧。为了识别这些威胁,越来越多的红队测试方法通过制作越狱提示词来模拟潜在的对抗场景,以测试目标LLM。然而,现有的红队测试方法未考虑LLM在不同场景下的独特漏洞,难以调整越狱提示词以发现特定上下文的漏洞。同时,这些方法仅限于使用少数变异操作来优化越狱模板,缺乏适应不同场景的自动化能力和可扩展性。为了实现上下文感知且高效的红队测试,我们将现有攻击抽象并建模为一个连贯的概念,称为“越狱策略”,并提出一个名为RedAgent的多智能体LLM系统,利用这些策略生成上下文感知的越狱提示词。通过在额外的记忆缓冲区中对上下文反馈进行自我反思,RedAgent不断学习如何在特定上下文中利用这些策略以实现有效越狱。大量实验表明,我们的系统仅需五次查询即可越狱大多数黑盒LLM,将现有红队测试方法的效率提高了一倍。此外,RedAgent能更高效地越狱定制的LLM应用。通过针对GPTs上的应用生成上下文感知的越狱提示词,我们仅用每项漏洞两次查询便发现了这些现实世界应用的60个严重漏洞。我们已报告所有发现的问题,并与OpenAI和Meta沟通以进行漏洞修复。

英文摘要:

Recently, advanced Large Language Models (LLMs) such as GPT-4 have been integrated into many real-world applications like Code Copilot. These applications have significantly expanded the attack surface of LLMs, exposing them to a variety of threats. Among them, jailbreak attacks that induce toxic responses through jailbreak prompts have raised critical safety concerns. To identify these threats, a growing number of red teaming approaches simulate potential adversarial scenarios by crafting jailbreak prompts to test the target LLM. However, existing red teaming methods do not consider the unique vulnerabilities of LLM in different scenarios, making it difficult to adjust the jailbreak prompts to find context-specific vulnerabilities. Meanwhile, these methods are limited to refining jailbreak templates using a few mutation operations, lacking the automation and scalability to adapt to different scenarios. To enable context-aware and efficient red teaming, we abstract and model existing attacks into a coherent concept called "jailbreak strategy" and propose a multi-agent LLM system named RedAgent that leverages these strategies to generate context-aware jailbreak prompts. By self-reflecting on contextual feedback in an additional memory buffer, RedAgent continuously learns how to leverage these strategies to achieve effective jailbreaks in specific contexts. Extensive experiments demonstrate that our system can jailbreak most black-box LLMs in just five queries, improving the efficiency of existing red teaming methods by two times. Additionally, RedAgent can jailbreak customized LLM applications more efficiently. By generating context-aware jailbreak prompts towards applications on GPTs, we discover 60 severe vulnerabilities of these real-world applications with only two queries per vulnerability. We have reported all found issues and communicated with OpenAI and Meta for bug fixes.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑