Note
A solver checks every input in its model
What formal verification at a much larger scale suggests for cloud access policy, what invariant-sast checks with Z3, and what a clean run doesn't show.
On 22 October 2026, Anthropic's Frontier Red Team and Theorem reported Claude proving that fuzz test entry points across 123 open-source libraries won't crash on any input under 64 MB, finding hundreds of bugs along the way. We have no connection to that work. The idea we took from it is simple: a test checks the inputs you thought of, while a solver checks every input in its model.
We apply a much smaller version of that idea to cloud access policy.
Where policy changes go wrong
In AWS Organizations, a service control policy sets the outer limit on what accounts can do, and IAM policies grant permissions to users and roles. Teams write both in JSON and change them through ordinary pull requests. A reviewer reads the diff, but a wildcard, a NotAction or a deleted condition can quietly widen access, because the effect depends on requests nobody wrote down.
Asking a precise question
invariant-sast is a Python CLI that uses Z3 to ask precise questions about a policy:
- Does the new SCP or RCP allow a modelled request that the old one denied?
- Does the new IAM policy grant anything its reference didn't?
- Can this IAM policy grant a known privilege-escalation action, such as
iam:PassRole? - Does a change touch statements using operators the solver doesn't model? Those need manual review.
A real run
Take a change that drops organizations:LeaveOrganization from an SCP's deny list, and adds a CI role with iam:PassRole on every resource. This is the output from invariant-sast 0.3.3 on 2 November 2026, with the table trimmed to fit:
$ invariant regression --manifest manifest.json --output cli
SKIPPED INV_AWS_002 on iam-policies/ci-deployer.json (no reference/baseline counterpart)
SKIPPED INV_AWS_004 on iam-policies/ci-deployer.json (no reference/baseline counterpart)
Summary: 1 passed, 2 failed, 2 skipped
2 check(s) FAILED (most severe first):
[CRITICAL] INV_AWS_001 service-control-policies/protect-org.json
Candidate no longer denies a request the reference denied:
{'resource': '""', 'action': '"organizations:LeaveOrganization"'}
[HIGH] INV_AWS_003 iam-policies/ci-deployer.json
Grants 1 privilege-escalation primitive(s) unconditionally on at least one resource: iam:PassRole
The command exits with status 1, so it can fail a pipeline. The first finding is a counterexample: a specific action that the old policy denied and the new one doesn't. You can reproduce this with the files in lesson 3 of our Invariant guide.
The boundary matters
Anthropic's post is careful to say that formally verified doesn't mean bug-free, because a proof can't tell you whether the spec matches reality. The same holds here, in more specific ways:
- Invariant checks individual policy documents against a model of selected request keys and conditions. It doesn't compute an organisation's effective permissions, and a clean run doesn't prove account-wide security.
- Some conditions are modelled only roughly.
aws:CalledViais a single representative value rather than a real call chain, andaws:ResourceTagisn't modelled. Unmodelled operators are treated as non-constraining and print a warning. - A finding comes from a satisfiable solver result. As of 0.3.5, the latest release, the checks set no solver timeout and anything other than satisfiable, including an inconclusive answer, is not reported as a finding. So no finding isn't the same as proof.
INV_AWS_003says "unconditionally" in its message, but it finds that some request context satisfies the grant. Read that as "reachable", then check the policy.
Within those limits, a concrete counterexample is still a useful thing to hand a reviewer: it's a specific request you can look at and judge, in place of a severity score.