Lakera · Schema

Lakera Guard Request

Request payload for the Lakera Guard /v2/guard screening endpoint.

AI SecurityArtificial IntelligenceGenerative AILLM SecurityPrompt InjectionAI GuardrailsAI Red TeamingData Loss PreventionContent ModerationCheck Point

Properties

Name Type Description
messages array OpenAI chat-completions style messages. Guard screens the last interaction in the array.
project_id string Project identifier whose assigned policy governs screening.
policy_id string Explicit policy identifier overriding the project default.
breakdown boolean When true, include per-detector flagging details in the response.
payload boolean When true, include match locations to support masking of PII and profanity.
dev_info object Developer metadata returned to aid debugging.
View JSON Schema on GitHub

JSON Schema

lakera-guard-request-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/lakera-ai/main/json-schema/lakera-guard-request-schema.json",
  "title": "Lakera Guard Request",
  "description": "Request payload for the Lakera Guard /v2/guard screening endpoint.",
  "type": "object",
  "required": ["messages"],
  "properties": {
    "messages": {
      "type": "array",
      "description": "OpenAI chat-completions style messages. Guard screens the last interaction in the array.",
      "items": {
        "type": "object",
        "required": ["role", "content"],
        "properties": {
          "role": {
            "type": "string",
            "enum": ["system", "user", "assistant", "tool"]
          },
          "content": { "type": "string" }
        }
      }
    },
    "project_id": {
      "type": "string",
      "description": "Project identifier whose assigned policy governs screening."
    },
    "policy_id": {
      "type": "string",
      "description": "Explicit policy identifier overriding the project default."
    },
    "breakdown": {
      "type": "boolean",
      "default": false,
      "description": "When true, include per-detector flagging details in the response."
    },
    "payload": {
      "type": "boolean",
      "default": false,
      "description": "When true, include match locations to support masking of PII and profanity."
    },
    "dev_info": {
      "type": "object",
      "description": "Developer metadata returned to aid debugging."
    }
  }
}