Check Safety
check_safetyAI safety gateway detection. Runs three-layer OWASP LLM Top 10 detection on prompt + output: a 40+ signature rule engine (injection, jailbreak, harmful content, sensitive data leakage, fraud) plus optional LLM deep analysis and optional hallucination detection. Returns passed, risk_score, risk_level, threats[] (category/severity/match_context/recommendation) and quota. fast=true uses the rule-only sub-10ms mode. Consumes detect quota (fast calls count too).
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 uses the rule-only fast mode (sub-10ms, no LLM) -> /guard/check-fast; the default false uses the full /guard/check | |
| output | Yes | AI response (1-50,000 characters) | |
| prompt | No | Raw user input (default: empty; up to 50,000 characters) | |
| check_hallucination | No | Also run hallucination detection (default: 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 |