命令审批门
gateDetermines whether a shell command may execute, returning allow, deny, or ask with a reason and escalating ambiguous cases for human confirmation.
Instructions
何时使用:需要判定一条 shell 命令能否执行时——代码代理要跑命令、批处理要校验、人工要复核灰区命令,都用 gate 逐条判定。何时不使用:不要用它判定非 shell 操作(文件读写、HTTP 调用);不要把多条命令拼成一条字符串绕过判定;宿主已有内置审批机制时不要重复叠加。返回 decision ∈ allow|deny|ask 与 layer/reason;ask 时结果携带人工确认交互(MCP 2026-07-28 elicitation)或明示需人工复核;服务不可用 fail-closed 返回 deny。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | 命令执行工作目录(可选;默认服务器进程当前目录) | |
| server | No | 可选:覆盖服务地址(http://host:port,等价于 --server;上限 2048 字符) | |
| command | Yes | 待判定的 shell 命令(必填;上限 20000 字符) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | ||
| noul | No | ||
| tool | No | ||
| error | No | ||
| layer | Yes | ||
| model | No | ||
| score | No | ||
| engine | No | ||
| reason | Yes | ||
| server | No | ||
| status | No | ||
| command | Yes | ||
| decision | Yes | ||
| confidence | No | ||
| noul_state | No | ||
| fail_closed | No | ||
| human_action | No |