BC tool-governance
工具使用安全与可靠性。当工具反复失败、agent 绕过权限否决、或需要破坏性操作保护时使用。不适用于 agent 提前停止(用 execution-loop)或上下文管理(用 context-memory)。参见 error-recovery(限速恢复)。
As a process C 57/100 · Has gaps — weak spots: when it triggers, inputs and preconditions, running it twice
What is at stake
Medium-severity findings: the skill is probably honest, but read what alarmed the scanner.
Below is the worst case for this category. The finding here is medium: the guard saw a sign, not a proof.
The skill contains commands that delete files, rewrite disks or execute code fetched from the network. The agent may run them without asking if it believes the instructions require it.
Replace destructive commands with safe equivalents that ask for confirmation, scope them to one folder, and stop piping curl into a shell: pin a version and a checksum.
How to improve
- Your own cases (evals/evals.json, 4–6 real requests with expected answers): the full check would then run those instead of a model-drafted suite.
- A spec.yaml with trigger phrases and assertions — a behaviour contract for CI; `skilltest init` writes a template.
Guard findings · 12
✓ No critical or high findings
Medium and low: 12
-
medium Dangerous commands
cmd-destructive-fsscripts/tool-input-guard.sh:18Destructive filesystem command (wipes root/home/drive) (code comment; documentation of a security skill)# Check: rm -rf / or rm -rf ~
commentsecurity skill -
medium Dangerous commands
cmd-pipe-to-shellSKILL.md:51Downloads and executes remote code from an unrecognised host (pipe to shell) (detector / deny-list definition)一刀切的权限模型要么太松(YOLO mode 全放行)要么太紧(每次都确认)。本 pattern 用 PreToolUse hook 对工具调用做三级风险分类:Read/Glob/Grep 为 safe 自动放行,Write/Edit 检查路径是否在项目目录内(系统目录 deny),Bash 按命令内容匹配 dangerous(`rm -rf /`、`curl|sh` 直接 deny)/ medi
detector -
medium Dangerous commands
cmd-pipe-to-shellSKILL.md:102Downloads and executes remote code from an unrecognised host (pipe to shell) (detector / deny-list definition)├─ input guard (2.6): 路径逃逸/黑名单/curl|sh? → deny
detector -
low Dangerous commands
cmd-privilegereferences/graduated-permissions.md:40Privilege escalation / world-writable permissions (detector / deny-list definition)elif echo "$CMD" | grep -qE 'sudo|chmod 777|git push.*--force'; then
detector -
low Dangerous commands
cmd-privilegescripts/tool-input-guard.sh:28Privilege escalation / world-writable permissions (code comment; documentation of a security skill)# Check: chmod 777 on system paths
commentsecurity skill -
low Dangerous commands
cmd-pipe-to-shellscripts/tool-input-guard.sh:33Downloads and executes remote code from an unrecognised host (pipe to shell) (code comment; documentation of a security skill)# Check: curl|sh, wget|bash (pipe-to-shell)
commentsecurity skill -
low Dangerous commands
cmd-pipe-to-shellSKILL.md:59Downloads and executes remote code from an unrecognised host (pipe to shell) (security demo / example; quoted — discussed, not commanded)Agent 构造的 Bash 命令可能意外包含路径逃逸、全局破坏或远程注入——特别是从文件内容提取路径拼接命令时。PreToolUse hook 独立检查三类模式:路径边界(`realpath` 确认在项目根目录内,`/tmp` 和工具路径白名单放行)、破坏性黑名单(`rm -rf /`、`mkfs`、`dd`)、pipe-to-shell(`curl|sh`、`wget|sh`)。命中任一即 d
demoquoted
A further 5 matches are quotations in this security skill's documentation and are not counted as findings.
Files scanned: 15. Evidence is masked. Grey chips explain why severity was lowered.
Against the Agent Skills spec
- note
frontmatter-keyunknown frontmatter key "triggers"
Process rating: all ten parameters 57/100
- 0Inputs and preconditions. Does not say what the process needs to start
- 0Progress reporting. Says nothing while it works
- 20When it triggers. No condition that starts the skill
- 30Running it twice. 1 mutating operations with no state check
- 50Failures and branches. 0 branches, has a failure section
- 60Tools and files. Uses tools (bash, web) that frontmatter does not declare
- 60Result and completion. Output format stated, no completion criterion
- 100Steps. 6 steps
- 100Consistency. Name and required fields are in place
- 100Execution cost. Instruction body is 1648 tokens
- low The response is described with custom markup (3 tags): a typed call is more reliable
Everything here is measured from the skill text rather than judged by a model, so the numbers are checkable. A parameter weighs more when it is a more common reason for the process to stall.
Quality signals
- +5Description has no quoted example phrases that should trigger the skill
- +4Description does not say when NOT to use the skill (false activations)
- +2Single-language instructions
- +3Description length 128: enough signal without eating the budget
- +4Structure: 16 headings
- +3Step-by-step instructions: 6 items
- +3Output format is stated explicitly
- +4Has examples (7 code blocks)
- +4Reference files are cited in the instructions (6 of 7)
- +3All 5 scripts are documented
- +1License stated
Quality base 70; lint remarks subtract, signals add up to 100. Result: 94.