Skip to main content
Glama
HallucC — Hallucination Fact-Check & AI Safety Guard

HallucC — Hallucination Fact-Check & AI Safety Guard

Check Safety

check_safety
Read-only

Scans prompts and AI outputs for OWASP LLM Top 10 risks, including injection, jailbreak, harmful content, data leakage, and fraud, then returns risk scores, threats, and recommendations.

Instructions

AI 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

NameRequiredDescriptionDefault
fastNotrue uses the rule-only fast mode (sub-10ms, no LLM) -> /guard/check-fast; the default false uses the full /guard/check
outputYesAI response (1-50,000 characters)
promptNoRaw user input (default: empty; up to 50,000 characters)
check_hallucinationNoAlso run hallucination detection (default: false)

Output Schema

NameRequiredDescriptionDefault
quotaNo
passedNo
summaryNo
threatsNo
risk_levelNo
risk_scoreNo
detection_idNo
llm_analysisNo
hallucinationNo
harmful_detectedNo
injection_detectedNo
jailbreak_detectedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.1.12
    • changedInput schema / properties / check_hallucination / description
      Previous value: -"是否同时检测幻觉,默认 false"New value: +"Also run hallucination detection (default: false)"
    • changedInput schema / properties / fast / description
      Previous value: -"true 走纯规则快速模式(<10ms,无 LLM)→ /guard/check-fast;默认 false 走完整 /guard/check"New value: +"true uses the rule-only fast mode (sub-10ms, no LLM) -> /guard/check-fast; the default false uses the full /guard/check"
    • changedInput schema / properties / output / description
      Previous value: -"AI 响应(≥1 字,≤50000 字)"New value: +"AI response (1-50,000 characters)"
    • changedInput schema / properties / prompt / description
      Previous value: -"用户原始输入(默认空,≤50000 字)"New value: +"Raw user input (default: empty; up to 50,000 characters)"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "detection_id": {
      +      "anyOf": [
      +        {
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "hallucination": {
      +      "anyOf": [
      +        {},
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "harmful_detected": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "injection_detected": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "jailbreak_detected": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "llm_analysis": {
      +      "anyOf": [
      +        {},
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "passed": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "quota": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": {},
      +          "propertyNames": {
      +            "type": "string"
      +          },
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "risk_level": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "risk_score": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "summary": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "threats": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "additionalProperties": {},
      +            "properties": {
      +              "category": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "category_name": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "match_context": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "recommendation": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "severity": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              }
      +            },
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety profile is covered. The description adds genuinely useful context beyond that: quota consumption including fast calls, the sub-10ms latency of fast mode, and the optional LLM/hallucination layers. It stops short of describing failure or rate-limit behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose, then detection layers, then return shape, then the fast-mode and quota caveats. Dense but every sentence carries information; the parenthetical field list is slightly compressed but not wasteful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be spelled out, yet the description still names the key fields. Quota cost and the fast-mode latency tradeoff are disclosed, which is what an agent needs before calling. Only the absence of sibling routing keeps it from full marks.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all four parameters are already documented, including fast mode and the 50,000-character limits. The description restates the fast-mode tradeoff and mentions the optional deep analysis and hallucination layers but adds no syntax or format detail beyond the schema, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: runs three-layer OWASP LLM Top 10 detection on prompt + output, with named detection categories and return fields. It is clear what the tool does, but it never contrasts itself with siblings like verify_text or check_cua_actions, so an agent must infer which checker applies.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives one concrete usage lever (fast=true for rule-only sub-10ms mode, default false for full check) and warns that quota is consumed. It does not say when to prefer this over verify_text or the CUA checkers, nor when to enable check_hallucination, so selection guidance is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.