Write, test, and explain policies with a smarter Infrastructure Assistant!
You need a guardrail, and Rego stands between you and the governance you need. So you ask an AI to write it. The policy looks right, but it references an input field that doesn't exist and mixes v0 and v1 syntax. You paste it in, hit a compile error, copy the error back into the chat, and go around again. Meanwhile, the guardrail you needed still isn't enforcing anything.

Infrastructure Assistant now runs that loop itself, so you only see the policy once it works.
Get policies tested before they reach you
The Assistant has two new read-only tools. One fetches the input schema for any policy type from the policy contract Spacelift maintains, so drafts use fields that exist (input.spacelift.run, input.terraform.resource_changes, input.reviews). The other evaluates a draft against a sample input and returns the compile errors or the decision. The Assistant drafts, evaluates, and fixes until the body compiles and returns the expected decision.
Go from plain English to a saved policy
Policies > Create policy > Create with Infrastructure Assistant opens Build mode with a starter prompt. Add an outcome like "Block unencrypted S3 buckets," answer its questions, and the Assistant picks the policy type and creates the policy in Spacelift. Ask it to test first and you see both decisions before anything is saved:
Before you save it, test it against a plan that creates an unencrypted bucket and one with an encrypted bucket, and show me both decisions.
Know what a policy does before you touch it
The Ask button on a policy page opens Ask mode scoped to that policy. Use it to explain what a rule does and what breaks if you delete it, or to trace why a run is waiting on approval and who can approve it, using the actual policy body and run.
Keep Rego v0 policies compiling
On a v0 policy, the Assistant states which Rego version it writes in, so v0 and v1 constructs (if, contains, import rego.v1) don't get mixed in one body.
Schema lookup and evaluation work in Ask mode with no approval prompt. Creating or editing a policy requires Build mode.
We are very excited to bring you such a helpful update to the skills of Spacelift Intelligence. As always, take it for a spin and let us know what you think. We always want to hear from you!
Read the policy docs →