Skip to content

Instantly share code, notes, and snippets.

@tsandall
Created July 17, 2025 17:00
Show Gist options
  • Save tsandall/bf3592bd38cb66595840e8cad5fbaff1 to your computer and use it in GitHub Desktop.
Save tsandall/bf3592bd38cb66595840e8cad5fbaff1 to your computer and use it in GitHub Desktop.
Rego Playground

This is a Rego Playground Share

{"message":"world"}
{"trace":false,"coverage":false,"strict":false,"read_only":true,"rego_version":1}
package play
# Welcome to the Rego playground! Rego (pronounced "ray-go") is OPA's policy language.
#
# Try it out:
#
# 1. Click Evaluate. Note: 'hello' is 'true'
# 2. Change "world" to "hello" in the INPUT panel. Click Evaluate. Note: 'hello' is 'false'
# 3. Change "world" to "hello" on line 25 in the editor. Click Evaluate. Note: 'hello' is 'true'
#
# Features:
#
# Examples browse a collection of example policies
# Coverage view the policy statements that were executed
# Evaluate execute the policy with INPUT and DATA
# Publish share your playground and experiment with local deployment
# INPUT edit the JSON value your policy sees under the 'input' global variable
# (resize) DATA edit the JSON value your policy sees under the 'data' global variable
# OUTPUT view the result of policy execution
default hello := false
hello if input.message == "world"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment