Open Policy Agent (OPA) is an open-source, general-purpose policy engine that enables organizations to define and evaluate authorization and other policies across applications, APIs, infrastructure, and cloud-native environments.
OPA separates policy decision-making from application logic, allowing developers to define rules using its declarative policy language, Rego. Applications and services can query OPA to determine whether an action should be permitted based on the applicable policies and available data.
Originally developed for cloud-native and infrastructure use cases, OPA is widely associated with Kubernetes, DevOps, and policy-as-code practices.
How does OPA work?
Open Policy Agent evaluates requests against policies written in Rego to determine whether specific actions meet defined requirements. Rather than embedding authorization rules directly into application code, OPA allows applications and services to delegate policy evaluation to a separate policy engine.
The process generally follows four steps:
- An application makes a request: A user, service, or workload attempts to access a resource or perform an action.
- OPA receives the relevant input: The application or integration provides information such as user identity, requested action, resource details, and other available attributes.
- OPA evaluates the policy: The engine evaluates the request against Rego policies and available policy data.
- The application enforces the result: OPA returns a decision, such as allow or deny, which the application or enforcement point uses to determine the outcome.
For example, an application might query OPA to determine whether an employee can access a confidential document based on their role, department, or other attributes.
This separation of policy decision-making from enforcement allows organizations to update authorization rules without rewriting the application logic that invokes them.
Key Features
- Open-source policy engine: OPA is a graduated Cloud Native Computing Foundation (CNCF) project that provides an open-source engine for evaluating policies written in Rego.
- Policy-as-code: Policies can be versioned, tested, reviewed, and deployed through standard development workflows, including CI/CD pipelines.
- Decoupled policy decisions: OPA separates policy evaluation from application logic, allowing applications and services to request decisions through APIs or supported integrations.
- Cloud-native integration: OPA can be deployed alongside applications and infrastructure components, making it suitable for Kubernetes, microservices, API gateways, and other distributed environments.
- Flexible authorization: OPA can support different access control models, including role-based access control (RBAC) and attribute-based access control (ABAC), by evaluating policies against structured input and available data.
- Policy distribution and monitoring: OPA provides capabilities for distributing policy bundles, reporting status, and generating decision logs, although enterprise-wide management workflows may require additional tooling.
What is Rego in Open Policy Agent?
OPA is built with Rego, which is a full-blown programming language with a strong uptake in the infrastructure community. It offers community-created connectors for attributes and endpoints that developers can use to drive effective authorization within your organization.
Rego is a take on Prolog, from the 1970s. While Prolog was designed for general symbolic reasoning, Rego focuses on expressing policies and rules in a way that is practical for contemporary software systems.
| XACML 3.0 | ALFA | REGO | |
| Origin | OASIS | OASIS | CNCF |
| Founded | 2010 (ratified 2013) | 2014 | 2015 |
| Based on | Functional Programming | Functional Programming | Logic Programming (Datalog) |
| Format | XML | C#-like | Datalog |
| Can retrieve external attributes | Yes | Yes | Not natively |
| Initial focus | All-purpose | All-purpose | Infrastructure - can be extended |
| PDP | Yes | Yes | Yes |
| Policy Combination | Yes | Yes | Not natively |
| Policy Hierarchy | Yes | Yes | Not natively |
| Compatibility | XACML to ALFA | ALFA to XACML | None |
OPA Example
Here’s a simple example of an OPA policy, written in Rego:
package example
default allow := false
allow if {
input.role == "owner"
}
allow if {
input.role == "employee"
input.tenure >= 10
}
This policy permits access when the user is either an owner or an employee with at least 10 years of tenure. If neither condition is satisfied, access is denied.
For example:
| User | Role | Tenure | Decision |
| Alice | Owner | 15 years | Allow |
| Bob | Employee | 10 years | Allow |
| Eve | Employee | 2 years | Deny |
| Dave | Contractor | 5 years | Deny |
Enterprise OPA: Policy Management and Governance
Open Policy Agent provides a flexible foundation for policy evaluation, but organizations deploying OPA across large, distributed environments may need additional capabilities for centralized policy management, governance, and operational oversight.
These requirements can include:
- Centralized policy management: Managing policies consistently across applications, services, and infrastructure.
- Policy lifecycle management: Supporting policy authoring, testing, approval, versioning, and deployment.
- Auditability: Providing visibility into authorization decisions and policy changes.
- Enterprise integrations: Connecting authorization policies with identity systems, business applications, and other attribute sources.
- Operational support: Maintaining reliable policy enforcement across distributed environments.
OPA provides APIs and capabilities for policy distribution, decision logging, and monitoring. However, organizations may need to integrate these capabilities into broader enterprise management workflows.
What happened to Styra's enterprise offering?
In 2025, Styra announced the discontinuation of its commercial enterprise offerings, creating a transition for organizations that relied on Styra's policy management and governance tooling.
However, OPA itself remains an open-source CNCF project, separate from Styra's commercial offerings.
Organizations affected by the transition may need to evaluate alternative solutions for centralized policy management, enterprise support, and long-term authorization governance.
Axiomatics as an enterprise authorization alternative
Axiomatics provides a centralized authorization platform designed to help organizations manage and enforce fine-grained access policies across applications, APIs, and other protected resources.
With support for ABAC, centralized policy management, and dynamic authorization, Axiomatics provides an alternative for organizations evaluating enterprise authorization solutions. Rather than managing authorization logic independently across applications, organizations can define and maintain policies centrally and apply consistent access requirements across distributed environments.
Real-world Example: Moving from Styra to enterprise authorization
A large consumer group selected the Axiomatics Authorization Management Platform to replace Open Policy Agent (OPA) for complex enterprise authorization requirements. The organization faced challenges deploying fine-grained, policy-based access control (PBAC) consistently across the enterprise, efficiently managing and auditing Rego policies, and implementing hierarchical authorization and access delegation. Also, OPA lacks the integrated policy management and governance capabilities that organizations need to support enterprise-wide regulatory compliance and secure long-term commercial support.
Its authorization requirements included:
- Segregation of duties: Enforcing access restrictions to support antitrust compliance and prevent conflicts of interest.
- Information barriers: Implementing Chinese Wall policies to restrict access to sensitive information.
- Data masking: Controlling access to sensitive customer and pricing data.
- Temporary access delegation: Supporting controlled delegation of access permissions.
- Enterprise-wide policy enforcement: Applying consistent fine-grained access controls across applications, systems, and business units.
- Policy governance and auditability: Improving visibility into authorization policies and decisions to support audits, regulatory compliance, and internal governance.
The organization selected Axiomatics to address these requirements through centrally managed authorization policies, using Abbreviated Language for Authorization (ALFA) policy-as-code and a business-friendly policy management interface. This example highlights how complex authorization requirements can lead organizations to evaluate alternatives to OPA that offer additional policy management, governance, and enterprise support capabilities.