Skip to main content
Glama
fredyee

HallucC — Hallucination Fact-Check & AI Safety Guard

check_cua_actions

Checks computer-use agent actions before or after execution by grading each step L0–L3 or takeover, returning matched rules, outcomes, and safety counts.

Instructions

Computer-Use Agent 动作风险分级。提交动作轨迹 → 逐步返回 L0(放行)/L1(放行+记录)/L2(需确认)/L3(阻断)/takeover(凭据场景挂起等用户亲手输入) 裁决、matched_rules、outcome,及 L0-L3 汇总计数;响应含 ruleset_version(规则库版本)与 disclaimer(本结果仅为分级参考,未执行实际拦截)。覆盖:敏感路径/破坏性命令/不可逆元素语义、域名分级(未知域导航 L2、黑名单域与敏感粘贴到未知域 L3、支付金额超阈值 L3)、凭据词表与支付/登录域 takeover、task_scope 任务意图偏离(越界升一级,只能收窄)、多智能体委托链字段(每条动作可选 chain_id/agent_id/parent_agent_id/delegation_depth,给了则服务端追加链级跨跳污点分析:跨 agent 传播时聚合级别抬到 L3 并置 risk_diluted,返回在 chain_trace 字段;未给则零影响)。纯规则判定,不调 LLM、不耗额度。用于在 agent 执行前/后做安全自检。

Input Schema

NameRequiredDescriptionDefault
actionsYes待分级的动作序列(1~500 条)
session_idNo给了则把分级结果写入审计表,可在 /cua/audit 回放
task_scopeNo任务意图对齐(收窄机制):动作越出 scope 时升一级处置(L0→L1、L1→L2、L2 保持但追加原因、L3 不变)。只能升级不能降级;不传则零影响。

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.1.10
    • addedInput schema / properties / actions / items / properties / agent_id
      Added value: +{
      +  "description": "P1-9 本动作所属 Agent 名(如 research),配合 registered_agents 做注册校验",
      +  "type": "string"
      +}
    • addedInput schema / properties / actions / items / properties / chain_id
      Added value: +{
      +  "description": "P1-9 多智能体委托链 id(uuid hex);给了则审计按 chain_id 跨会话聚合,可在 /cua/audit 看链路视图",
      +  "type": "string"
      +}
    • addedInput schema / properties / actions / items / properties / delegation_depth
      Added value: +{
      +  "description": "P1-9 委托深度(根 Agent=0);超 delegation_max_depth 升 L2",
      +  "maximum": 9007199254740991,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / actions / items / properties / parent_agent_id
      Added value: +{
      +  "description": "P1-9 委托方 Agent 名;跨 agent 边界的传播链由此配对",
      +  "type": "string"
      +}
    • addedInput schema / properties / actions / items / properties / target_url
      Added value: +{
      +  "description": "浏览器动作的目标 URL(域名分级 / 未知域导航 / 粘贴到未知域规则用)",
      +  "type": "string"
      +}
    • addedInput schema / properties / actions / items / properties / task_scope
      Added value: +{
      +  "description": "P1-5 任务允许范围声明(服务端按动作读取;越界升一级,只能收窄)",
      +  "properties": {
      +    "allowed_apps": {
      +      "description": "允许的前台应用白名单",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "allowed_domains": {
      +      "description": "允许访问的域名白名单(后缀匹配含子域)",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "forbidden_elements": {
      +      "description": "禁止出现的元素标签(最高优先级)",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "task": {
      +      "description": "声明的任务意图(如「整理本周会议纪要」)",
      +      "minLength": 1,
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "task"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / actions / items / properties / url
      Added value: +{
      +  "description": "target_url 别名",
      +  "type": "string"
      +}
    • addedInput schema / properties / task_scope
      Added value: +{
      +  "description": "任务意图对齐(收窄机制):动作越出 scope 时升一级处置(L0→L1、L1→L2、L2 保持但追加原因、L3 不变)。只能升级不能降级;不传则零影响。",
      +  "properties": {
      +    "allowed_apps": {
      +      "description": "允许的前台应用白名单",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "allowed_domains": {
      +      "description": "允许访问的域名白名单(后缀匹配含子域)",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "forbidden_elements": {
      +      "description": "禁止出现的元素标签(最高优先级)",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "task": {
      +      "description": "声明的任务意图(如「整理本周会议纪要」)",
      +      "minLength": 1,
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "task"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it states the tool is pure rule-based ('不调 LLM、不耗额度'), advisory-only ('未执行实际拦截'), and discloses that task_scope can only escalate, that optional delegation-chain fields have zero impact when omitted, and that verdicts are aggregated to L3 with a risk_diluted flag on cross-agent propagation. It omits auth/permission requirements and error/limit behavior, so it is strong but not exhaustive.

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

Conciseness3/5

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

The content is front-loaded with the core verb, but it is delivered as one very long semicolon-joined paragraph and repeats schema-level details (delegation_depth escalation, task_scope narrowing). Information density is high, yet structure and non-redundancy are only adequate.

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?

There is no output schema, so the description must cover returns, and it does: matched_rules, outcome, per-level counts, ruleset_version, disclaimer, and chain_trace are all named, alongside which rule categories are covered. An agent has enough to call and interpret the tool, with only minor gaps around permissions and failure modes.

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 every action field, alias, and nested scope property, making 3 the baseline. The description adds some cross-parameter meaning (scope narrowing only escalates, chain_id/agent_id/parent_agent_id trigger server-side chain taint analysis, session_id writes to the audit table), but it largely restates what the schema descriptions already say.

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 precise verb+resource: grade a Computer-Use Agent action trajectory, returning per-step L0–L3/takeover verdicts plus matched_rules, outcome and summary counts. It clearly distinguishes itself from a generic safety check by being trajectory/action-oriented, but never names its siblings (check_cua_code_audit, check_safety, verify_text) to make the boundary explicit.

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

Usage Guidelines4/5

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

Gives a concrete usage context: '用于在 agent 执行前/后做安全自检' (run before/after agent execution as a safety self-check). That is clear context, but there are no exclusions and no explicit routing against the sibling safety tools, so it stops short of a full when/when-not statement.

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