config: 补齐 completions 的审核路径,修复输出侧漏审

match.paths 里配了 /v1/completions,但插件默认内容路径是 choices.*.delta.content / message.content,而 legacy completions 的正文在 choices[*].text,不在路径上,导致这类响应不经过审核直接放行。显式配置 content_path_stream / content_path_full 同时覆盖两种格式。

已用 middleware.config.load_settings 校验通过。
This commit is contained in:
Автомата Калашникова committed 2026-11-27 18:09:06 +08:00
1 parent c76972c623
commit e07cc5ec83
1 file changed
+10 -5
+10 -5
View File
@@ -95,11 +95,16 @@ plugins:
force_flush_bytes: 4096
# 上限与判定能力对齐:8 段 × judge_chunk_bytes(16KB) = 128KB
max_buffer_bytes: 131072
# 正文之外还要审核工具调用参数时,改成数组即可(默认只审核正文):
# content_path_stream: ["choices.*.delta.content",
# "choices.*.delta.tool_calls.*.function.arguments"]
# content_path_full: ["choices.*.message.content",
# "choices.*.message.tool_calls.*.function.arguments"]
# 必须显式列出两条路径:
# chat 格式正文在 choices[*].delta.content / message.content
# legacy completions(match.paths 里配了 /v1/completions)正文在 choices[*].text
# 只用默认值会漏审 completions 的正文,风险内容直接放行。
content_path_stream: ["choices.*.delta.content", "choices.*.text"]
content_path_full: ["choices.*.message.content", "choices.*.text"]
# 工具调用参数也要审核时,在上面数组里追加:
# "choices.*.delta.tool_calls.*.function.arguments"
# "choices.*.message.tool_calls.*.function.arguments"
judge_chunk_bytes: 16384
judge_max_tokens: 512
# deepseek 系列默认带思维链,判定用不到;none 可省 ~0.3s 且避免思维链吃光 token。