
OPA (Open Policy Agent) Compile
CertifiedEnterprise EditionPartially compile an OPA policy
OPA (Open Policy Agent) Compile
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.
type: io.kestra.plugin.ee.opa.policy.CompileExamples
Compile an OPA policy (partial evaluation)
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
query *Requiredstring
Rego query to compile
Rego query to partially evaluate (e.g., data.policy.allow == true).
url *Requiredstring
OPA base URL
explain string
Explain
Return query explanation in addition to result. Allowed values: notes, full, fail, debug.
input object
Input document
Input data rendered with flow variables and passed to partial evaluation.
metrics booleanstring
Enable metrics
Return query performance metrics; defaults to false.
options object
Compile options
Additional options forwarded to OPA compile (see OPA docs).
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
token string
Bearer token
unknowns array
Unknowns
Paths to treat as unknown during partial evaluation so OPA emits residual queries.
Outputs
defined boolean
Whether result is defined
queries object
Compiled queries (if present)
response object
Raw OPA response
result object
Compile result