Book

Exploring Rego ebook

Declarative policy for the modern cloud

A book cover with a blue/purple cuttlefish with large eyes and the text, Exploring Rego: Declarative policy for the modern cloud.

Download for free

We're not asking for an email address. Helping you on your Continuous Delivery journey is our goal.

Get the PDF

This book is also available as a hardback or paperback edition on:

Exploring Rego: Declarative policy for the modern cloud

By John Bristowe, Steve Fenton, and Matt Allford

Each day, more of us bump into Rego, the language behind Open Policy Agent. Exploring Rego is the book for that moment: a thorough, hands-on guide to the language behind Open Policy Agent, written for engineers who need to go from "what does this even do" to "I can write, test, and ship this at scale with confidence."

The book starts where you are, thinking in familiar, imperative terms, and gradually rewiring that instinct into Rego's declarative logic. You'll then be introduced to language features, along with solid advice on how to use them effectively. You'll find out all the bear traps and tar pits so you can write policy code that works. In the later stages, you'll learn how to build production-ready policies that are provably correct, scalable, and easy to maintain.

The whole book builds on a single example, so there's less time spent reading scenario set-ups and more time exploring Rego itself. By the end of the book, you'll be confident in managing the policy code that makes crucial decisions for your organization.

Publication date: July 27, 2026.

John Bristowe

Meet the author: John Bristowe

John Bristowe is a Principal Developer Advocate at Octopus Deploy, where he creates practitioner-focused content on Continuous Delivery, deployment governance, and Platform Engineering. He previously worked at Microsoft and Progress/Telerik.

Steve Fenton

Meet the author: Steve Fenton

Steve Fenton is a Principal DevEx Researcher at Octopus Deploy, a DORA Community Guide, and a 8-time Microsoft MVP with more than two decades of experience in software delivery. He has written books on TypeScript (Apress, InfoQ), Octopus Deploy, and Web Operations.

Matt Allford

Meet the author: Matt Allford

Matt Allford is a Developer Advocate at Octopus Deploy with over 15 years of experience across infrastructure, development, and operations. With a passion for education and content creation, he has authored courses at Pluralsight and presented at conferences across Australia and America.

Contents at a glance

  • Thinking declaratively
  • Your first policies
  • Values and types
  • Variables and references
  • Rules
  • Equality and assignment
  • Comprehensions
  • Negation
  • Quantification
  • Functions
  • Control flow keywords
  • Built-in functions
  • Modules, packages, imports
  • Metadata and annotations
  • Schemas and type checking
  • Testing policies
  • Patterns and best practices