Rego is the declarative policy language used by Open Policy Agent (OPA). This tile covers writing and testing Rego policies for Kubernetes admission control, Terraform and infrastructure-as-code plan validation, Docker container authorization, HTTP API authorization, RBAC and role-based access control, data filtering, metadata annotations with opa inspect, and OPA policy testing with opa test.
96
94%
Does it follow best practices?
Impact
97%
1.18xAverage score across 32 eval scenarios
Low
Low-risk findings worth noting
This plugin teaches AI agents how to write correct, idiomatic Rego policies using Open Policy Agent (OPA). It covers the full range of OPA use cases and enforces best practices through steering rules (rules.md) and a curated reference skill (skills/rego-domain-reference).
Policy domains covered:
ConstraintTemplate policiesopa-docker-authzopa test, mocking with with, parameterised tests# METADATA blocks, entrypoints, severity classification, opa inspectKey patterns enforced:
import rego.v1 and OPA 1.0 syntax (if, contains, some...in, every)tfplan := object.get(input, "plan", input) for HCP Terraform compatibilitydeny contains msg if { ... }object.get for safe field access with defaultscreate and update actions in IaC policiesThis plugin's evals live in evals/ (31 scenarios covering the domains above). They're run with the Tessl CLI.
1. Install and authenticate
npm install -g tessl
tessl login2. Link this directory to a Tessl project (eval runs need a project to save results to)
tessl project create tessl-tile-opa-rego-language --workspace <your-workspace>If this directory is already linked but the link is stale, run tessl project repair instead.
3. Run the evals
tessl eval .This reads scenarios from evals/ and uses the plugin's rules and skills as injected context automatically.
Useful flags:
--agent / --model — choose the agent under test (run tessl eval --list-agents for the current list)--runs <count> — repeat each scenario N times--skip-baseline — skip the always-on baseline (control) variant--label <text> — tag the run for easier lookup later4. View results
tessl eval list
tessl eval view <run-id>.tessl-plugin
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
scenario-11
scenario-12
scenario-13
scenario-14
scenario-15
scenario-16
scenario-17
scenario-18
scenario-19
scenario-20
scenario-21
scenario-22
scenario-23
scenario-24
scenario-25
scenario-26
scenario-27
scenario-28
scenario-29
scenario-30
scenario-31
scenario-32
skills
rego-domain-reference
references