How to find the OPA version used by Spacelift for policy evaluation
Last updated: October 28, 2026
Spacelift supports both Rego v0 and v1 syntax, and bumps the underlying OPA version regularly. Because the exact version changes frequently, it is not listed in the documentation — but you can always query it directly via the GraphQL API.
Querying the current OPA version
Run the following GraphQL query against the Spacelift API to retrieve the OPA version currently used for policy evaluation:
query getOPAVersion {
policyRuntime {
openPolicyAgentVersion
}
}This is useful if you want your CI pipeline to stay in sync with Spacelift. For example, you could have your pipeline run this query first and then download the matching OPA binary before executing your policy tests.
https://docs.spacelift.io/concepts/policy#opa-version
Testing v0 policies against a 1.x OPA binary
If you are in the process of migrating policies from Rego v0 to v1, note that policies still using v0 syntax will require the --v0-compatible flag when tested against a 1.x OPA binary.
https://www.openpolicyagent.org/docs/v0-compatibility#running-opa-in-v0x-compatibility-mode
Switching Rego versions in Spacelift
Spacelift supports both Rego v0 and v1. You can switch between versions at any time when editing a policy using the version selector in the policy editor. See the Spacelift Policy documentation for more details.