All Products
Search
Document Center

API Gateway:AiSecurityGuardConfig

Last Updated:Apr 08, 2026

Parameter

Type

Description

Example

object

Specifies the configuration for the AI security guard.

serviceAddress

string

The service address of the AI security service.

checkRequest

boolean

Specifies whether to check text content in requests. Default value: false.

checkResponse

boolean

Specifies whether to check text content in responses. Default value: false.

checkRequestImage

boolean

Specifies whether to check image content in requests. Default value: false.

checkResponseImage

boolean

Specifies whether to check image content in responses. Default value: false.

requestCheckService

string

The service or model used for checking text in requests.

responseCheckService

string

The service or model used for checking text in responses.

requestImageCheckService

string

The service or model used for checking images in requests.

responseImageCheckService

string

The service or model used for checking images in responses.

riskAlertLevel

string

The risk alert level. Requests or responses that meet or exceed this level trigger an alert. Valid values: pass, review, and block.

bufferLimit

integer

The maximum buffer size in bytes for content inspection.

pluginStatus AiPluginStatus
The plugin status. For more information, see AiPluginStatus.

consumerRiskLevel

array

A list of custom risk alert levels for different consumers. This setting overrides the global riskAlertLevel.

object

Defines a custom risk level rule for a specific consumer.

name

string

The unique identifier of the consumer, such as an App ID.

matchType

string

The match type for the consumer name. Valid values: equal and prefix.

type

string

The type of risk to which this rule applies, such as profanity or spam.

level

string

The custom risk alert level for this consumer. Valid values: pass, review, and block.

consumerRequestCheckService

array

A list of rules that override the requestCheckService and requestImageCheckService settings for specific consumers.

object

Defines a custom request check service rule for a specific consumer.

name

string

The unique identifier of the consumer, such as an App ID.

requestCheckService

string

The service or model used for checking text in requests from this consumer.

requestImageCheckService

string

The service or model used for checking images in requests from this consumer.

matchType

string

The match type for the consumer name. Valid values: equal and prefix.

modalityType

string

The modality type to which the rule applies. This setting determines whether to use the text or image check service. Valid values: text and image.

consumerResponseCheckService

array

A list of rules that override the responseCheckService and responseImageCheckService settings for specific consumers.

object

Defines a custom response check service rule for a specific consumer.

name

string

The unique identifier of the consumer, such as an App ID.

responseCheckService

string

The service or model used for checking text in responses from this consumer.

responseImageCheckService

string

The service or model used for checking images in responses from this consumer.

matchType

string

The match type for the consumer name. Valid values: equal and prefix.

modalityType

string

The modality type to which the rule applies. This setting determines whether to use the text or image check service. Valid values: text and image.

riskConfig

array

A list of detailed risk configurations that provide granular control over risk detection.

object

Defines a specific risk configuration rule.

type

string

The type of risk, such as profanity, spam, or custom_keyword.

level

string

The action to take when this risk is detected. Valid values: pass, review, and block.

consumerRules

object

Rules that apply this risk configuration to specific consumers based on a matching pattern.

pattern

string

The regular expression or wildcard pattern for matching consumer identifiers.

matchType

string

The matching method for the pattern, for example, regex or glob.