Concordat: Typed Sessions for LLM Agents· Concordat: 大语言模型代理的类型会话
Agents built on large language models are increasingly allowed to take consequential actions: cancelling bookings, issuing refunds, changing accounts. The rules that govern those actions, such as "obtain the customer's explicit confirmation before changing anything", are usually stated in the prompt and followed only as reliably as the model chooses to follow them. We present Concordat, a Python library that treats an agent as an object whose interface is a finite-state protocol, in the spirit of typestate and session types, and enforces that protocol on the model at run time. On every turn the model is offered only the tools that are legal in the current protocol state, calls outside that set are rejected before they have side effects, decisions reserved for humans can only be requested,
Concordat 通过协议状态约束 LLM 代理行为,确保遵循规则。
- 核心方法
- Concordat 将 LLM 代理视为一个具有有限状态协议的对象,通过 Python 库在运行时强制执行该协议,限制代理的工具选择范围,确保其行为符合当前状态的规则。
- 适合谁读
- 研究者 / 工程师
- 要解决的问题
- 现有 LLM 代理在执行关键操作时,可能不严格遵循预定规则,导致不可预期的后果。
- 关键实验
- 未提供
- 主要贡献
- 提供了一种在 LLM 代理中实现类型会话的方法,通过协议状态管理保证了代理行为的可靠性和安全性。
- 意义与局限
- 意义在于提高了 LLM 代理在处理敏感操作时的可控性和安全性,但可能限制了代理的灵活性和自适应能力。