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

AI 프롬프트 가드 정책 구성 레퍼런스

원문 보기 위키 갱신

AI 프롬프트 가드 정책 구성 레퍼런스 (AI Prompt Guard Policy Configuration Reference)

이 문서는 Kong AI 게이트웨이의 AI 프롬프트 가드 정책에서 설정할 수 있는 구성 옵션을 스키마 형태로 정리한 레퍼런스예요. allow_patterns와 deny_patterns로 허용하거나 차단할 프롬프트 패턴을 지정하는 방법과 llm_format, rejection_mode 같은 동작 제어 옵션까지 한눈에 확인할 수 있어요. LLM 요청과 응답에 프롬프트 가드 규칙을 세밀하게 조정하고 싶을 때 참고하면 좋아요

출처: 문서

본문

{
  "properties": {
    "config": {
      "type": "object",
      "properties": {
        "allow_patterns": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1
          },
          "maxLength": 10,
          "description": "Array of valid regex patterns, or valid questions from the 'user' role in chat."
        },
        "allow_all_conversation_history": {
          "type": "boolean",
          "description": "If true, will ignore all previous chat prompts from the conversation history.",
          "default": false
        },
        "match_all_roles": {
          "type": "boolean",
          "description": "If true, will match all roles in addition to 'user' role in conversation history.",
          "default": false
        },
        "continue_on_detection": {
          "type": "boolean",
          "description": "If true, the guardrail will not block the request or response. Block data and details will still be visible via kong logs. You can expect this field to work coherently with `guarding_mode` parameter.",
          "default": false
        },
        "deny_patterns": {
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1
          },
          "maxLength": 10,
          "description": "Array of invalid regex patterns, or invalid questions from the 'user' role in chat."
        },
        "max_request_body_size": {
          "type": "integer",
          "description": "max allowed body size allowed to be introspected. 0 means unlimited, but the size of this body will still be limited by Nginx's client_max_body_size.",
          "default": 8388608
        },
        "llm_format": {
          "type": "string",
          "enum": [
            "anthropic",
            "bedrock",
            "cohere",
            "gemini",
            "huggingface",
            "openai",
            "typesafe"
          ],
          "description": "LLM input and output format and schema to use",
          "default": "openai"
        },
        "genai_category": {
          "type": "string",
          "enum": [
            "audio/speech",
            "audio/transcription",
            "image/generation",
            "realtime/generation",
            "text/embeddings",
            "text/generation"
          ],
          "description": "Generative AI category of the request",
          "default": "text/generation"
        },
        "rejection_mode": {
          "type": "string",
          "enum": [
            "none",
            "stealth",
            "verbose"
          ],
          "description": "Controls block response format and status code. 'none' returns 400 with plain text block reason, 'stealth' 403 without details and 'verbose' returns 403 with rich JSON details. In streaming mode, the final SSE chunk includes finish_reason='blocked_by_guard' and 'verbose' will include a 'guardrail_result' metadata entry under 'data.choices[0]' in OpenAI format.",
          "default": "none"
        }
      }
    }
  }
}

관련 리소스

더 알아보기 (Learn more)