AWS Greenlight uses formal logic to verify AI agent policies
AWS introduces Greenlight, a tool that converts natural language rules into mathematically verified policies for AI agents using first-order temporal logic.
Amazon Web Services has launched Greenlight, a new tool designed to enforce strict behavioral boundaries on AI agents through mathematical verification. Released in late 2024, the system allows developers to define safety rules in plain English, which are then automatically translated into formally verified code that agents cannot bypass at runtime.
What happened
The rapid adoption of AI agents in customer service and software engineering has exposed a critical gap: there is no reliable method to prevent these probabilistic systems from misbehaving. Unlike traditional software built on deterministic code, agents powered by large language models produce variable outputs, making it difficult to guarantee predictable behavior. Companies currently mitigate this risk by severely restricting agent capabilities or requiring human approval for critical steps, a process that creates friction and leads to "allow fatigue" among overseers.
To address this, AWS introduced Greenlight, which leverages formal methods to define exactly what software should do and proves compliance mathematically. Historically, writing such rules required expert mathematicians, but Greenlight automates this translation. It acts as a plugin for AI coding assistants like Claude Code, Codex, and Kiro, allowing subject matter experts to input their domain knowledge in natural language. The tool then generates precise, verifiable policies without requiring users to understand the underlying complex logic.
How it works
Greenlight operates within Strands Box, a software sandbox released by AWS in October that intercepts every external action an agent attempts, such as API calls or file writes. The sandbox defaults to denying all actions, requiring explicit policies to "poke holes" in the restriction. These policies are written in Dogwood, a new language launched in August that utilizes first-order temporal logic. This specific branch of formal methods is essential for agents because it can handle concepts that change over time, such as tracking monthly spending limits against a credit card.
The core innovation lies in the automation pipeline. When a developer prompts an assistant to propose policies, Greenlight reads the agent’s documentation and logs to infer its role. It suggests rules in natural language and simultaneously generates formal versions in Dogwood. These rules are then converted into Lean, a programming language for machine-checkable mathematical proofs. Proprietary automated reasoning engines analyze the rules for interactions and loopholes before compiling them into SQL. When an agent acts, the system checks the action against these SQL rules, adding only tens of milliseconds to the process while providing an auditable proof for every decision.
Key details
- Greenlight translates natural language rules into Dogwood, a policy language based on first-order temporal logic.
- The system runs inside Strands Box, a deny-by-default sandbox that intercepts all external agent actions.
- Automated reasoning engines convert policies into Lean for mathematical proof checking before compiling to SQL.
- Policy enforcement adds approximately tens of milliseconds to each tool call made by the agent.
- The tool integrates with AI coding assistants including Claude Code, Codex, and Kiro.
- A replay feature allows developers to test previous agent sessions against newly updated policies.
Why it matters
For engineering teams building production-grade agents, Greenlight offers a shift from probabilistic governance to deterministic correctness. Current approaches often rely on one large language model to vet the output of another, which remains expensive and inherently uncertain. By using formal methods, AWS provides a different methodology of evaluation that does not depend on statistical likelihood. This is particularly valuable for high-stakes domains like finance and medicine, where errors have severe consequences and audit trails are mandatory.
However, the technology is not a complete solution to agent safety. Experts note that formal methods can only prove that an action adheres to the specified rules, not that the rules themselves capture the intended behavior correctly. There is always a risk of translation errors when converting informal human intent into formal logic. Despite this limitation, making formal verification accessible to non-experts represents a significant step forward. It allows teams to maintain the creativity and flexibility of AI agents while inserting necessary moments of determinism into critical workflows.
What you can do
- Evaluate if your current agent governance relies solely on LLM-based vetting and consider hybrid approaches.
- Identify critical business processes where deterministic rules are more appropriate than probabilistic oversight.
- Review agent documentation and logs to define clear roles before attempting to generate policies.
- Test the replay feature by running past agent sessions against new policies to detect potential loopholes.
- Start with simple temporal constraints, such as budget limits or time-based access, to understand the logic.
- Maintain a continuous improvement process, recognizing that policy definitions will need updates as agents encounter new situations.



