
OPA (Open Policy Agent) Evaluate
CertifiedEnterprise EditionEvaluate a policy decision with OPA
OPA (Open Policy Agent) Evaluate
Evaluate a policy decision with OPA
Calls OPA Data API at /v1/data/{path} with optional input to compute a decision. Metrics and explain traces are optional; metrics default to false.
type: io.kestra.plugin.ee.opa.policy.EvaluateExamples
Evaluate an OPA policy
id: check_policy
namespace: company.team
tasks:
- id: check_policy
type: io.kestra.plugin.ee.opa.policy.Evaluate
url: "{{ secret('OPA_URL') }}"
token: "{{ secret('OPA_TOKEN') }}"
policyPath: "kubernetes/admission"
input:
request:
operation: "CREATE"
kind: "Deployment"
object:
metadata:
name: "nginx-deployment"
namespace: "production"
spec:
replicas: 3
template:
spec:
containers:
- name: "nginx"
image: "nginx:1.21"
securityContext:
runAsNonRoot: true
readOnlyRootFilesystem: true
metrics: true
explain: "notes"
Properties
policyPath *Requiredstring
Policy path
Path relative to /v1/data (do not prefix with data/).
url *Requiredstring
OPA base URL
explain string
Explain
Return query explanation in addition to result. Allowed values: notes, fails, full, debug.
input object
Input document
JSON input document rendered with flow variables and sent as input.
metrics booleanstring
Enable metrics
Return query performance metrics; defaults to false.
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
token string
Bearer token
Outputs
decisionId string
Decision ID
OPA decision_id, if decision logging is enabled
defined boolean
Whether the result is defined
True if OPA returned a result field
response object
Raw OPA response
Full response returned by OPA Data API
result object
Policy result
Value of the 'result' field if present, otherwise null