Open Policy Agent
Open Policy Agent, or OPA, is a policy engine. Your software sends it structured input, and OPA evaluates policy written in Rego to return a decision without putting policy rules inside every application.
itCloud native tools and technologies | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Open Policy Agent
Open Policy Agent, or OPA, is the colleague you ask for a policy decision when your application, proxy, cluster, or pipeline would rather not grow a private rule engine in a cupboard. It receives structured input, looks at policy and data, and returns a result. The caller still does the consequential bit: it enforces that result. OPA is not a tiny traffic officer hiding in the network. It does not block anything by itself.
The useful trick is the split between policy decision and policy enforcement. Before OPA, every enforcement point tended to carry its own version of a rule, with the usual result that one system remembered the exception and another developed amnesia. With OPA, the application can ask a named query and handle an allow result, violation messages, or structured findings. The rule can travel farther than the code that acts on it, which is the whole point.
Everything rests on four nouns: input, the context for one request or object; policy, written in Rego; data, the extra structured facts available during evaluation; and a query, the named result being requested. The surprising part is that the policy is not the whole system. Data must still come from somewhere, stay current, and have an owner. Bundles can distribute policy and optional data, but they have not volunteered to take responsibility for either.
Start at the boundary, not at a grand shared repository with a heroic name. Identify the enforcement point. Inspect the input it actually sends. Define the decision contract. Then write small rules and test allow, deny, and edge cases. This is less glamorous than announcing Central Policy Headquarters, but it gives the caller a result it knows how to use.
For a first experiment, the Reference tab and Rego Playground give you small rules and representative input. The Cheatsheet keeps the input-policy-data-decision map close at hand. Field Notes covers the operational traps around data, failures, and versions. The Quiz checks whether the separation has become a mental model rather than a decorative diagram. After that, choose one integration close to your work and let reality provide the interesting inputs.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://www.openpolicyagent.org/docs
Supports
- OPA is a general-purpose policy engine
- OPA separates policy decision-making from enforcement
- OPA uses Rego
- OPA evaluates queries against policy input and data
- documented use cases
- https://www.openpolicyagent.org/docs/policy-language
Supports
- Rego language semantics
- structured data evaluation
- policy outputs
- https://www.openpolicyagent.org/docs/policy-testing
Supports
- policy testing guidance
- https://www.openpolicyagent.org/docs/latest/management-bundles/
Supports
- bundle distribution of policy and data
- https://github.com/open-policy-agent/awesome-opa
Supports
- Gatekeeper
- Conftest
- and Regal ecosystem curation
- https://play.openpolicyagent.org/
Supports
- interactive Rego evaluation
- https://www.cncf.io/presentations/projects/open-policy-agent-opa/
Supports
- OPA CNCF sandbox acceptance
- incubation
- and graduation dates
- https://www.openpolicyagent.org/blog/page/4
Supports
- OPA public release history
- experimental Wasm compilation in v0.10
- https://www.cncf.io/blog/2019/04/02/toc-votes-to-move-opa-into-cncf-incubator/
Supports
- OPA moved to CNCF incubation in April 2019
- https://www.openpolicyagent.org/blog/rego-design-principle-3-optimize-performance-automatically-2d29ad3ce96d
Supports
- Rego has no side effects
- rule ordering and automated optimization design
- https://www.cncf.io/announcements/2021/02/04/cloud-native-computing-foundation-announces-open-policy-agent-graduation/
Supports
- OPA CNCF graduation and maturity criteria
- https://www.openpolicyagent.org/blog/i-have-a-plan-exploring-the-opa-intermediate-representation-ir-format-7319cd94b37d
Supports
- OPA v0.37 strict mode
- delta bundles
- and plan output
- https://www.openpolicyagent.org/blog/announcing-opa-1-0-a-new-standard-for-policy-as-code-a6d8427ee828
Supports
- OPA 1.0 Rego v1 defaults and migration tools
- https://www.openpolicyagent.org/blog/managing-opa-203a3bc86c5d
Supports
- bundle status and decision-log metadata
- https://www.openpolicyagent.org/docs/policy-performance
Supports
- benchmarking and policy optimization guidance
- https://www.cerbos.dev/
Supports
- Cerbos product landscape entry
- https://www.permit.io/
Supports
- Permit.io product landscape entry
- https://www.hashicorp.com/sentinel
Supports
- HashiCorp Sentinel product landscape entry
- https://kyverno.io/
Supports
- Kyverno product landscape entry
