EvoSafeHarness:为保护智能体而演化的模型与领域专用安全框架

·

研究论文 · 2026/09/11

大型语言模型(LLM)智能体正将语言转化为现实世界的影响,因此需要防范间接提示注入和直接有害请求。系统级安全防护栏在模型级防御之外增加了执行层,但现有防护栏通常由专家一次性设计,并跨异构模型和领域应用。有效的保护取决于部署环境:不同模型在效用下降前所需的执行强度不同,而不同领域需要管控的影响、状态和动作序列也各异。一个对某模型足够严格的防护栏可能对另一模型过度拦截,而跨领域迁移的策略可能遗漏应用特定的安全关系。我们提出 EvoSafeHarness,一个安全专用的优化框架,可为目标领域中的冻结模型合成可部署的防护栏。它联合搜索自然语言策略和可执行代码逻辑,以模型行为、领域规范和新鲜上下文对抗性审查为指导,拒绝基准特定的规则。在四个智能体基准系列上,EvoSafeHarness 实现了比固定专家设计防御更强的安全-效用前沿。在 DecodingTrust-Agent 上,它将平均攻击成功率从 45.6% 降至 10.0%,效用成本为 3.3 个百分点,并在 15 个单元格中的 14 个取得最佳分数。在 AgentDojo 上,它以 0.0% ASR 达到 82.8% 的效用,是 CaMeL 在同一操作点效用的两倍,并原样迁移到未见过的 AgentDyn 套件。它还在 Agent-SafetyBench 上为每个受害者取得最佳分数,并在自适应 PAIR 攻击下将平均 ASR 保持在 20% 以下,精炼预算为 16。分析表明,领域语义决定了需要哪些安全关系和轨迹状态,而模型和运行时行为决定了这些关系应在何处以及如何执行。

该研究针对 LLM 智能体部署中安全防护栏需因模型和领域而异的关键问题,提出了可自动合成防护栏的优化框架,并在多个基准上显著提升了安全-效用权衡,对智能体安全落地具有重要参考价值。

Large Language Model (LLM) agents are turning language into real-world effects, making safety necessary against both indirect prompt injections and direct harmful requests. System-level safety harnesses add an enforcement layer beyond model-level defenses, but existing harnesses are usually designed once by experts and applied across heterogeneous models and domains. Effective protection is deployment-dependent: models differ in how much enforcement they need before utility declines, while domains differ in the effects, state, and action sequences that must be governed. A harness that is strict enough for one model may over-block another, and a policy that transfers across domains may miss application-specific safety relations. We present EvoSafeHarness, a safety-specific optimization framework that synthesizes a deployable harness for a frozen model in a target domain. It jointly searches a natural-language policy and executable code logic, guided by model behavior, domain specifications, and fresh-context adversarial review to reject benchmark-specific rules. Across four agent benchmark families, EvoSafeHarness achieves a stronger safety-utility frontier than fixed expert-designed defenses. On DecodingTrust-Agent, it reduces average attack success rate from 45.6% to 10.0% at a 3.3-point utility cost and achieves the best score in 14 of 15 cells. On AgentDojo, it reaches 82.8% utility at 0.0% ASR, twice CaMeL's utility at the same operating point, and transfers unchanged to unseen AgentDyn suites. It also achieves the best score on Agent-SafetyBench for every victim and keeps mean ASR below 20% under adaptive PAIR attacks with a refinement budget of 16. Analysis shows that domain semantics determine which safety relations and trajectory state are needed, while model and runtime behavior determine how and where those relations should be enforced.

阅读原文

参与讨论