12-04 更新 实时
首页/ 产业落地/ 正文

AWS 押注形式逻辑约束 AI 智能体行为

产业落地 来源:IEEE Spectrum AI 2026-12-02 00:30 2 阅读 机器翻译

《IEEE Spectrum》十二月刊现已上线!

AWS 押注形式逻辑,让 AI 智能体循规蹈矩

致技术内行人士

致技术内行人士

《IEEE Spectrum》是 IEEE 的旗舰出版物——IEEE 是全球最大的致力于工程与应用科学的专业组织。我们的文章、视频和信息图表让读者了解技术、工程和科学领域的最新进展。

创建账户,即可享受更多免费内容和权益

保存文章以便稍后阅读需要 IEEE Spectrum 账户

《The Institute》的内容仅对会员开放

下载完整 PDF 期刊仅限 IEEE 会员

下载本电子书仅限 IEEE 会员

访问 Spectrum 数字版仅限 IEEE 会员

关注主题是一项仅限 IEEE 会员的功能

加入全球最大的致力于工程与应用科学的专业组织,获取 Spectrum 所有文章、档案、PDF 下载及其他权益。了解有关 IEEE 的更多信息 →

加入全球最大的致力于工程与应用科学的专业组织,获取本电子书以及 IEEE Spectrum 的所有文章、档案、PDF 下载及其他权益。了解有关 IEEE 的更多信息 →

访问数千篇文章——完全免费

创建账户即可获取专属内容和功能:保存文章、下载合集、发表评论——全部免费!如需完整访问权限和权益,请订阅 Spectrum。

AWS 押注形式逻辑能让 AI 智能体守规矩

新工具让开发者编写数学上可保证的智能体规则

Edd Gent 是 IEEE Spectrum 的特约编辑。

企业正竞相将 AI 智能体部署到从客户服务到软件工程的各种场景中,但尚无可靠方法阻止它们行为失当。Amazon Web Services (AWS) 现在推出一款工具,可将开发者用通俗英语编写的规则转化为智能体无法违反的、数学上可验证的策略。

与传统软件的行为由手写的确定性代码决定不同,智能体由大型语言模型(LLM)驱动,而 LLM 是概率性的。它们的输出可能每次运行都不同,因此很难保证其行为可预测。尽管开发者已围绕模型构建确定性脚手架,让智能体循规蹈矩,但这仍远非万无一失。

为缓解这一问题,企业通常会严格限制智能体的行动,或要求由人类批准关键步骤。AWS 神经符号 AI 产品管理总监 Cami Novelli-Killeen 表示,这会增加摩擦,可能限制其实用性,并在人类监督者中引入“批准疲劳”。

“形式化方法”提供了一种有前景的替代方案。这些技术以数学方式定义软件应该做什么,并证明其符合要求。Novelli-Killeen 表示,挑战在于,编写这些规则传统上需要专业数学家。AWS 名为 Greenlight 的新工具绕开了这一难题,它利用 LLM 将自然语言表述的规则自动转换为经过形式化验证的策略,在运行时约束智能体的行为。它甚至可以根据智能体的角色建议策略,并在已部署的智能体遇到新情况时推荐更新。

“这段体验的核心,是帮助某个在特定岗位上具备专业知识的行家,把他们的圈内经验知识、他们的常识、他们对这份工作是非对错的判断,转化为智能体能够确定性地遵循的精确策略,”Novelli-Killeen 说。

AWS Greenlight 如何防范失控的智能体

智能体的创造力使得逐一列出它们应当避免的所有不良行为实际上不可能。因此,Greenlight 让智能体在 Strands Box 中运行——这是 AWS 于 10 月发布的一款软件沙箱——它会拦截每一个会对外部世界产生影响的操作,例如调用 API 或写入文件,并予以批准或拒绝。

这些决定由一组用 Dogwood 编写的策略做出,Dogwood 是 AWS 于 8 月推出的、用于为智能体编写规则的新语言。它依赖形式化方法中的一个分支——一阶时序逻辑,这一分支对治理智能体尤为有用,因为它能处理事物如何随时间变化的概念。“如果你说,‘我希望这个个人智能体持有我的信用卡信息,但我不希望它每月花费超过 1000 美元’,这在以前的策略语言中很难表达,”AWS 副总裁兼杰出工程师 Marc Brooker 说。“它必须记住自己目前已花了多少,而且……它必须知道一个月是什么。”

Novelli-Killeen 说,这个沙箱被设为默认拒绝,然后用户通过编写策略来规定智能体可以采取哪些行动,从而“在盒子上戳出孔洞”。Greenlight 的新意在于,这一过程如今实现了自动化。该工具是 Claude Code、Codex 和 Kiro 等 AI 编程助手的插件,在构建智能体时,用户只需提示该助手提出用于治理它的策略。

该工具会读取智能体的文档和日志,以推断它的职责,用自然语言提出策略,并在后台用 Dogwood 写出形式化版本。用户也可以用自己的自然语言添加规则,并在需要时查看 Dogwood 版本。Novelli-Killeen 说,目标是带来一种体验,“感觉就像有一位数学家坐在你身边,帮你弄清楚智能体的规范。”

