{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "#/components/schemas/AiLakeraGuardPluginConfig", "title": "AiLakeraGuardPluginConfig", "x-speakeasy-entity": "PluginAiLakeraGuard", "properties": { "config": { "type": "object", "properties": { "api_key": { "description": "API key for the Lakera Guard subscription.", "type": "string", "x-encrypted": true, "x-referenceable": true }, "guarding_mode": { "description": "The guardrail mode to use for the request", "type": "string", "default": "INPUT", "enum": [ "BOTH", "INPUT", "OUTPUT" ] }, "lakera_service_url": { "description": "The guard-operation URL of the Lakera Guard service. Defaults to the SaaS /v2/guard endpoint. It can be set to a locally hosted instance of Lakera Guard.", "type": "string", "default": "https://api.lakera.ai/v2/guard", "x-referenceable": true }, "log_blocked_content": { "description": "Whether to log prompts and responses that are blocked by the guardrail.", "type": "boolean", "default": false }, "project_id": { "description": "Project ID to apply filters from. If null, it will use the subscription's default project.", "type": "string", "x-referenceable": true }, "request_failure_message": { "description": "The message to return when a failure occurs on the request phase.", "type": "string", "default": "Request was filtered by Lakera Guard" }, "response_buffer_size": { "description": "The amount of bytes receiving from upstream to be buffered before sending to the Lakera Guard service. This only applies to the response content guard.", "type": "number", "default": 100 }, "response_failure_message": { "description": "The message to return when a failure occurs on the response phase.", "type": "string", "default": "Response was filtered by Lakera Guard" }, "reveal_failure_categories": { "description": "Whether to reveal failure categories in the response to the caller. They will always be written to the gateway logs, even if set to false.", "type": "boolean", "default": false }, "stop_on_error": { "description": "Stop processing if an error occurs.", "type": "boolean", "default": true }, "text_source": { "description": "Select where to pick the 'text' for the Lakera Guard request (when text/generation is selected).", "type": "string", "default": "concatenate_all_content", "enum": [ "concatenate_all_content", "concatenate_user_content", "last_message" ] }, "timeout": { "description": "Connection timeout with the Lakera Guard service", "type": "number", "default": 10000 }, "verify_ssl": { "description": "Whether to verify the SSL certificate of the configured Lakera Guard endpoint.", "type": "boolean", "default": true } } }, "consumer": { "description": "If set, the plugin will activate only for requests where the specified has been authenticated. (Note that some plugins can not be restricted to consumers this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer.", "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string" } } }, "consumer_group": { "description": "If set, the plugin will activate only for requests where the specified consumer group has been authenticated. (Note that some plugins can not be restricted to consumers groups this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer Groups", "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string" } } }, "name": { "const": "ai-lakera-guard" }, "protocols": { "description": "A set of strings representing HTTP protocols.", "type": "array", "items": { "enum": [ "grpc", "grpcs", "http", "https" ], "type": "string" }, "format": "set", "default": [ "grpc", "grpcs", "http", "https" ] }, "route": { "description": "If set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the route being used.", "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string" } } }, "service": { "description": "If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched.", "type": "object", "additionalProperties": false, "properties": { "id": { "type": "string" } } } } }