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

AI 프롬프트 가드 플러그인 구성 레퍼런스

원문 보기 위키 갱신

AI 프롬프트 가드 플러그인 구성 레퍼런스 (AI Prompt Guard Plugin Configuration Reference)

이 문서는 Kong의 AI 프롬프트 가드 플러그인에서 사용할 수 있는 구성 옵션을 JSON 스키마 형태로 정리한 참고 자료예요. allow_patterns와 deny_patterns로 허용하거나 차단할 프롬프트 패턴을 지정하는 방법과 llm_format, genai_category 같은 핵심 필드의 기본값과 의미를 한눈에 확인할 수 있어요. 대화 이력 처리(match_all_roles, allow_all_conversation_history)나 검사할 요청 본문 크기 제한(max_request_body_size)처럼 세부 동작을 조정하는 파라미터 설명도 함께 담고 있어요. 플러그인을 처음 설정하거나 기존 구성을 다듬을 때 필요한 필드를 빠르게 찾아보기에 좋아요

출처: 문서

본문

{
  "properties": {
    "config": {
      "properties": {
        "allow_all_conversation_history": {
          "default": false,
          "description": "If true, will ignore all previous chat prompts from the conversation history.",
          "type": "boolean"
        },
        "allow_patterns": {
          "description": "Array of valid regex patterns, or valid questions from the 'user' role in chat.",
          "items": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "maxLength": 10,
          "type": "array"
        },
        "deny_patterns": {
          "description": "Array of invalid regex patterns, or invalid questions from the 'user' role in chat.",
          "items": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "maxLength": 10,
          "type": "array"
        },
        "genai_category": {
          "default": "text/generation",
          "description": "Generative AI category of the request",
          "enum": [
            "audio/speech",
            "audio/transcription",
            "image/generation",
            "realtime/generation",
            "text/embeddings",
            "text/generation",
            "video/generation"
          ],
          "type": "string"
        },
        "llm_format": {
          "default": "openai",
          "description": "LLM input and output format and schema to use",
          "enum": [
            "anthropic",
            "bedrock",
            "cohere",
            "gemini",
            "huggingface",
            "openai"
          ],
          "type": "string"
        },
        "match_all_roles": {
          "default": false,
          "description": "If true, will match all roles in addition to 'user' role in conversation history.",
          "type": "boolean"
        },
        "max_request_body_size": {
          "default": 1048576,
          "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.",
          "type": "integer"
        }
      },
      "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)