该工具随后把这些规则从 Dogwood 转换为 Lean——一种用于编写可机器校验的数学证明的编程语言。接着,专有的“自动推理引擎”会检查这些规则彼此之间、以及它们与智能体所用工具之间如何相互作用,以找出意料之外的漏洞。Brooker 说,一旦获得批准,这些策略会被编译为 SQL,智能体尝试的每一个动作都会对照它们进行检查,这通常只会给一次工具调用增加几十毫秒。关键在于,由于这些规则有形式化的数学基础,每个决策都能附带一份可审计的证明,说明它为何被做出。

让这个工具成为可能的,是 LLM 日益增强的将自然语言转换为形式语言的能力——这是计算机科学中悬而未决数十年的难题。“这是过去五年里从几乎难以攻克变得非常、非常可解的问题之一,”Brooker 说。

Greenlight 可能力有未逮之处

然而,翻译错误的风险始终存在,卡尔斯鲁厄理工学院的教授 André Platzer 说,他把形式化方法应用于自主系统。他转述著名计算机科学家 Alan Perlis 的话并指出,“不存在从非形式化走向形式化的形式化路径。”

“你永远无法真正确定,非正式的自然英语是否被正确地转换成了逻辑,”Platzer 说。

该工具也没有解决形式化方法中长期存在的一个问题:它们只能证明某个动作没有违反用户的规范,却不能证明该规范捕捉到了所期望的行为。“‘我是否构建了正确的东西’与‘我是否正确地构建了东西’之间是有区别的,”Platzer 说。“最终,这两个问题你都需要回答。”

尽管如此,他认为 Greenlight 仍可能带来切实的实际价值,因为很少有人理解形式逻辑。让非专家也能用上形式化方法可能“极具影响力”,即便结果并非滴水不漏。

Novelli-Killeen 承认,该工具并非“一劳永逸”的解决方案,而必须成为持续改进流程的一部分。为此,一项回放功能允许用户用新策略重放此前的智能体会话,以查看其表现。“我们试图做的是,在保持智能体创造力和灵活性的同时,加入一些确定性的时刻,”她补充道。

Moor Insights & Strategy 负责应用、智能体与自动化的副总裁兼首席分析师 Jason Andersen 表示,这可能是现有智能体治理方法的一个有前景的替代方案。他在 Greenlight 发布前听取了相关介绍。如今最流行的治理方法是使用多个 LLM 来审查智能体的输出,但这种方式成本高昂,而且归根结底仍是一个概率模型在评估另一个概率模型。“[Greenlight] 是一种不同的正确性实现路径,可以说更好,”他说。“这是两种不同的评估方法,而不是两种相同的方法。”

他认为,对于那些运行容错率极低的关键业务流程的智能体来说,这很可能被证明特别有价值,尤其是在金融和医疗等领域。

译文由英文原文机器翻译,术语按行业惯例统一,可在文末展开原文核对。

查看英文原文(AWS Bets Formal Logic Can Keep AI Agents in Line)

The December issue of IEEE Spectrum is here!

AWS Bets Formal Logic Can Keep AI Agents in Line

FOR THE TECHNOLOGY INSIDER

FOR THE TECHNOLOGY INSIDER

IEEE Spectrum is the flagship publication of the IEEE — the world’s largest professional organization devoted to engineering and applied sciences. Our articles, videos, and infographics inform our readers about developments in technology, engineering, and science.

Enjoy more free content and benefits by creating an account

Saving articles to read later requires an IEEE Spectrum account

The Institute content is only available for members

Downloading full PDF issues is exclusive for IEEE Members

Downloading this e-book is exclusive for IEEE Members

Access to Spectrum 's Digital Edition is exclusive for IEEE Members

Following topics is a feature exclusive for IEEE Members

Join the world’s largest professional organization devoted to engineering and applied sciences and get access to all of Spectrum’s articles, archives, PDF downloads, and other benefits. Learn more about IEEE →

Join the world’s largest professional organization devoted to engineering and applied sciences and get access to this e-book plus all of IEEE Spectrum’s articles, archives, PDF downloads, and other benefits. Learn more about IEEE →

Access Thousands of Articles — Completely Free

Create an account and get exclusive content and features: Save articles, download collections, and post comments — all free! For full access and benefits, subscribe to Spectrum .

AWS Bets Formal Logic Can Keep AI Agents in Line

New tool lets developers write mathematically guaranteed agent rules

Edd Gent is a contributing editor for IEEE Spectrum.

Abstract flowchart with pixelated neon shapes.

Companies are racing to deploy AI agents in everything from customer service to software engineering, but there’s no reliable way to stop them misbehaving. Amazon Web Services (AWS) is now unveiling a tool that turns developers’ plain-English rules into mathematically verifiable policies that agents can’t break.

Unlike traditional software whose behavior is determined by hand-written, deterministic code, agents are powered by large language models (LLMs), which are probabilistic. Their output can vary from run to run, making it tricky to guarantee they will behave predictably. And while developers have built deterministic scaffolding around the models to keep agents on the straight and narrow, it remains far from fool-proof.

