# Open Policy Agent evaluates any structured data with Rego policies and is a CNCF graduated project under Apache 2.0

Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.

Open Policy Agent (OPA) is a general-purpose policy engine that evaluates structured input, such as a Terraform plan in JSON, against policies written in Rego. It is Apache 2.0 licensed and a CNCF graduated project. The current release read on 16 Nov 2026 is v1.22.4, published 12 Nov 2026.

## Open Policy Agent described by eight fields, read 16 Nov 2026

| Field | Value |
| --- | --- |
| What it evaluates | Arbitrary structured data, such as JSON, against policies and data. OPA says decisions are not limited to allow or deny and can be structured output. |
| Where it runs | Called by software that needs a decision. OPA documentation lists Kubernetes, CI/CD, Terraform, AWS CloudFormation Hooks, Envoy and Istio, and HTTP APIs as use cases. A CLI is included (`opa eval`, `opa exec`, `opa test`). |
| Policy language | Rego, a declarative language |
| Clouds and targets | Domain-agnostic. For clouds, the documented route is the JSON plan from `terraform show -json`; OPA reads the plan, not the cloud account. |
| License | Apache License 2.0 (LICENSE file in the repository, read 16 Nov 2026) |
| Maintainer | The Open Policy Agent project, a Cloud Native Computing Foundation project: accepted 29 Mar 2018, graduated 29 Jan 2021 (CNCF page, read 16 Nov 2026) |
| Tested before enforcement | `opa test` runs rules named test_ against policy files; the Terraform guide applies unit tests to saved plans |
| Current version | v1.22.4, released 12 Nov (the page shows no year; its asset timestamps read 2026-11-12). The release note calls it a fix release for a vulnerability in Go's HTTP/1 server |

## OPA separates the decision from the enforcement point, so the cloud action is blocked by something else

OPA documentation says it "decouples policy decision-making from policy enforcement": software queries OPA with structured input and acts on the answer. OPA therefore does not itself deny an AWS API call or an Azure deployment. A pipeline step, an admission webhook or a Terraform workflow takes the answer and blocks.

HashiCorp documents that HCP Terraform supports OPA as one of its policy frameworks, next to Sentinel and Terraform policy; a policy set can hold policies in only one framework. For the Terraform route the input is the JSON plan, so the guardrail is a pre-deploy check. A resource created by hand in the console never passes through it.

## A policy is tested with unit tests and then with a saved plan

The OPA policy-testing page describes writing test files, such as example_test.rego with rules like test_get_anonymous_denied, and running `opa test . -v` to see PASS or FAIL lines. The Terraform guide builds on this: it saves a plan with `terraform show -json`, evaluates `data.terraform.module.deny` against it, and uses `opa exec` for the same decision.

An audit-only mode that logs violations without blocking, for cloud accounts: none found on 16 Nov 2026 in the pages read. In practice the audit step is a CI job that reports and does not fail the build, which is a choice made in the pipeline, not a setting in OPA.

## The project states that plan-time data is incomplete

OPA documentation lists what a Terraform plan may not contain: unknown values (computed attributes decided at apply time), dynamic blocks, and the results of Terraform functions not yet evaluated. It tells authors to confirm the needed information is in the plan JSON before writing a policy.

This is the main limit for cloud guardrails written in Rego. A rule about an attribute that is computed at apply time cannot be checked in the plan. The cloud-side mechanisms, such as [service control policies](/mechanisms/scp/), see the final request instead.

## Rego sits upstream of the cloud's own guardrails, not in place of them

A Rego rule that checks a plan for a public storage account complements an [Azure Policy deny effect](/mechanisms/azure-policy/) on the same setting: the first blocks the change in review, the second blocks it in the cloud. See [policy as code tools](/policy-as-code-tools/) for the other engines, [policy as code examples](/policy-as-code-examples/) for a real Rego rule, and the [library](/library/) for the cloud-side entries.

## Related pages

- [HashiCorp Sentinel: fields, version and testing](/engines/hashicorp-sentinel/)
- [Cloud Custodian: fields, version and testing](/engines/cloud-custodian/)
- [Kyverno: fields, version and testing](/engines/kyverno/)
- [All of them](/guides/)

## Sources

- Open Policy Agent: introduction: https://www.openpolicyagent.org/docs (read 16 Nov 2026)
- Open Policy Agent: Terraform: https://www.openpolicyagent.org/docs/terraform (read 16 Nov 2026)
- Open Policy Agent: policy testing: https://www.openpolicyagent.org/docs/policy-testing (read 16 Nov 2026)
- GitHub: OPA releases: https://github.com/open-policy-agent/opa/releases (read 16 Nov 2026)
- GitHub: OPA LICENSE: https://github.com/open-policy-agent/opa/blob/main/LICENSE (read 16 Nov 2026)
- CNCF: Open Policy Agent: https://www.cncf.io/projects/open-policy-agent-opa/ (read 10 Nov 2026)
- HashiCorp: policy enforcement in HCP Terraform: https://developer.hashicorp.com/terraform/cloud-docs/policy-enforcement (read 16 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://cloudgovernancetools.com/engines/open-policy-agent/
