Rego is the declarative policy language used by Open Policy Agent (OPA) for writing and enforcing policies across cloud-native stacks, featuring data-driven rules, comprehensions, and 200+ built-in functions for infrastructure, security, and compliance automation.
Overall
score
97%
{
"context": "Evaluates whether the agent follows a test-driven development workflow when writing Rego policies, writing tests before implementation and using correct package naming conventions.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Test file exists with correct suffix",
"description": "A test file named `policy_test.rego` exists alongside the policy file",
"max_score": 10
},
{
"name": "Test package naming convention",
"description": "The test file uses `package policy_test` (the `_test` suffix convention)",
"max_score": 10
},
{
"name": "Default deny",
"description": "The policy file contains `default allow := false` so access is denied unless explicitly permitted",
"max_score": 15
},
{
"name": "Allow rule for approved categories",
"description": "The `allow` rule permits content only when `input.category` is one of the approved values (\"news\", \"sports\", \"technology\")",
"max_score": 15
},
{
"name": "import rego.v1",
"description": "The policy file includes `import rego.v1`",
"max_score": 10
},
{
"name": "Test for allow case",
"description": "A test verifies that an approved category (e.g. \"news\") results in `allow` being true",
"max_score": 15
},
{
"name": "Test for deny case",
"description": "A test verifies that a disallowed category (e.g. \"spam\") results in `allow` being false",
"max_score": 15
},
{
"name": "Tests pass",
"description": "All tests pass when running `opa test . -v`",
"max_score": 10
}
]
}