AWS has published an open-source approach to comparing formal policies by meaning, not just by their textual differences. It uses anti-unification to show shared structure once and keep disagreements visible for review, a useful tool when even small policy changes can matter.
AWS AI Watch analysis
What happened
The approach represents formal expressions in an e-graph, where declared algebraic rules and explicit rewrites capture which expressions count as equivalent. Its anti-unifier then produces a merged view of two policies: common parts appear once, while differing parts sit in Variants nodes. Selecting one side of each node reconstructs either input, subject to the declared rules.
AWS illustrates the method with candidate policies generated from the same natural-language requirement. One says sensitive data sent externally must be encrypted; the other requires it to be audited. The semantic diff exposes the disagreement. AWS says the model generates the formal policies but plays no part in computing the diff. The AWS article and worked examples describe the open-source engine and how to run it.
Why it matters
A conventional text diff can make harmless rearrangements look significant, while burying a real change in what a rule allows. Here, declared equivalences can account for such things as reordered conditions, and explicit domain rules can capture when different expressions mean the same thing. Reviewers can then focus on the remaining differences instead of playing syntactic spot-the-difference.
That is particularly relevant when language models produce multiple formal versions of a requirement. The comparison can identify where those versions diverge, but it cannot tell a reviewer which version is correct. AWS also notes that incomplete rules or search can leave apparent differences unresolved. The tool is a map of agreement and disagreement, not a stamp of approval.
Our read
This is a practical application of formal methods to a familiar problem: two outputs can look different without meaningfully disagreeing, or look close while disagreeing on an important condition. The open-source engine gives reviewers a way to find the latter without pretending the machine has settled the policy question for them. That is a sensible division of labour, and a rather better use of AI than asking it to grade its own homework.
What to watch
- Whether teams adopt the engine in policy-generation and review workflows.
- Which domain rules and equivalences practitioners find necessary to make comparisons useful.
- Whether reviewers pair the diffs with policy validators or solver-generated counterexamples.
Discussion spark: When AI generates formal policies, should review focus first on the differences between outputs, or on proving that any one output matches the original requirement?
Sources and evidence
- Semantic diffing of formal policies with anti-unification (11 November 2026, 23:33 UTC)
not affiliated with or endorsed by Amazon Web Services (AWS)