Kong · Schema

AiPromptGuardPluginConfig

API GatewayAI GatewayAI ConnectivityAgent GatewayEvent GatewayMCP RegistryService MeshLLMKafkaKonnectOpen Source

Properties

Name Type Description
config object
consumer object 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 acti
consumer_group object 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
name object
protocols array A set of strings representing HTTP protocols.
route object 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.
service object 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.
View JSON Schema on GitHub

JSON Schema

kong-aipromptguardpluginconfig-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/AiPromptGuardPluginConfig",
  "title": "AiPromptGuardPluginConfig",
  "x-speakeasy-entity": "PluginAiPromptGuard",
  "properties": {
    "config": {
      "type": "object",
      "properties": {
        "allow_all_conversation_history": {
          "description": "If true, will ignore all previous chat prompts from the conversation history.",
          "type": "boolean",
          "default": false
        },
        "allow_patterns": {
          "description": "Array of valid regex patterns, or valid questions from the 'user' role in chat.",
          "type": "array",
          "items": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "maxLength": 10
        },
        "deny_patterns": {
          "description": "Array of invalid regex patterns, or invalid questions from the 'user' role in chat.",
          "type": "array",
          "items": {
            "maxLength": 500,
            "minLength": 1,
            "type": "string"
          },
          "maxLength": 10
        },
        "genai_category": {
          "description": "Generative AI category of the request",
          "type": "string",
          "default": "text/generation",
          "enum": [
            "audio/speech",
            "audio/transcription",
            "image/generation",
            "realtime/generation",
            "text/embeddings",
            "text/generation",
            "video/generation"
          ]
        },
        "llm_format": {
          "description": "LLM input and output format and schema to use",
          "type": "string",
          "default": "openai",
          "enum": [
            "anthropic",
            "bedrock",
            "cohere",
            "gemini",
            "huggingface",
            "openai"
          ]
        },
        "match_all_roles": {
          "description": "If true, will match all roles in addition to 'user' role in conversation history.",
          "type": "boolean",
          "default": false
        },
        "max_request_body_size": {
          "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",
          "default": 1048576
        }
      }
    },
    "consumer": {
      "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.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        }
      }
    },
    "consumer_group": {
      "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",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        }
      }
    },
    "name": {
      "const": "ai-prompt-guard"
    },
    "protocols": {
      "description": "A set of strings representing HTTP protocols.",
      "type": "array",
      "items": {
        "enum": [
          "grpc",
          "grpcs",
          "http",
          "https"
        ],
        "type": "string"
      },
      "format": "set",
      "default": [
        "grpc",
        "grpcs",
        "http",
        "https"
      ]
    },
    "route": {
      "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.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        }
      }
    },
    "service": {
      "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.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string"
        }
      }
    }
  }
}