arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.00441cs.CRcs.AI
收藏

护栏没有免费午餐

No Free Lunch with Guardrails

Enkrypt AI(恩克莱普特人工智能公司)

Divyanshu Kumar, Nitin Aravind Birur, Tanay Baswa, Sahil Agarwal, Prashanth Harshangi

AI总结:

本研究针对大语言模型护栏在安全性与可用性间的权衡问题,提出评估框架并测试多种行业护栏与LLM,证实不存在免费午餐,并给出了优化护栏设计的蓝图。

摘要:

随着大语言模型(LLM)和生成式AI被广泛采用,护栏已成为确保其安全使用的关键工具。然而,添加护栏并非没有权衡:更强的安全措施可能会降低可用性,而更灵活的系统可能会为对抗性攻击留下漏洞。在本研究中,我们探讨了当前的护栏是否能在维持实际效用的同时有效防止误用。我们引入了一个框架来评估这些权衡,衡量不同护栏如何平衡风险、安全性和可用性,并构建了一个高效的护栏。我们的发现证实,护栏不存在免费午餐;加强安全性往往以牺牲可用性为代价。为了解决这个问题,我们提出了一个设计更优护栏的蓝图,以在维持可用性的同时将风险降至最低。我们评估了各种行业护栏,包括Azure Content Safety、Bedrock Guardrails、OpenAI的Moderation API、Guardrails AI、Nemo Guardrails和Enkrypt AI guardrails。此外,我们还评估了GPT-4o、Gemini 2.0-Flash、Claude 3.5-Sonnet和Mistral Large-Latest等LLM在不同系统提示下的响应,包括简单提示、详细提示以及带有思维链(CoT)推理的详细提示。我们的研究清晰比较了不同护栏的表现,突出了在平衡安全性和可用性方面的挑战。

英文摘要:

As large language models (LLMs) and generative AI become widely adopted, guardrails have emerged as a key tool to ensure their safe use. However, adding guardrails isn't without tradeoffs; stronger security measures can reduce usability, while more flexible systems may leave gaps for adversarial attacks. In this work, we explore whether current guardrails effectively prevent misuse while maintaining practical utility. We introduce a framework to evaluate these tradeoffs, measuring how different guardrails balance risk, security, and usability, and build an efficient guardrail. Our findings confirm that there is no free lunch with guardrails; strengthening security often comes at the cost of usability. To address this, we propose a blueprint for designing better guardrails that minimize risk while maintaining usability. We evaluate various industry guardrails, including Azure Content Safety, Bedrock Guardrails, OpenAI's Moderation API, Guardrails AI, Nemo Guardrails, and Enkrypt AI guardrails. Additionally, we assess how LLMs like GPT-4o, Gemini 2.0-Flash, Claude 3.5-Sonnet, and Mistral Large-Latest respond under different system prompts, including simple prompts, detailed prompts, and detailed prompts with chain-of-thought (CoT) reasoning. Our study provides a clear comparison of how different guardrails perform, highlighting the challenges in balancing security and usability.

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

↑