Validator plugin
The Validator plugin checks fields of the request, or of the upstream’s response, against a list of rules. A rule set fails when any rule fails. On a failure, the plugin denies the request, adds a marker header, or only logs. Validator is a Preview plugin.
On an Enterprise data plane, Validator needs the OPA policy sidecar (opa.enabled in the Helm chart), and the data plane must allow Preview plugins with the global.plugins.allow_preview: true gateway setting, which is off by default. The Helm chart has no value for this setting. For more information, see Helm values.
Where it runs
Configuration
The rules to check.
The field to check, for example request.method, request.path, request.header.<name>, request.query.<name>, request.body.<path>, response.status, or response.body.<path>. A field that starts with response. is a response rule.
One of exists, absent, eq, neq, one_of, matches, glob, prefix, suffix, contains, gt, gte, lt, lte, between, len_lte, len_gte, format.
The operand for a single value. format takes uuid or email. A matches pattern can be up to 4,096 characters.
The operands for a rule that needs more than one value. between needs two values.
A note stored with the rule. It isn’t returned to the client, which gets a generic validation_failed error.
For response rules only: check the upstream’s response (upstream) or the response sent to the client after response plugins ran (client).
deny refuses the request. mark adds a marker header and continues.
Set to false for audit mode, which logs failures but never acts on them.
The status for a request-phase denial, and for a response-phase denial unless response_deny_status is set.
The status for a response-phase denial.
The marker header that mark adds.
The value of the marker header.
On MCP routes, a denial is a JSON-RPC error with HTTP 200.

