- Home
- Infrastructure Policy as Code Tools
- Open Policy Agent
Open Policy Agent
What it is
Open Policy Agent (OPA) is a free, open-source policy engine that separates policy decisions from the systems that enforce them. It evaluates policies against structured input and can return structured data, with use cases including microservices, Kubernetes, CI/CD pipelines, and API gateways. Policies use Rego, a declarative language designed for complex hierarchical data. Applications can request evaluations through a REST API, Go API, WebAssembly runtimes, or custom evaluators using OPA’s intermediate representation. OPA bundles distribute policy and data to instances, while discovery bundles carry configuration. Management interfaces support policy distribution, health and status checks, and decision logs. The project lists integrations for Kubernetes, Terraform, Envoy, and code editors; its documentation recommends OPA Gatekeeper for Kubernetes admission control. Installation options include macOS, Linux/Unix, Windows, and Docker. OPA’s security guidance says API authentication and authorization are off by default and recommends configuring TLS, authentication, and authorization. OPA is a graduated Cloud Native Computing Foundation project.
For and against
For
- Supports policy evaluation through REST, Go, and WebAssembly.
- Use cases include microservices, Kubernetes, CI/CD, and API gateways.
- Bundles distribute policy and data to instances.
- Management interfaces include status checks and decision logs.
- Available for macOS, Linux/Unix, Windows, and Docker.
Against
- API authentication and authorization are off by default.
- Security guidance calls for configuring TLS and access controls.
- Kubernetes admission control guidance recommends OPA Gatekeeper.
The verdict
OPA offers several ways to evaluate policies and distribute them across systems, with Rego as its policy language. Teams securing its API should account for the fact that authentication and authorization are off by default.
Who it suits
OPA suits developers and platform teams that need policy evaluation across services, infrastructure, or delivery pipelines. Kubernetes users can follow the project’s recommendation to use OPA Gatekeeper for admission control.
Plans and prices
Open Policy Agent
Open-source policy engine · Apache License, Version 2.0
Read 3 Oct 2026 · openpolicyagent.org
On the record
- API security
- OPA's security guidance describes TLS, authentication, and Rego-based authorization, and says authentication and authorization are off by default.openpolicyagent.org · read 2 Oct 2026
- Binary checksums
- The installation guide says binary checksums are available by appending .sha256 to the binary filename.openpolicyagent.org · read 2 Oct 2026
- Community support
- The official site links to an OPA Slack community for users to talk with other users and maintainers.openpolicyagent.org · read 2 Oct 2026
- Decision input and output
- OPA evaluates policies against arbitrary structured input and can return arbitrary structured data as output.openpolicyagent.org · read 3 Oct 2026
- Deployment
- The documentation describes installing OPA on macOS, Linux/Unix, and Windows, and running it with Docker.openpolicyagent.org · read 3 Oct 2026
- Downloads
- The official installation guide provides options for macOS, Linux/Unix, Windows, and Docker.openpolicyagent.org · read 2 Oct 2026
- Governance
- OPA is a graduated Cloud Native Computing Foundation project.openpolicyagent.org · read 3 Oct 2026
- Integration options
- OPA supports policy evaluation through a REST API, a Go API, WebAssembly, and custom evaluators using its intermediate representation.openpolicyagent.org · read 2 Oct 2026
- Integrations
- The project lists integrations for Kubernetes, Terraform, Envoy, and code editors.openpolicyagent.org · read 3 Oct 2026
- Kubernetes
- The OPA documentation recommends OPA Gatekeeper for Kubernetes admission control.openpolicyagent.org · read 2 Oct 2026
- Policy distribution
- OPA bundles distribute policy and data to OPA instances, while discovery bundles distribute flexible configuration.openpolicyagent.org · read 3 Oct 2026
- Policy engine
- OPA is an open source, general-purpose policy engine that separates policy decision-making from policy enforcement.openpolicyagent.org · read 2 Oct 2026
- Policy evaluation
- Policies can be evaluated through a REST API, the Go API, WebAssembly runtimes, or custom evaluators using OPA's intermediate representation.openpolicyagent.org · read 3 Oct 2026
- Policy language
- OPA policies are written in Rego, a declarative language designed for expressing rules over complex hierarchical data.openpolicyagent.org · read 3 Oct 2026
- Policy management
- OPA provides management interfaces for distributing policies, checking status and health, and collecting decision logs.openpolicyagent.org · read 2 Oct 2026
- Project status
- OPA is a graduated Cloud Native Computing Foundation project.openpolicyagent.org · read 2 Oct 2026
- Purpose
- OPA is an open-source, general-purpose policy engine that unifies policy enforcement across software systems.openpolicyagent.org · read 3 Oct 2026
- Security configuration
- Authentication and authorization are off by default, and the security guide recommends configuring TLS, authentication, and authorization when securing the API.openpolicyagent.org · read 3 Oct 2026
The review
Open Policy Agent (OPA) is a general-purpose, open-source policy engine for teams that need one decision layer across services, infrastructure, and delivery pipelines. It suits engineers comfortable defining rules in Rego and integrating policy decisions into their own systems. Its broad integration surface is the reason to choose it; the need to configure API security and operate policy distribution yourself is the main trade-off.
Overview
OPA separates deciding whether an action complies with a rule from the component that enforces the result. It evaluates arbitrary structured input and can return arbitrary structured data, so the same engine can represent access, configuration, deployment, or compliance decisions without embedding separate rule logic in every application.
Policies use Rego, a declarative language built for complex hierarchical data. That makes OPA a strong fit when rules span nested configuration or request data, although teams must be prepared to learn and maintain a dedicated policy language. OPA is a graduated Cloud Native Computing Foundation project, with integrations listed for Kubernetes, Terraform, Envoy, and code editors. See Infrastructure Policy as Code Tools for related products.
Key features
Evaluation and enforcement
Applications can call OPA through a REST API or Go API, run policies in WebAssembly runtimes, or build custom evaluators around OPA's intermediate representation. This accommodates a separately running policy service, Go embedding, or a runtime-oriented deployment. OPA makes the decision; the surrounding application or platform still has to enforce it.
Use cases cover microservices, Kubernetes, CI/CD pipelines, and API gateways. Runtime enforcement, admission control, CI/CD integration, and policy reporting make it relevant from code change through production request handling. For Kubernetes admission control, the documentation recommends OPA Gatekeeper, giving cluster operators a more focused companion for that job.
Distribution and operations
Management interfaces support policy distribution, health and status checks, and decision logs. Bundles deliver policy and data to OPA instances, while discovery bundles provide flexible configuration. These mechanisms help keep many instances aligned, but they also make deployment design and operational ownership part of the purchase decision.
Security and assurance
OPA's security guidance covers TLS, authentication, and Rego-based authorization. Authentication and authorization are off by default, so an exposed API requires deliberate security configuration rather than assuming a secure default. The project provides binary checksums by appending .sha256 to an installation filename and directs suspected security issues to its security team by email. Users can also discuss the project with users and maintainers in the OPA Slack community.
Pricing
Open Policy Agent — free (open-source policy engine, Apache License, Version 2.0). There are no paid tiers, seat charges, quotas, or trial expiry described for this plan. The free open-source distribution suits teams willing to run and secure the engine themselves; organizations wanting a managed service or vendor-operated policy infrastructure should look elsewhere. Third-party companies offer commercial support, but those listings are not vetted endorsements.
Platforms
OPA supports API, Linux, macOS, self-hosted deployments, web environments, and Windows. Official installation guidance covers macOS, Linux/Unix, Windows, and Docker, allowing both local tooling and containerized or server deployments. Its infrastructure-oriented formats include Terraform plan JSON, JSON, and YAML.
Who it's for
Choose OPA when multiple systems need consistent policy decisions, especially across microservices, Kubernetes, infrastructure-as-code, CI/CD, and gateways. It is a good match for platform and security teams that can own Rego, distribution, logging, and API hardening. It is less suitable when the requirement is only a narrow, turnkey Kubernetes check or when operating an open-source policy service is undesirable.
Pros and cons
- Pro: One engine spans services, infrastructure, admission control, and pipelines, reducing duplicated policy logic.
- Pro: REST, Go, WebAssembly, and intermediate-representation integrations accommodate different deployment architectures.
- Pro: Bundles, discovery, health interfaces, and decision logs provide a foundation for operating distributed policy.
- Con: Rego and policy lifecycle management add a specialized skill and operational burden.
- Con: API authentication and authorization are disabled by default, so secure configuration is mandatory before exposing the API.
Alternatives
- Conftest is a free, open-source option for Linux, macOS, and Windows when you want a focused configuration-testing workflow.
- Fairwinds Polaris is a free open-source policy engine aimed at small teams, with web and self-hosted platforms.
- Google Cloud Terraform Policy Validation is a free beta client-side tool when Terraform validation within Google's tooling is the priority.
- Terraform fits teams wanting broader infrastructure management alongside policy, with a free tier capped at 500 managed resources and one concurrent remote and agent run.
- Cloud Custodian is a free Apache 2.0 project for Linux, Windows, and self-hosted environments.
- Google Config Sync suits organizations already using GKE and able to meet its registered-fleet and supported-cluster requirements.
- terraform-compliance is a free, open-source Terraform compliance testing framework for Linux and self-hosted use.
- Tirith is a free Apache-2.0 CLI for Linux with no account required.
Verdict
OPA is the right choice for engineering and security teams that need a reusable policy engine across heterogeneous systems and can manage Rego, distribution, and security configuration. Its zero-cost license and many evaluation paths are compelling. Look elsewhere if you need a managed experience, a narrower single-platform control, or secure API defaults without additional setup.