arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2605.28617cs.AIcs.PL
收藏

LACUNA: 作为递归程序空洞的安全智能体

LACUNA: Safe Agents as Recursive Program Holes

EPFL(苏黎世联邦理工学院)

Yaoyu Zhao, Yichen Xu, Oliver Bračevac, Cao Nguyen Pham, Frank Zhengqing Wu, Martin Odersky

AI总结:

提出LACUNA编程模型,通过类型化调用和编译时检查,让LLM智能体以递归程序空洞的方式安全地编写代码,实现表达性与安全性的统一。

摘要:

LLM智能体越来越多地通过编写代码来行动,但驱动智能体的运行时与模型编写的代码之间仍然存在分裂。运行时拥有循环、上下文和控制流,而模型对这些几乎没有发言权。让模型编写的代码塑造运行时本身将使智能体更具表达性,但也会加剧安全问题。模型可能因提示注入而偏离方向、调用错误的工具,或在执行中途失败并留下不一致的状态,而当代码塑造运行时,此类失败的波及范围比仅表达单个动作时更广。我们提出了LACUNA,一种智能体编程模型,它在保持安全性的同时弥合了这种分裂。每个智能体动作都是一个类型化调用$\texttt{agent[T](task)}$,当执行到达该调用时,LLM用代码填充它,并且在代码运行之前,会针对周围程序进行类型检查。由于每个动作作为一个整体被接受或拒绝,被拒绝的动作不会影响环境,其编译器诊断信息会驱动重试。同样的检查也限制了动作可以使用哪些工具和数据以及它们如何流动。我们的原语将ReAct循环、子智能体、技能、并行分解和多模型规划表达为普通的控制流。我们在测试用例集合、BrowseComp-Plus和$τ^2$-bench上评估了LACUNA。在BrowseComp-Plus上,8.6%的生成在执行前被拒绝,平均每次查询重试0.7次,智能体达到27.1%的准确率。在$τ^2$-bench上,LACUNA使用一个能力强的模型解决了四个领域392个任务中的76.0%,与基线智能体相当。

英文摘要:

LLM agents increasingly act by writing code, yet a split persists between the runtime that drives the agent and the code the model writes. The runtime owns the loop, context, and control flow, and the model has little say over any of them. Letting model-written code shape the runtime itself would make agents more expressive, but it would also sharpen safety problems. A model can be diverted by a prompt injection, call the wrong tool, or fail partway and leave an inconsistent state, and each such failure reaches further when the code shapes the runtime than when it expresses a single action. We present LACUNA, a programming model for agents that closes this split while preserving safety. Each agent action is a typed call $\texttt{agent[T](task)}$ that the LLM fills with code when execution reaches it, and the code is type-checked against the surrounding program before it runs. Because each action is accepted or rejected as a whole, a rejected one leaves the environment untouched, and its compiler diagnostics drive a retry. The same check also bounds which tools and data an action may use and how they flow. Our primitive expresses ReAct loops, sub-agents, skills, parallel decomposition, and multi-model planning as ordinary control flow. We evaluate LACUNA on a collection of test cases, BrowseComp-Plus, and $τ^2$-bench. On BrowseComp-Plus, $8.6\%$ of generations are rejected before execution, with 0.7 retries per query on average, and the agent reaches $27.1\%$ accuracy. On $τ^2$-bench, LACUNA solves $76.0\%$ of $392$ tasks across four domains with a capable model, on par with the baseline agent.

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

↑