본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

AI Lakera Guard 플러그인 구성 참조

원문 보기 위키 갱신

AI Lakera Guard 플러그인 구성 참조 (AI Lakera Guard Plugin Configuration Reference)

이 문서는 AI Lakera Guard 플러그인의 모든 설정 옵션을 JSON 스키마 형태로 상세히 알려드려요. API 키, 가드 모드, Lakera Guard 서비스 URL, 요청 및 응답 실패 메시지 등을 구성할 수 있답니다. 각 속성의 설명과 기본값을 확인하며 보안 설정을 원하는 대로 조정해 보세요.

출처: 문서

본문

{
  "properties": {
    "config": {
      "properties": {
        "api_key": {
          "description": "API key for the Lakera Guard subscription. \nThis field is [referenceable](/gateway/entities/vault/#how-do-i-reference-secrets-stored-in-a-vault). \nThis field is [encrypted](/gateway/keyring/).",
          "type": "string",
          "x-encrypted": true,
          "x-referenceable": true
        },
        "guarding_mode": {
          "default": "INPUT",
          "description": "The guardrail mode to use for the request",
          "enum": [
            "BOTH",
            "INPUT",
            "OUTPUT"
          ],
          "type": "string"
        },
        "lakera_service_url": {
          "default": "https://api.lakera.ai/v2/guard",
          "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. \nThis field is [referenceable](/gateway/entities/vault/#how-do-i-reference-secrets-stored-in-a-vault).",
          "type": "string",
          "x-referenceable": true
        },
        "log_blocked_content": {
          "default": false,
          "description": "Whether to log prompts and responses that are blocked by the guardrail.",
          "type": "boolean"
        },
        "project_id": {
          "description": "Project ID to apply filters from. If null, it will use the subscription's default project. \nThis field is [referenceable](/gateway/entities/vault/#how-do-i-reference-secrets-stored-in-a-vault).",
          "type": "string",
          "x-referenceable": true
        },
        "request_failure_message": {
          "default": "Request was filtered by Lakera Guard",
          "description": "The message to return when a failure occurs on the request phase.",
          "type": "string"
        },
        "response_buffer_size": {
          "default": 100,
          "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"
        },
        "response_failure_message": {
          "default": "Response was filtered by Lakera Guard",
          "description": "The message to return when a failure occurs on the response phase.",
          "type": "string"
        },
        "reveal_failure_categories": {
          "default": false,
          "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"
        },
        "stop_on_error": {
          "default": true,
          "description": "Stop processing if an error occurs.",
          "type": "boolean"
        },
        "text_source": {
          "default": "concatenate_all_content",
          "description": "Select where to pick the 'text' for the Lakera Guard request (when text/generation is selected).",
          "enum": [
            "concatenate_all_content",
            "concatenate_user_content",
            "last_message"
          ],
          "type": "string"
        },
        "timeout": {
          "default": 10000,
          "description": "Connection timeout with the Lakera Guard service",
          "type": "number"
        },
        "verify_ssl": {
          "default": true,
          "description": "Whether to verify the SSL certificate of the configured Lakera Guard endpoint.",
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "consumer": {
      "additionalProperties": false,
      "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.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "consumer_group": {
      "additionalProperties": false,
      "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",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "expressions": {
      "additionalProperties": true,
      "type": "object"
    },
    "protocols": {
      "default": [
        "grpc",
        "grpcs",
        "http",
        "https"
      ],
      "description": "A set of strings representing HTTP protocols.",
      "items": {
        "enum": [
          "grpc",
          "grpcs",
          "http",
          "https"
        ],
        "type": "string"
      },
      "type": "array"
    },
    "route": {
      "additionalProperties": false,
      "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.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "service": {
      "additionalProperties": false,
      "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.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}

관련 리소스

다음 단계

더 알아보기 (Learn more)