Describe Rego policy
rego_describe_policyParse a Rego policy into a structured summary of its package, imports, and rules, including clause counts, defaults, args, body length, and annotations. Use it first to understand what a policy does.
Instructions
Parse a Rego policy and return a structured summary: package, imports, and rules. Each rule reports clauseCount (how many definitions share the name), isDefault (true if any clause is a default), hasArgs, bodyLength (total body expressions across all clauses), and inline annotations. Useful as the first step in any "what does this policy do" workflow.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Rego source to describe. | |
| v0Compatible | No | Read the policy as Rego v0 (`--v0-compatible`), the syntax OPA used before 1.0: rules without `if`, partial sets as `deny[msg] { ... }`. Needed for a policy that has not been migrated, which OPA 1.x otherwise refuses to load. Where the tool also takes a query, the query is read as v0 too, with the future keywords imported so `in`, `every` and `some x in` still work in it. |