Back to skill

Security audit

safety-guardrails

Security checks for vulnerabilities and agentic risk

Overview

This safety skill is not clearly malicious, but its promised guardrail is too easy to bypass and it adds unnecessary persistent learning data, so users should review it before relying on it.

Do not rely on this skill as a sole safety boundary for autonomous command execution. It should be reviewed or fixed so critical actions are non-overridable by caller-provided flags, unknown commands fail closed, audit logs are truly durable if advertised, and the learner is removed or made explicitly opt-in with clear retention and deletion controls.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/guardrails.py:103
Finding

Caller-Controlled Flags Can Authorize Critical Operations

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/guardrails.py:126
Finding

Security Audit Records Are Not Persisted Across Processes

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/guardrails.py:26
Finding

Raw Regular-Expression Classification Allows Dangerous Command Variants to Bypass the Gate

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (26)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This skill claims to be a pre-execution safety gate, but the documented content also introduces a generic learning subsystem and does not provide verifiable implementation of the promised guardrail behavior. In unattended automation, such a description-behavior mismatch is dangerous because users may rely on the skill to block destructive actions when it may instead only record usage data, creating a false sense of protection.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
65% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · SKILL.md (reported line 38)May include surrounding context.

md
## 内置规则(可扩展)
- DENY:`rm -rf`、`format`、`dd if=...of=/dev`、`shutdown/reboot`、`mkfs`、无条件 `drop/truncate`、
  `git push --force`、`git reset --hard`、fork 炸弹、`curl|bash`/`wget|sh` 下载即执行。
- CONFIRM:`rm -`、删除/更新/插入/改表、对外发送/upload/post、提权、安装依赖、终止进程、部署发布、资金转移。

## 用法

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

内置规则(可扩展)

  • DENY:rm -rf、format、dd if=...of=/dev、shutdown/reboot、mkfs、无条件 drop/truncate、 git push --force、git reset --hard、fork 炸弹、curl|bash/wget|sh 下载即执行。
  • CONFIRM:rm -、删除/更新/插入/改表、对外发送/upload/post、提权、安装依赖、终止进程、部署发布、资金转移。

用法

bash

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/guardrails.py (reported line 13)May include surrounding context.

python
用法:
  python guardrails.py --selftest
  python guardrails.py --action "rm -rf /data" --context '{"user_approved":false}'
  python guardrails.py --audit   # 打印当前审计日志
"""
import argparse

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/guardrails.py (reported line 147)May include surrounding context.

python
用法:
  python guardrails.py --selftest
  python guardrails.py --action "rm -rf /data" --context '{"user_approved":false}'
  python guardrails.py --audit   # 打印当前审计日志
"""
import argparse

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/guardrails.py (reported line 13)May include surrounding context.

python
用法:
  python guardrails.py --selftest
  python guardrails.py --action "rm -rf /data" --context '{"user_approved":false}'
  python guardrails.py --audit   # 打印当前审计日志
"""
import argparse

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/guardrails.py (reported line 13)May include surrounding context.

python
用法:
  python guardrails.py --selftest
  python guardrails.py --action "rm -rf /data" --context '{"user_approved":false}'
  python guardrails.py --audit   # 打印当前审计日志
"""
import argparse

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/guardrails.py (reported line 147)May include surrounding context.

python
ok = True

    # 1) 危险动作被拦截
    d, n, _ = gate("rm -rf /data/important", {})
    assert d == "DENY", f"期望 DENY,实际 {d}: {n}"
    print("[1] 危险递归删除 -> DENY ✓")

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
100% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/guardrails.py (reported line 147)May include surrounding context.

python
ok = True

    # 1) 危险动作被拦截
    d, n, _ = gate("rm -rf /data/important", {})
    assert d == "DENY", f"期望 DENY,实际 {d}: {n}"
    print("[1] 危险递归删除 -> DENY ✓")

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · SKILL.md (reported line 47)May include surrounding context.

md
print("[1] 危险递归删除 -> DENY ✓")

    # 2) 中危需确认(未授权)
    d, n, _ = gate("delete /tmp/cache", {})
    assert d == "CONFIRM", f"期望 CONFIRM,实际 {d}: {n}"
    print("[2] 删除操作未授权 -> CONFIRM ✓")

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/guardrails.py (reported line 152)May include surrounding context.

