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 uses a multi-value violations set rule to collect all constraint breaches in a data validation policy, rather than failing on the first error.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Multi-value violations rule",
"description": "`violations` is defined as a multi-value set rule (using `violations contains msg if`) rather than a boolean",
"max_score": 15
},
{
"name": "Name required check",
"description": "The policy adds a violation when `input.name` is absent or an empty string",
"max_score": 10
},
{
"name": "Email regex check",
"description": "The policy adds a violation when `input.email` does not match the required regular expression pattern",
"max_score": 20
},
{
"name": "Age range check",
"description": "The policy adds a violation when `input.age` is below 18 or above 120, with distinct messages for each bound",
"max_score": 20
},
{
"name": "Role enum check",
"description": "The policy adds a violation when `input.role` is not one of the permitted values",
"max_score": 15
},
{
"name": "Test for valid payload",
"description": "A test verifies that a fully valid payload produces an empty `violations` set",
"max_score": 10
},
{
"name": "Tests for each violation",
"description": "Separate tests verify that each individual constraint breach produces the expected violation message",
"max_score": 10
}
]
}