Get OPA policy by ID
opa_get_policyFetch a Rego policy's source code from an OPA server by its ID. The parsed AST is excluded by default; request it explicitly if needed.
Instructions
Fetch a single policy by ID from the running OPA server. Returns the Rego source; the parsed AST is omitted unless asked for, since it is roughly forty times the size of the source it came from. Use rego_parse_ast on the source when an AST is what's wanted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Policy ID, e.g. "rbac" or "policies/auth/main". | |
| includeAst | No | Include OPA's parsed AST alongside the source. Off by default. |