Rego
Rego is a declarative query and policy language for expressing rules over structured data, commonly evaluated by Open Policy Agent and related systems.
Effective Platform Engineering
Rego is a declarative policy language used by Open Policy Agent to evaluate structured input against authorization and other rules.
- How it is used
- Enforces shared governance requirements at deployment boundaries without requiring central ownership of development teams’ pipelines.
- How deep it goes
- Explains declarative predicates and JSON-based decisions through policies and deployment inputs, while leaving agent deployment and policy publishing details aside.
- Examples
- Uses an age-based allow rule, deployment coverage checks, and an exercise restricting container images to an organization’s registry.
- What you can do after
- Build it from scratch: write a Rego admission policy that checks deployment data against a coverage or container-registry requirement.
Authorization in Action
Rego is a declarative policy language used to express rules evaluated by policy engines such as Open Policy Agent.
- How it is used
- Uses Rego with OPA for authorization and infrastructure decisions across distributed systems.
- How deep it goes
- Explains rule conditions and PARC input modeling through examples, then compares Rego’s manual scope with Cedar’s structural scope.
- Examples
- Illustrates confidential-document access by department and restricts a delete action to admin-group members.
- What you can do after
- Evaluate and understand Rego’s fit for infrastructure policy, including its flexibility, manual scoping, and maintenance tradeoffs.
Also covered in
What to know first
- JSONJSON is a language-independent text-based data-interchange format that represents structured values using objects, arrays, strings, numbers, booleans, and null.
- policyA policy is a rule, principle, or decision function that governs behavior or determines actions or permissions under specified conditions.
Related concepts
- Open Policy Agentused by · Open Policy Agent is an open-source policy engine that evaluates declarative policies against structured input to make authorization and other policy decisions.
- policy languagekind of · A policy language is a formal language for expressing rules governing permissions, actions, authorization, or resource access.
- Gatekeeperused by · Gatekeeper is an open-source Kubernetes admission controller that validates and enforces policies using Open Policy Agent.
- Cedarequivalent to · Cedar is an open-source declarative policy language and evaluation engine for expressing and evaluating fine-grained authorization and access-control policies.
- scopecontrasts with · Scope is a defined boundary that determines what entities, activities, resources, or conditions are included, governed, or permitted in a particular context.
Questions about Rego
What is Rego?
Rego is a declarative query and policy language for expressing rules over structured data, commonly evaluated by Open Policy Agent and related systems.
Which Manning books explain Rego?
Effective Platform Engineering and Authorization in Action.
What should I know before learning Rego?
Manning books that teach Rego usually introduce JSON and policy first.
What is the difference between Rego and scope?
Rego is a declarative query and policy language for expressing rules over structured data, commonly evaluated by Open Policy Agent and related systems. Scope is a defined boundary that determines what entities, activities, resources, or conditions are included, governed, or permitted in a particular context.
What is Rego a kind of?
Rego is a kind of policy language. A policy language is a formal language for expressing rules governing permissions, actions, authorization, or resource access.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

