Skip to main content
Glama
fredyee

HallucC — Hallucination Fact-Check & AI Safety Guard

check_cua_code_audit

Statically scan AI agent source code to detect dangerous imports, eval/exec, shell injection risks, and missing sandboxing—no LLM needed.

Instructions

CUA 代码审计:静态分析 Agent 源码,检测危险导入(subprocess/os.system 等)、权限边界(eval/exec)、注入面(字符串拼接 shell)、危险默认值、沙箱缺失。纯规则扫描,不调 LLM、不耗额度。支持单文件或多文件扫描。

Input Schema

NameRequiredDescriptionDefault
codeNo单文件模式:要扫描的源代码文本(≤50000 字符),与 files 二选一
filesNo多文件模式:[{path, content, language?}] 数组,与 code 二选一
filenameNo单文件模式:文件名,用于报告中标识(默认 input.py)
languageNo语言提示,auto 时按 filename 扩展名推断(默认 auto)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.10

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose meaningful behavior: it is a deterministic rule scan that calls no LLM and consumes no quota. It also implies a read-only, non-mutating operation. It stops short of describing the resulting report, severity levels, or any limits, leaving notable behavioral gaps for a tool with zero annotation coverage.

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?

A single tight paragraph that front-loads the core purpose, then the detection categories, then the behavioral trait and file-mode note. Every clause carries information; the enumeration is dense but relevant, with no filler or repetition.

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

Completeness3/5

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

The tool has no output schema and no annotations, so the description should ideally characterize the audit report it returns; instead it only describes what is scanned and how. It covers purpose, detection scope, and the quota-free nature well, but the absence of any return-value or result-shape description leaves a real gap for a scanning tool.

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 the schema already documents code, files, filename, and language in detail (including the 二选一 / mutually-exclusive relationship). The description adds little parameter-level meaning beyond reiterating single-file vs multi-file support, so the 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+resource (静态分析 Agent 源码 / statically analyze Agent source code) and enumerates exactly what it looks for (dangerous imports, eval/exec, injection surface, dangerous defaults, missing sandbox). An agent can tell it is a code auditor. However, it never names or distinguishes itself from sibling scanners (check_safety, verify_agent, check_cua_actions), so it misses the 5 bar for sibling differentiation.

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?

The clause '纯规则扫描,不调 LLM、不耗额度' implies a usage context (prefer this deterministic, quota-free check) and '支持单文件或多文件扫描' hints at input modes, which are implied usage cues. But there is no explicit when-to-use, when-not, or routing versus the other check_*/verify_* siblings, so guidance stays at the inferred level.

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