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

AI GCP Model Armor 정책 구성 참조

원문 보기 위키 갱신

AI GCP Model Armor 정책 구성 참조 (AI GCP Model Armor Policy Configuration Reference)

이 문서는 AI GCP Model Armor 정책의 구성 속성들을 JSON 스키마 형식으로 제공해요. 각 속성의 타입, 설명, 기본값 등을 상세히 확인할 수 있어서 정책 설정에 바로 활용할 수 있답니다. GCP Model Armor를 사용한 AI 요청 필터링을 구성할 때 꼭 필요한 참고 자료예요.

출처: 문서

본문

{
  "properties": {
    "config": {
      "type": "object",
      "properties": {
        "response_failure_message": {
          "type": "string",
          "description": "The message to return when a failure occurs on the response phase.",
          "default": "Response was filtered by GCP Model Armor"
        },
        "gcp_use_service_account": {
          "type": "boolean",
          "description": "Use service account auth for GCP-based providers and models.",
          "default": false
        },
        "gcp_oauth_token_url": {
          "type": "string",
          "description": "Custom OAuth token URL for GCP authentication. Useful for restricted network environments or custom GCP endpoints. If null, Kong will use the default Google OAuth token endpoint.",
          "x-referenceable": true
        },
        "gcp_metadata_url": {
          "type": "string",
          "description": "Custom metadata URL for GCP authentication. Useful for restricted network environments or custom GCP endpoints. If null, Kong will use the default Google metadata endpoint.",
          "x-referenceable": true
        },
        "log_blocked_content": {
          "type": "boolean",
          "description": "Whether to log prompts and responses that are blocked by the guardrail.",
          "default": false
        },
        "reveal_failure_categories": {
          "type": "boolean",
          "description": "Whether to reveal failure categories in the response to the caller.",
          "default": false
        },
        "request_failure_message": {
          "type": "string",
          "description": "The message to return when a failure occurs on the request phase.",
          "default": "Request was filtered by GCP Model Armor"
        },
        "text_source": {
          "type": "string",
          "enum": [
            "concatenate_all_content",
            "concatenate_user_content",
            "last_message"
          ],
          "description": "Select where to pick the 'text' for the guardrail service request.",
          "default": "last_message"
        },
        "proxy_config": {
          "type": "object",
          "properties": {
            "https_proxy_port": {
              "type": "integer",
              "maximum": 65535,
              "minimum": 0,
              "description": "An integer representing a port number between 0 and 65535, inclusive."
            },
            "proxy_scheme": {
              "type": "string",
              "enum": [
                "http"
              ],
              "description": "The proxy scheme to use when connecting. Only `http` is supported.",
              "default": "http"
            },
            "auth_username": {
              "type": "string",
              "description": "The username to authenticate with, if the forward proxy is protected by basic authentication.",
              "x-referenceable": true
            },
            "auth_password": {
              "type": "string",
              "description": "The password to authenticate with, if the forward proxy is protected by basic authentication.",
              "x-referenceable": true,
              "x-encrypted": true
            },
            "no_proxy": {
              "type": "string",
              "description": "Comma-separated list of hosts that should not be proxied."
            },
            "http_proxy_host": {
              "type": "string",
              "description": "A string representing a host name, such as example.com."
            },
            "http_proxy_port": {
              "type": "integer",
              "maximum": 65535,
              "minimum": 0,
              "description": "An integer representing a port number between 0 and 65535, inclusive."
            },
            "https_proxy_host": {
              "type": "string",
              "description": "A string representing a host name, such as example.com."
            }
          }
        },
        "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"
        },
        "location_id": {
          "type": "string",
          "description": "GCP Location ID for the GCP Model Armor subscription."
        },
        "template_id": {
          "type": "string",
          "description": "GCP Model Armor Template ID to enforce."
        },
        "enable_multi_language_detection": {
          "type": "boolean",
          "description": "Enables multi-language detection mode. Must be used with 'source_language'.",
          "default": false
        },
        "guarding_mode": {
          "type": "string",
          "enum": [
            "BOTH",
            "INPUT",
            "OUTPUT"
          ],
          "description": "The guardrail mode to use for the request.",
          "default": "INPUT"
        },
        "response_buffer_size": {
          "type": "number",
          "description": "The amount of bytes receiving from upstream to be buffered before sending to the guardrail service. This only applies to the response content guard.",
          "default": 100
        },
        "stop_on_error": {
          "type": "boolean",
          "description": "Stop processing if an error occurs.",
          "default": true
        },
        "timeout": {
          "type": "number",
          "description": "Connection timeout with the guardrail service.",
          "default": 10000
        },
        "gcp_service_account_json": {
          "type": "string",
          "description": "Set this field to the full JSON of the GCP service account to authenticate, if required. If null (and gcp_use_service_account is true), Kong will attempt to read from environment variable `GCP_SERVICE_ACCOUNT` or from the instance/container metadata service.",
          "x-referenceable": true,
          "x-encrypted": true
        },
        "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
        },
        "project_id": {
          "type": "string",
          "description": "GCP Project ID for the GCP Model Armor subscription."
        },
        "source_language": {
          "type": "string",
          "description": "Source language (ISO code) to use when 'enable_multi_language_detection' is enabled."
        }
      },
      "required": [
        "location_id",
        "project_id",
        "template_id"
      ]
    }
  }
}

관련 리소스

더 알아보기 (Learn more)