Parameters
See plugin common configurations for configuration options available to all plugins.
access_key_id
string
required
Aliyun access key ID.
access_key_secret
string
required
Aliyun secret access key. The value is encrypted before being stored.
region_id
string
required
Aliyun region ID.
endpoint
string
required
Aliyun endpoint.
check_request
boolean
default:
trueIf true, moderate the request content.
check_response
boolean
default:
falseIf true, moderate the response content.
request_check_service
string
default:
llm_query_moderationLocation where Aliyun should moderation the requests.
request_check_length_limit
number
default:
2000Request content length limit, in character count. If exceeded, the content will be sent in chunks.
For instance, if the request content has 250 characters and the
request_check_length_limitis set to100, then the content will be sent in 3 requests to Aliyun.response_check_service
string
default:
llm_response_moderationLocation where Aliyun should moderation the responses.
response_check_length_limit
number
default:
5000Response content length limit, in character count. If exceeded, the content will be sent in chunks.
For instance, if the response content has 250 characters and the
response_check_length_limitis set to100, then the content will be sent in 3 requests to Aliyun.risk_level_bar
string
default:
highvaild vaule:
none,low,medium,high, ormaxIf the evaluated risk level is lower than the
risk_level_bar, the request/response will be passed through to upstream LLM / client respectively.deny_code
integer
default:
200vaild vaule:
between 200 and 599 inclusive
Rejection HTTP status code.
deny_message
string
Rejection message.
timeout
integer
default:
10000vaild vaule:
greater than or equal to 1
Timeout in milliseconds.
stream_check_mode
string
default:
final_packetvaild vaule:
realtimeorfinal_packetStreaming check mode, which specifies how to handle content moderation for streaming (SSE) responses.
realtimeperforms incremental, batched moderation checks while the response is streaming. If a violation is detected, the stream is immediately interrupted with a denial message.final_packetevaluates the complete response after the LLM finishes and appends the calculated risk level to the data field of the SSE messages.stream_check_cache_size
integer
default:
128vaild vaule:
greater than or equal to 1
Max characters per moderation batch in
realtimemode.stream_check_interval
number
default:
3vaild vaule:
greater than or equal to 0.1
Seconds between batch checks in
realtimemode.keepalive
boolean
default:
trueIf true, enable HTTP keepalive to Aliyun.
keepalive_pool
integer
default:
30vaild vaule:
greater than or equal to 1
Maximum number of connections in the keepalive pool.
keepalive_timeout
integer
default:
60000vaild vaule:
greater than or equal to 1000
Keepalive timeout in milliseconds.
ssl_verify
boolean
default:
trueIf true, enable SSL verification.
fail_mode
string
default:
skipvaild vaule:
skip,warn, orerrorBehavior when the plugin is bound to a Consumer and receives a request whose format it does not recognize, such as a non-AI request. With
skip, the unrecognized request is passed through unchecked. Withwarn, the request is passed through and a warning is logged. Witherror, the request is rejected with HTTP 400.Available in API7 Enterprise from version 3.9.14.
request_check_mode
string
default:
lastvaild vaule:
lastorallWhich turn messages in the request to moderate for roles selected by
request_check_roles. Withlast, only the latest consecutive block of selecteduserandtoolmessages is moderated. Withall, every selecteduserandtoolmessage is moderated. Thesystemrole is always checked on every request when selected.Available in API7 Enterprise from version 3.9.16 on the 3.9 line and from version 3.10.2 on the 3.10 line.
request_check_roles
array[string]
default:
["user"]vaild vaule:
user,tool, orsystemMessage roles to moderate on the request side.
userandtoolfollowrequest_check_mode;systemis checked on every request because system content can be affected by malicious tool-call arguments.Tool-result moderation applies to OpenAI-compatible formats where tool output is represented as a distinct
toolrole or item.Available in API7 Enterprise from version 3.9.16 on the 3.9 line and from version 3.10.2 on the 3.10 line.