What happened
AWS's Artificial Intelligence blog post, “Semantic diffing of formal policies with anti-unification,” presents a technique for comparing two formal expressions. Its open-source engine, semi-persistent, represents expressions in an e-graph and computes an anti-unifier: a most-specific common structure that retains the alternatives where inputs differ. The post says the engine does not decide which candidate is correct. It reports the common structure and disagreements under the equalities that reviewers have declared.
Those declarations matter. Operators can be annotated with algebraic properties such as associativity, commutativity and idempotence, allowing reordered or duplicated conjuncts to count as equivalent. Other domain-specific equivalences must be written as rewrite rules and run to saturation. For example, a deployment might define an external destination as one that is “not internal.” Without that rule, the engine cannot infer that the two predicates express the same fact. If no differences remain, the expressions are equivalent under the supplied laws and rewrites—not necessarily in every possible interpretation.
The post walks through an authorization-policy example based on a requirement for cross-Region replication. Two candidate encodings differ in five visible ways: conjunct order, argument order in an equality, an approved-Region predicate expanded into two Regions, And replaced by Or in a confidential-data condition, and Lte changed to Lt at a multipart-copy threshold. The declared algebra removes the ordering differences. A domain rewrite equating the approved-Region predicate with the two-region expression removes another apparent difference. The remaining substantive disagreements are that one candidate weakens a same-account-and-encryption requirement to an alternative, and that the strict threshold treats an object exactly at the boundary differently.
The result marks alternatives in Variants nodes, from which either original expression can be reconstructed by consistently selecting one side. AWS also describes three output fields: :size, :cr, a compression ratio reflecting shared structure, and :completion, which reports whether the search was exact or stopped at a budget. The post cautions that a low compression ratio is not a correctness score: two candidates can share the same error. An SMT solver can provide a concrete assignment that satisfies one formula and violates another, while the anti-unifier organizes the structure and disagreements without issuing that query.
The project is built from source with a pinned Rust toolchain. AWS gives commands to clone the repository, check out revision 5a7969ae4ea88117a64faac4f42af5c358e213e2, build a release binary and run the example. In the worked case, the post reports 50–60 ms for a warm run on an Apple M3 Pro, including parsing, declarations, saturation, five anti-unification queries with regression checks and process startup. It also describes applications to outputs in SMT-LIB, Cedar, Dogwood, OpenShell policy YAML and CEL, while noting that the examples encode those formats as terms rather than importing their native policy files.
What the archive adds
New Runtime's earlier coverage on October 22, 2026, argued that governed semantic definitions can provide a stable boundary between enterprise data and agents: Build a semantic layer for agentic AI on AWS with AtScale and Amazon Bedrock AgentCore and Build a semantic layer for agentic AI on AWS with Strategy Mosaic and Amazon Bedrock AgentCore. This is a new fact on a related governance thread: semantic rules are made explicit here to compare generated policy artifacts, not to govern an agent's analytics queries.
Trend signal
This supports agent security moves to runtime boundaries only weakly: the method helps review formal access rules, but it is a comparison tool, not a runtime boundary or enforcement mechanism. Its more direct contribution is a way to expose policy disagreements before deployment; it does not establish that teams are adopting this practice.
Why it matters
Teams increasingly use generated formal artifacts to express permissions, infrastructure constraints and business rules. A line-based diff is a poor review surface when equivalent expressions are reordered, but a semantic diff is only as sound and complete as its declared laws and domain rewrites. Reviewers need to inspect those assumptions as carefully as the resulting Variants nodes: an incorrect rewrite can hide a real divergence, while missing knowledge can leave harmless differences unresolved.
The useful operational pattern is therefore layered. Generate or maintain candidates, normalize only well-justified equivalences, compare them, and send the localized disagreements to a policy reviewer or solver. Keep the original artifacts and validate the result with the system that actually enforces the policy. The tool can reduce noise and help focus review; it cannot establish that the natural-language requirement was translated correctly, or that two candidates sharing a mistake are safe.
Limits and uncertainty
AWS's examples are illustrative and demonstrate the engine on encoded expressions; they do not show a production deployment or measured reduction in policy-review errors. The reported runtime is for one worked program on one laptop, not a benchmark across policy sizes or languages. Correctness depends on the chosen formalization, algebraic annotations and rewrite rules, and incomplete search can leave an equivalence undiscovered. A semantic diff also cannot determine which candidate matches the original requirement. The post's examples do not independently establish how reliably the approach scales to large, evolving policy collections.
Skill to build now
Take two policy expressions your team already reviews and write down the equivalences that reviewers currently apply informally. Encode only the uncontroversial algebraic laws and domain rewrites, then compare the candidates and inspect every remaining disagreement. Treat the output as a triage aid: run the chosen policy through your existing validator or solver and have its owner confirm that the formal rule still matches the requirement.
Reader takeaway
A semantic diff can separate harmless changes in representation from localized policy disagreements, but it does not certify correctness. Its value comes from explicit, reviewable equivalence rules—and from keeping a human or policy validator responsible for deciding whether the remaining alternatives are acceptable.