Parameters
See plugin common configurations for configuration options available to all plugins.
This plugin supports referencing sensitive parameter values from environment variables using the env:// prefix, or from a secret manager, such as HashiCorp Vault’s KV secrets engine, using the secret:// prefix. For more information, see environment variables in plugin and secrets.
api_key
string
required
vaild vaule:
non-empty
API key used to authenticate to the Lakera Guard API. It is sent as a Bearer token in the
Authorizationheader.lakera_endpoint
string
default:
https://api.lakera.ai/v2/guardURL of the Lakera Guard v2 endpoint. Set this to point at a self-hosted or regional Lakera Guard deployment.
project_id
string
Lakera project ID whose policy (detectors and thresholds) should be applied to the scan.
direction
string
default:
inputvaild vaule:
input,output, orbothWhich traffic to scan. With
input, only the request prompt is scanned. Withoutput, only the LLM response is scanned, including streaming responses. Withboth, both are scanned.action
string
default:
blockvaild vaule:
blockoralertHow to handle a flagged verdict. With
block, the request or response is denied. Withalert, the traffic is passed through and the verdict is only logged, which is useful for evaluating a policy before enforcing it.deny_code
integer
default:
200vaild vaule:
between 200 and 599 inclusive
HTTP status code returned when blocking flagged traffic. The default
200returns a provider-compatible completion whose content is the failure message, so SDK clients handle it gracefully. Set a4xxvalue to surface the block as an HTTP error instead.request_failure_message
string
default:
Request blocked by Lakera GuardMessage returned in the deny response when the request prompt is flagged.
response_failure_message
string
default:
Response blocked by Lakera GuardMessage returned in the deny response when the LLM response is flagged.
reveal_failure_categories
boolean
default:
falseIf true, append the flagged detector categories (and their confidence levels) to the failure message.
fail_open
boolean
default:
falseBehavior when the call to the Lakera Guard API fails or times out. If false, the traffic is blocked (fail closed). If true, the traffic is allowed (fail open).
fail_mode
string
default:
skipvaild vaule:
skip,warn, orerrorBehavior when the request format is not recognized as AI traffic, for example when the route does not also configure
ai-proxyorai-proxy-multi. Withskip, the request is passed through unchecked. Withwarn, the request is passed through and a warning is logged. Witherror, the request is rejected with HTTP 500.timeout
integer
default:
5000vaild vaule:
greater than or equal to 1
Timeout in milliseconds for the request to the Lakera Guard API.
ssl_verify
boolean
default:
trueIf true, verify the TLS certificate of the Lakera Guard endpoint.