python
print("[1] 危险递归删除 -> DENY ✓")

    # 2) 中危需确认(未授权)
    d, n, _ = gate("delete /tmp/cache", {})
    assert d == "CONFIRM", f"期望 CONFIRM,实际 {d}: {n}"
    print("[2] 删除操作未授权 -> CONFIRM ✓")

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/guardrails.py (reported line 157)May include surrounding context.

python
print("[1] 危险递归删除 -> DENY ✓")

    # 2) 中危需确认(未授权)
    d, n, _ = gate("delete /tmp/cache", {})
    assert d == "CONFIRM", f"期望 CONFIRM,实际 {d}: {n}"
    print("[2] 删除操作未授权 -> CONFIRM ✓")

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · SKILL.md (reported line 38)May include surrounding context.

md
print("[4] 只读动作 -> ALLOW ✓")

    # 5) 强推未经授权必须拦截(绝不无条件 ALLOW)
    d, n, _ = gate("git push --force origin main", {})
    assert d == "DENY", f"force push 无授权应 DENY,实际 {d}: {n}"
    print(f"[5] 强推无授权 -> DENY ✓")

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/guardrails.py (reported line 167)May include surrounding context.

python
print("[4] 只读动作 -> ALLOW ✓")

    # 5) 强推未经授权必须拦截(绝不无条件 ALLOW)
    d, n, _ = gate("git push --force origin main", {})
    assert d == "DENY", f"force push 无授权应 DENY,实际 {d}: {n}"
    print(f"[5] 强推无授权 -> DENY ✓")

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file implements a generic cross-skill 'self-evolution' telemetry/learning component rather than a narrowly scoped pre-execution safety guardrail. In the context of a safety-filter skill, this capability expansion is dangerous because it introduces persistent behavior tracking and future prompt/skill modification guidance that is unrelated to the declared purpose, increasing attack surface and enabling silent collection of operational metadata.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script persistently stores capability usage, failures, notes, recurring errors, and arbitrary user preferences to disk, which is not justified for a pre-execution safety filter. If sensitive commands, error notes, or personal preferences are recorded, this creates an unnecessary privacy and security exposure, especially in unattended automation where data may accumulate silently over time.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The manifest describes behavior that writes persistent data (learned_patterns.json and audit logs) but does not declare any tool scope or permissions boundaries. In an autonomous-agent context, undeclared write capability undermines least privilege and prevents operators from understanding or constraining what the skill can modify.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The trigger phrases are broad and overlap with common language, increasing the chance that the skill activates in contexts where it was not intended. In autonomous or semi-automatic systems, overbroad activation can cause unexpected interception, logging, or memory writes, and may alter workflows without clear operator intent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

A safety-gate skill should have a narrowly scoped purpose, but this manifest adds a self-evolution/learning subsystem unrelated to action-risk gating. That scope expansion increases attack surface and operational ambiguity, especially in privileged automation flows where a guardrail component is expected to be deterministic and minimal.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation directs the skill to collect and persist user preferences, usage history, error notes, and improvements even though those data are not necessary for a safety-guardrails function. Unnecessary retention creates privacy and data-handling risk, and in multi-session agent environments it can influence future actions based on stale or sensitive context.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The learning module stores free-form preferences, notes, and error details in plain-language memory, which can easily capture sensitive user or operational data and reuse it later. In agent systems, this creates a cross-session data leakage risk and can expose secrets, personal data, or internal workflow details through later outputs or compromise of local files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains its module docstring, comments describing usage, and CLI help/output text entirely in Chinese, which imposes a specific language on users. The file does not offer any language selection, fallback, or indicate that the skill is intentionally region-specific.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The code and documentation claim audit records are persisted ('落盘'), but _AUDIT is only an in-memory list. In an unattended guardrail skill, this undermines forensicability and accountability because decisions disappear on process exit or restart, making it easier for dangerous actions to occur without durable audit evidence.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code writes learned_patterns.json containing user preferences and operation notes without any user-facing warning or consent flow. This is dangerous because notes and preferences can contain sensitive operational context, and silent persistence undermines user expectations and can leak data to other local users, backups, or later processes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill instructs storing a user's language preference for future reuse without clearly framing that storage as optional or requiring explicit consent. Even low-sensitivity preferences become problematic when silently persisted across sessions, particularly in systems expected to minimize retained user data.

Content

No source excerpt is available for this finding.