AWS Uses Formal Logic to Constrain AI Agent Behavior

AWS Greenlight turns natural language into formal proofs to mathematically constrain AI agents at runtime.
AWS has launched Greenlight, which uses formal methods to govern AI agent behavior. Running as a plugin for coding assistants, it translates natural language business rules via an LLM into Dogwood policies based on first-order temporal logic, then into Lean for automated reasoning checks. Approved policies compile to SQL and are checked against every agent action with minimal overhead. Limitations remain: translation errors cannot be eliminated, and formalization cannot guarantee the specification itself is correct.
AI agents are rapidly being deployed in customer service, software engineering, and other fields, but their "uncontrollability" remains a sword of Damocles hanging over enterprises. The probabilistic nature of large language models makes "ensuring the agent never crosses the line every time" a difficult problem. AWS's solution: use mathematical proofs to keep AI in check.

From Natural Language to Mathematical Proof: How Greenlight Works
The behavior of traditional software is determined by deterministic code, whereas agents are driven by LLMs and their outputs vary from run to run. Enterprises currently respond by strictly limiting agent actions or requiring human approval for critical steps, but this leads to "approval fatigue" and undermines the agent's usefulness.
AWS's new tool Greenlight takes a different path. It uses an LLM to automatically convert rules written by developers in natural language into mathematically verifiable policies that constrain agent behavior at runtime. According to Cami Novelli-Killeen, Director of Product Management for Neuro-Symbolic AI at AWS, the core of this experience is translating the "tribal knowledge" and common sense of business experts into precise policies that agents can execute deterministically.
Specifically, Greenlight runs as a plugin for AI coding assistants such as Claude Code, Codex, and Kiro. It reads the agent's documentation and logs, infers its responsibilities, first proposes policy suggestions in natural language, and then writes the formal version in the Dogwood language in the background. Users can also add rules in natural language themselves and view the corresponding Dogwood code. Novelli-Killeen describes the goal as making the experience "like having a mathematician sitting next to you, helping you clarify the agent's specification."
Dogwood and Lean: How Policies Are "Proven"
Greenlight runs in AWS's Strands Box sandbox, which intercepts all agent actions that affect the outside world—calling APIs, writing files, and so on—and approves or rejects each one. The sandbox is default-deny; users "poke holes in the box" by writing policies that allow permitted actions.
Policies are written in Dogwood, a language based on first-order temporal logic that excels at handling concepts that change over time. Marc Brooker, AWS Vice President and Distinguished Engineer, gives an example: "I want this personal agent to hold my credit card information, but not spend more than $1,000 per month." Such rules are hard to express in previous policy languages because they require remembering how much has already been spent and knowing what "a month" is.
The tool then translates Dogwood rules into Lean, a language for writing machine-checkable mathematical proofs. A proprietary "automated reasoning engine" checks how rules interact with each other and with the agent's tools, looking for unexpected gaps. Once approved, policies are compiled to SQL, and every agent action is checked against them—typically adding only tens of milliseconds to a tool call, according to Brooker. Crucially, because the rules have a mathematical foundation, every decision can come with an auditable proof explaining why it was made.
Brooker believes what makes this possible is the LLM's ability to translate natural language into formal languages—a problem that computer science has left open for decades and that "has gone from nearly unsolvable to very solvable in the past five years."
First-Order Temporal Logic is a formal system that adds temporal operators to classical first-order logic. Common operators include "always" (□), "eventually" (◇), "until" (U), and "next" (○). Classical first-order logic can only describe static facts at a single moment, whereas temporal logic can express constraints that evolve over time, such as "always satisfied throughout the entire session" or "the order must be verified before a refund request is received." This is exactly the expressive power that agent policies need: agent behavior is a sequence of actions, and rules often involve historical states (such as cumulative spending) and future obligations (such as having to log before performing a write). Dogwood chose this foundation because it can both precisely characterize such temporal properties and retain the expressive power of first-order quantifiers over entities and sets, making it possible to later convert them into formal propositions in Lean.
Lean is an open-source interactive theorem prover that can also serve as a dependently typed programming language. Its core idea is the Curry-Howard correspondence: propositions are types, and proofs are programs of that type. Therefore, "proving" a mathematical proposition is equivalent to constructing a well-typed term that is mechanically checked by the kernel. Lean's kernel is very small, and all proofs need only pass through this small piece of trusted code, giving it high credibility. Lean has an active mathematics library, Mathlib, and has attracted widespread attention in recent years as mathematicians have used it to complete formalization projects. In Greenlight, Lean serves as the semantic foundation for policies: after Dogwood rules are translated into Lean propositions, the automated reasoning engine can determine whether rules are compatible with each other and whether they conflict with tool behavior based on type checking and theorem proving, and generate independently reviewable proof objects.
Translation Errors and the Boundary of "Doing the Right Thing"
Greenlight is not without weaknesses. André Platzer, a professor at the Karlsruhe Institute of Technology, points out that the risk of translation errors always exists. Quoting computer scientist Alan Perlis, he says there is "no formal path" from the informal to the formal. "You can never really be sure that informal natural English has been correctly converted into logic."
Another long-standing problem with formal methods remains unsolved: they can only prove that an action does not violate the specification given by the user, not that the specification itself captures the desired behavior. Platzer says: "'Did I build the right thing' and 'Did I build the thing right' are two different things, and ultimately both need to be answered."
Still, he believes Greenlight has practical value, because few people understand formal logic, and giving non-experts access to formal methods could be "extremely influential," even if the results are not watertight. Novelli-Killeen also acknowledges that this is not a "one-and-done" solution and requires continuous improvement. The tool offers a replay feature that lets users run previous agent sessions with new policies to observe the effects. "What we want to do is add moments of determinism while preserving the agent's creativity and flexibility."
The "specification correctness" problem in formal verification is often summarized as "verification proves that the implementation is correct with respect to the specification, not that the specification is correct with respect to the intent." Formal methods can rigorously prove that system behavior satisfies a given specification, but whether the specification itself faithfully reflects the properties the user actually wants is a separate question that cannot be automatically guaranteed by the same set of formal tools. This distinction is known in software engineering as the difference between "verification" and "validation," corresponding to the article's reference to "building the thing right" and "building the right thing." For AI agent governance, the implication is that even if the proof chain is impeccable, if natural-language rules are mistranslated or inherently ambiguous, the agent may still perform actions that do not match business intent while being "compliant." Therefore, formal verification usually needs to be combined with testing, replay, human review, and other means.
The Rival Approach: "LLM Reviewing LLM"
Jason Andersen, Vice President and Principal Analyst for Applications, Agents, and Automation at Moor Insights & Strategy, was briefed before the launch. He believes Greenlight could become a strong alternative to existing agent governance solutions. The most popular governance approach today is to use multiple LLMs to review agent output, but it is costly and is still essentially one probabilistic model evaluating another. "These are two different evaluation methodologies, not the same method used twice," he says. "Arguably better."
He believes Greenlight is especially valuable for critical business processes with very low tolerance for error, with finance and healthcare as typical examples. As AI agents begin to touch real-world money and data, "proving it won't cross the line" may be more worth investing in than "trusting it won't cross the line."
Background Notes
Default-deny is a classic principle in access control: unless a policy explicitly allows it, every action is blocked. Compared with default-allow, which relies on blacklists to intercept dangerous operations, default-deny shifts the responsibility for "opening up permissions" to policy authors, reducing both the attack surface and the room for accidental overreach. In Greenlight's design, the Strands Box sandbox intercepts all agent actions that affect the outside world, such as calling APIs and writing files, and rejects them all by default; only after users "poke holes in the box" through policies are actions allowed. This model is in line with operating system capability mechanisms and the principle of least privilege in network firewalls. The cost is that policy coverage must be sufficiently complete; otherwise, agents will be frequently blocked during normal tasks. Therefore, policy inference, policy suggestions, and replaying historical sessions to test policies are key supporting features for whether this model can be practical.
One-line Summary
AWS Greenlight turns natural language into formal proofs to mathematically constrain AI agents at runtime.
Paragraph Summary
AWS has launched Greenlight, an attempt to govern the uncontrollability of AI agents with formal methods. The tool runs as a plugin for coding assistants such as Claude Code, Codex, and Kiro, translating business rules written by developers in natural language, via an LLM, into the Dogwood policy language based on first-order temporal logic, and then into the Lean theorem-proving language, where an automated reasoning engine checks for interaction gaps between rules and between rules and tools. Once approved, policies are compiled to SQL, and every agent action is checked against them, typically adding only tens of milliseconds of overhead and carrying an auditable proof. The article also notes its limitations: translation errors from the informal to the formal cannot be eliminated, and formalization can only prove that actions do not violate the specification, not that the specification itself is correct. Compared with the expensive "LLM reviewing LLM" approach, formal verification is seen as a methodologically different governance choice.
Related articles

LLM Resume Optimization Disrupts Hiring Rankings, Posing New Challenges for Algorithmic Screening
A new study simulates ten rounds of LLM resume rewriting, finding that just one round replaces over half of the top five candidates, with 37%-74% of content unsupported by original resumes. Authenticity verification is insufficient to maintain algorithmic ranking stability, posing new challenges for hiring audits and governance.

Large Language Models in Historical Research: Five Key Limitations and the NER Case
Analyzing five key limitations of LLMs in historical research—hallucination, chrono-insensitivity, presentism and Anglocentrism, alignment bias, and opacity—alongside an NER case study of East German memory discourse, to explore principles for critical use and the boundaries of LLM applicability in history.

Path Grammars: Separating Surface Order from Structure in Incremental Syntax
Path Grammars: a new formal grammar using stack-controlled path traversal for incremental parsing, preserving context-freeness, with Rocq-verified theorems.