To mitigate this, companies typically severely constrain agents’ actions or require a human to approve critical steps. This adds friction that can limit their usefulness and introduce “allow fatigue” in human overseers, says Cami Novelli-Killeen, director of product management for neurosymbolic AI at AWS.

“Formal methods” offer a promising alternative. These techniques define mathematically what software should do and prove it complies. The challenge is that writing these rules has traditionally required expert mathematicians, says Novelli-Killeen. AWS’s new tool, called Greenlight, sidesteps this by using LLMs to automatically convert rules stated in natural language into formally verified policies that constrain an agent’s behavior at runtime. It can even suggest policies based on an agent’s role, and recommend updates as deployed agents encounter new situations.

“This experience is all about helping a person who is the subject matter expert in this particular job, and translating their tribal knowledge, translating their common sense, translating what they know to be right and wrong about that job into very precise policies that an agent can follow deterministically,” says Novelli-Killeen.

How AWS Greenlight prevents rogue agents

Agents’ creativity makes listing every bad behavior they should avoid effectively impossible. So Greenlight runs agents in Strands Box, a software sandbox AWS released in October, which intercepts every action that affects the outside world—such as calling an API or writing a file—and approves or denies it.

Those decisions are determined by a set of policies written in Dogwood, a new language AWS launched in August to write rules for agents. It relies on a branch of formal methods called first-order temporal logic that is particularly useful for governing agents as it can handle concepts of how things change over time. “If you say, ‘I want this personal agent to have my credit card details, but I don’t want it to spend more than $1,000 a month,’ that was something that was very difficult to express in previous policy languages,” says Marc Brooker, VP and distinguished engineer at AWS. “It has to remember how much it’s spent so far and...it has to know what a month is.”

The sandbox is set to deny-by-default, says Novelli-Killeen, and the user then “pokes holes in the box” by writing policies governing what actions it can take. What’s new with Greenlight is that this process is now automated. The tool is a plugin for AI coding assistants such as Claude Code, Codex, and Kiro, and when building an agent, users simply prompt the assistant to propose policies to govern it.

The tool reads the agent’s documentation and logs to infer its job, proposes policies in natural language, and writes formal versions in Dogwood in the background. Users can also add their own rules in natural language and inspect the Dogwood versions if desired. The goal, says Novelli-Killeen, is an experience that “feels like you have a mathematician sitting next to you helping you figure out the specifications for your agent.”

The tool then converts the rules from Dogwood into Lean, a programming language for writing machine-checkable mathematical proofs. Proprietary “automated reasoning engines” then check how the rules interact with each other and the agent’s tools to spot unintended loopholes. Once approved, the policies are compiled to SQL and every action the agent attempts is checked against them, which typically adds just tens of milliseconds to a tool call, says Brooker. Crucially, because the rules have a formal mathematical foundation, each decision can come with an auditable proof of why it was made.

What made the tool possible is LLMs’ growing ability to translate natural language into formal languages, an outstanding problem in computer science for decades. “This is one of those problems that’s gone over the last five years from almost intractable to very, very tractable,” says Brooker.

Where Greenlight may fall short

However, there will always be a danger of translation errors, says André Platzer, a professor at Karlsruhe Institute of Technology who applies formal methods to autonomous systems. Paraphrasing renowned computer scientist Alan Perlis, he notes there is “no formal way to go from the informal to the formal.”

“You’re never really sure whether the informal natural English language was rendered correctly in logic,” Platzer says.

Nor does the tool solve a longstanding problem in formal methods: They can only prove that an action doesn’t violate the user’s specification, not that the specification captures the desired behavior. “There’s a difference between ‘did I build the right thing’ [and] ‘did I build the thing right,’ ” says Platzer. “Ultimately, you need to answer both.”

Nonetheless, he thinks Greenlight could be of real practical benefit because few people understand formal logic. Making formal methods accessible to non-experts could be “super impactful” even if the results aren’t airtight.

Novelli-Killeen concedes the tool is not a “one and done” solution and must be part of a process of continuous improvement. To that end, a replay feature lets users run previous agent sessions against new policies to see how they perform. “What we’re trying to do is add moments of determinism while maintaining that creativity and flexibility of the agent,” she adds.

It could be a promising alternative to existing agent governance approaches, says Jason Andersen, VP and principal analyst for apps, agents, and automation at Moor Insights & Strategy, who was briefed on Greenlight ahead of launch. The most popular approach to governance today uses multiple LLMs to vet an agent’s output, but this is expensive and still boils down to one probabilistic model assessing another. “[Greenlight] is a different approach to correctness that is arguably better,” he says. “It’s two different methodologies of evaluation versus two of the same.”

He thinks it’s likely to prove particularly valuable for agents running critical business processes with low tolerance for errors, especially in domains such as finance and medicine.

Related Articles Around the Web

原文为英文,正文由自动抓取并保留原文。

本文由采集器自动同步

原文发布于 IEEE Spectrum AI(AWS Bets Formal Logic Can Keep AI Agents in Line),标题、摘要与正文由机器翻译,术语按行业惯例统一,未经人工逐句校订。

阅读原文 ↗