LACUNA: A Safer Programming Model for LLM Agents That Write Code
Researchers have introduced LACUNA, a programming model designed for LLM agents that generate code, tackling safety issues that arise when such code dictates runtime behavior. This model bridges the gap between the agent's runtime environment and the code it produces, enabling the generated code to impact runtime actions while ensuring safety through typed calls and type-checking. Each action taken by the agent is a typed call agent[T](task), where the LLM injects code during execution, which is then type-checked against the existing program prior to execution. By treating actions as a whole, the system avoids partial failures and inconsistent states, striving to enhance agent expressiveness without sacrificing safety.
Key facts
- LACUNA is a programming model for LLM agents that write code
- It closes the split between agent runtime and model-written code
- Each agent action is a typed call agent[T](task)
- Code is type-checked against the surrounding program before execution
- Actions are accepted or rejected as a whole
- The model addresses safety concerns from prompt injections, wrong tool calls, and partial failures
- The paper is on arXiv with identifier 2605.28617
Entities
Institutions
- arXiv