Check Safety
check_safetyAI 安全网关检测。对 prompt + output 跑 OWASP LLM Top 10 三层检测:40+ 特征规则引擎(注入/越狱/有害内容/敏感信息泄露/欺诈)+ 可选 LLM 深度分析 + 可选幻觉检测。返回 passed、risk_score、risk_level、threats[](category/severity/match_context/recommendation)、quota。fast=true 走纯规则 <10ms 模式。耗 detect 额度(fast 亦计入)。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"output": "<output>"
},
"name": "check_safety"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fast | No | true 走纯规则快速模式(<10ms,无 LLM)→ /guard/check-fast;默认 false 走完整 /guard/check | |
| output | Yes | AI 响应(≥1 字,≤50000 字) | |
| prompt | No | 用户原始输入(默认空,≤50000 字) | |
| check_hallucination | No | 是否同时检测幻觉,默认 false |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| quota | No | ||
| passed | No | ||
| summary | No | ||
| threats | No | ||
| risk_level | No | ||
| risk_score | No | ||
| detection_id | No | ||
| llm_analysis | No | ||
| hallucination | No | ||
| harmful_detected | No | ||
| injection_detected | No | ||
| jailbreak_detected | No |