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)
- 이 구성 레퍼런스가 설명하는 프롬프트 가드 정책의 전체 사용법을 담은 문서예요 — AI Semantic Prompt Guard Policy
- AWS Guardrails 서비스를 연동해 콘텐츠를 검사하는 정책 소개예요 — AI AWS Guardrails Policy
- Azure Content Safety로 유해 콘텐츠를 필터링하는 정책 소개예요 — AI Azure Content Safety Policy
- 자체 로직으로 가드레일을 구현할 수 있는 커스텀 정책 소개예요 — AI Custom Guardrail Policy