OPA (Open Policy Agent) Compile

OPA (Open Policy Agent) Compile

Certified
Enterprise Edition

Partially compile an OPA policy

Uses the OPA Compile API to partially evaluate a Rego query, returning residual queries. Metrics and explain outputs are optional and disabled by default.

yaml
type: io.kestra.plugin.ee.opa.policy.Compile

Compile an OPA policy (partial evaluation)

yaml
id: compile_policy
namespace: company.team

tasks:
  - id: compile_policy
    type: io.kestra.plugin.ee.opa.policy.Compile
    url: "{{ secret('OPA_URL') }}"
    token: "{{ secret('OPA_TOKEN') }}"
    query: "data.authz.allow == true"
    input:
      user:
        role: "analyst"
        department: "finance"
    unknowns:
      - "data.records"
    options:
      disableInlining: []
    metrics: true
Properties

Rego query to compile

Rego query to partially evaluate (e.g., data.policy.allow == true).

OPA base URL

Explain

Return query explanation in addition to result. Allowed values: notes, full, fail, debug.

Input document

Input data rendered with flow variables and passed to partial evaluation.

Enable metrics

Return query performance metrics; defaults to false.

Compile options

Additional options forwarded to OPA compile (see OPA docs).

Reference (ref) of the pluginDefaults to apply to this task.

Bearer token

SubTypestring

Unknowns

Paths to treat as unknown during partial evaluation so OPA emits residual queries.

Whether result is defined

Compiled queries (if present)

Raw OPA response

Compile result