REGO
Generated by scripts/gen-format-pages.py from docs/data/format-metadata/, FILE_FORMATS.csv and docs/formats-master.csv. Do not edit by hand: change the source, then run the script.
OPA Rego Preview.
At a glance
| Purpose | A Rego policy file for the Open Policy Agent: packages, imports and rules that decide policy queries. |
| Extensions | .rego |
| Poka parser | poka-rego |
| Viewer | poka-text-viewer |
| Depth tier | Parser with a shared viewer (see Depth tiers) |
| Breadth tier | B2 Broad (see Breadth tiers) |
How much Poka reads
B2 Broad. The common content of the current and the common older versions is decoded. Some named features or versions are not, and are listed.
Confidence: medium (the reviewer read the code). Basis: Reviewed 2026-10-26: read parsers/poka-rego/src/main.rs (149 lines), plugin.json and poka-viewers' poka-text-viewer (plain text; it ignores the language hint). No unit tests or tests/samples.rs, and the corpus has no .rego sample. Covers .rego. The whole source is shown as text, under a summary line with the package, the number of imports and the rule heads found (up to 8 named). Judgement: B2, because the full text is shown; the gaps are presentation, limits and the heuristic summary.
What Poka does not read
- Shown as plain text without syntax highlighting
- Rule heads are found by a heuristic (an identifier at the start of a line followed by =, :=, (, [ or {), so some rules and some non-rules are miscounted
- A # inside a string is taken as the start of a comment when finding rule heads (judgement from the code)
- The text shown stops at 200,000 characters and files over 4 MiB are cut (both flagged)
- Text that is not UTF-8 is decoded with replacement characters
Libraries
Libraries Poka uses or has assessed for this format, with the status, licence and language the registry records.
- regorus (candidate; MIT; Rust; https://github.com/microsoft/regorus) — Rego interpreter (no_std capable) with lex, parse and ast commands; targets OPA v1.2.0 compatibility.
- Open Policy Agent (ast package) (candidate; Apache-2.0; Go; https://pkg.go.dev/github.com/open-policy-agent/opa/v1/ast) — Reference implementation; ast package provides a Rego parser (ParseModule) and compiler.
Sources
- parsers/poka-rego/src/main.rs
- parsers/poka-rego/plugin.json