

OPA is a policy engine that streamlines policy management across your stack for improved development, security and audit capability.
input.json
{
"account": {
"state": "open"
},
"user": {
"risk_score": "low"
},
"transaction": {
"amount": 950
}
}
# Run your first Rego policy!
package payments
default allow := false
allow if {
input.account.state == "open"
input.user.risk_score in ["low", "medium"]
input.transaction.amount <= 1000
}
# Open in the Rego Playground to see the full example.
Loading...
Open Policy Agent is a Cloud Native Computing Foundation Graduated project.

Developer Productivity: OPA helps teams focus on delivering business value by decoupling policy from application logic. Security & platform teams centrally manage shared policies, while developer teams extend them as needed within the policy system.

Performance: Rego, our domain-specific policy language, is built for speed. By operating on pre-loaded, in-memory data, OPA acts as a fast policy decision point for your applications.

Audit & Compliance: OPA generates comprehensive audit trails for every policy decision. This detailed history supports auditing and compliance efforts and enables decisions to be replayed for analysis or debugging.
Interested to see more? Checkout the Maintainer Track Session from KubeCon.
Context-aware, Expressive, Fast, Portable
OPA is a general-purpose policy engine that unifies policy enforcement across the stack. OPA provides a high-level declarative language that lets you specify policy for a wide range of use cases. You can use OPA to enforce policies in applications, proxies, Kubernetes, CI/CD pipelines, API gateways, and more.
The examples below are interactive! Use the Evaluate button to see output for the given rego and input. Then edit the rego or the input (or both) to see how the output changes.
- API
- Envoy
- Kubernetes
- GenAI
Applications can directly integrate with OPA using our SDKs or REST API. This is great when your application needs to make domain specific runtime decisions.
policy.rego
package application.authz
# Only owner can update the pet's information. Ownership
# information is provided as part of the request data from
# the application.
default allow := false
allow if {
input.method == "PUT"
some petid
input.path = ["pets", petid]
input.user == input.owner
}
Loading...
input.json
{
"role": "staff",
"owner": "bob@example.com",
"path": [
"pets",
"pet113-987"
],
"user": "alice@example.com"
}