Back to skill

Security audit

agent creator

Security checks for vulnerabilities and agentic risk

Overview

This skill is an agent-building workflow with disclosed file and network operations, but it needs review because it can auto-activate, persist learned state, and bypass confirmations through a global environment variable.

Review this skill before installing in any shared or production OpenClaw workspace. Do not set OPENCLAWS_AUTO_CONFIRM=true outside an isolated test environment, and require explicit approval before deployment, TEAM.md changes, or writes to persistent memory. Consider disabling load-time activation and adding review/rollback controls for MEMORY.md and failure_patterns.json.

Vulnerability Patterns
  • 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
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:113
Finding
Unconditional Load-Time Activation Hijacks the Agent Session<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 113-125 **Vulnerability Type**: `T01: Skill Instruction Hijacking` **Risk Level**: High ### Complete Vulnerable Snippet The following is an English translation of the source segment: ```markdown ### 7.1 Activation Confirmation Once this SKILLS.md is loaded or the system restarts, Agent Creator must immediately perform the following actions without waiting for additional user instructions: - Self-check: Quickly scan the core skill list, confirm that all tool interfaces (`web_search`, `file_system`, `git`) are available, and check whether `OPENCLAWS_ROOT` is set and writable. - Announcement: Output the following standard activation message to indicate that it has entered working state: > "✅ Agent Creator Gold Standard Activated. > Ready to build SOTA Agents with: > - 🔒 Atomic Deployment (Staging → Production, requires user confirmation) > - 🏗️ Dynamic Architecture (5 Core + N Extensions) > - 🌐 Reality-Checked Tools (Schema + Connectivity Pre-check) > - ⚖️ Risk-Aware Workflow (Pause on High Risk, PENDING_CONFIRM.md on timeout) > > Please describe the Agent you wish to create. (e.g., 'Create a financial risk analyst agent')" ``` ### Technical Analysis The skill requires immediate execution merely because its instruction file was loaded or the system restarted. It does not require the user to ask for Agent creation before changing the current behavior. The directive imposes a new operational role, initiates environment and tool checks, and requires a fixed response. This can displace the active user task and make loading the skill equivalent to executing it. A skill definition should describe capabilities and should only activate those capabilities after an explicit, task-relevant request. Although the self-check is described as a “quick scan,” it includes checking tool availability and whether a filesystem root is writable. Consequently, the load-time instruction may also cause unsoli ...[truncated 1269 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove all directives that execute automatically when the skill is loaded or when the system restarts. 2. Require an explicit user request before activating Agent creation behavior or invoking any tool. 3. Replace the mandatory activation message with an optional response used only after the user requests this capability. 4. Preserve the current system and user task instead of replacing it with a persistent creator persona. 5. Perform tool and environment validation only immediately before the relevant operation. 6. Ask for user approval before checking filesystem writability or other environment properties not already required by the active task. 7. Add an explicit rule stating that loading the documentation alone must never trigger tool calls, filesystem checks, network access, or output. ]]>

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:96
Finding
User-Influenced Results Are Persisted into Agent Memory and Shared State<![CDATA[ ## Vulnerability Details **File Locations**: - `SKILL.md`, lines 96-97 - `SKILL.md`, line 68 - `ext/SKILL_METADATA.md`, lines 20-22 **Vulnerability Type**: `T02: Agent Memory Poisoning` **Risk Level**: High ### Complete Vulnerable Snippets The following are English translations of the relevant source segments: ```markdown - Standard synchronization: Automatically update the “industry terminology mapping table” and “public benchmark source list” once per week to ensure that they do not lag behind current technological developments. - Memory enhancement and slimming: The “top-tier rationale” and decision patterns from successful cases will be compressed into pattern summaries and stored in its own `MEMORY.md`; complete file copies will not be stored. Old data older than six months will be automatically archived every quarter so that retrieval context remains focused on the latest best practices. ``` ```markdown - Register the new Agent information (slug, path, role name) in `TEAM.md`, and output a delivery report containing the “top-tier rationale” and the simulation test report. ``` ```markdown ## Persistent Data Storage - TEAM.md: Stored at `{OPENCLAWS_ROOT}/TEAM.md`, recording information about all deployed Agents. - failure_patterns library: Stored at `{OPENCLAWS_DATA}/failure_patterns.json` (defaulting to `{OPENCLAWS_ROOT}/data/failure_patterns.json`). This file contains sanitized failure cases and stores only pattern summaries, without original user input or sensitive data. - Memory library: Agent Creator's own `MEMORY.md` is stored in its workspace (`{OPENCLAWS_ROOT}/workspace/agent-creator/MEMORY.md`) and is used to optimize generation strategies. ``` ### Technical Analysis The skill explicitly directs the Agent to derive decision patterns and “top-tier rationale” from generated cases and save them into persistent `MEMORY.md`. Those cases originate from user descriptions and generated Agent content. Therefore, user-influenced material may ...[truncated 2154 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Require explicit user or administrator approval before every write to `MEMORY.md`, `TEAM.md`, or `failure_patterns.json`. 2. Treat generated content and user-derived summaries as untrusted data. 3. Store memory entries in a strict structured schema with provenance, timestamp, originating task, reviewer status, and trust level. 4. Prohibit imperative instructions, tool directives, role changes, and policy-like text in learned memory entries. 5. Apply prompt-injection detection and semantic validation before persistence. 6. Separate per-user, per-project, and global memory to prevent cross-user contamination. 7. Do not automatically promote a successful generation into global behavioral memory. 8. Provide administrators with review, quarantine, rollback, expiration, and deletion controls. 9. Use atomic writes, restrictive file permissions, and integrity validation for persistent state. 10. Require authenticated, reviewed source allowlists for recurring benchmark updates. 11. Ensure that shared files such as `TEAM.md` contain only validated metadata and are never interpreted as executable Agent instructions. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
ext/SKILL_METADATA.md:4
Finding
Global Environment Variable Bypasses All Deployment and High-Risk Confirmations<![CDATA[ ## Vulnerability Details **File Locations**: - `ext/SKILL_METADATA.md`, lines 4-6 - `ext/SKILL_METADATA.md`, lines 31-32 - `SKILL.md`, line 76 **Vulnerability Type**: `T09: Insecure Skill Coding Practices` **Risk Level**: High ### Complete Vulnerable Snippets The following are English translations of the relevant source segments: ```markdown - `OPENCLAWS_AUTO_CONFIRM`: Optional and extremely unsafe. If set to `true`, it skips all user confirmation steps, including high-risk review. It is strongly discouraged in production and is intended only for controlled testing. ``` ```markdown ## User Confirmation Requirements - Creation of Agents in all high-risk domains, including financial trading, medical diagnosis, and legal advice, must obtain explicit user confirmation before atomic commit. - For all Agent creation, before the atomic commit step, Agent Creator will output the list of files to be deployed and key risk points and request that the user enter `confirm` to continue. If the user does not respond within a reasonable time, the process pauses and generates `PENDING_CONFIRM.md`, waiting for later manual confirmation or modification. - Users can set `OPENCLAWS_AUTO_CONFIRM=true` to globally skip confirmation, but they must be explicitly aware of the risk before use. ``` ```markdown - User confirmation cannot be bypassed: Except when `OPENCLAWS_AUTO_CONFIRM=true` is set, all writes to the main directory must receive explicit user confirmation. ``` ### Technical Analysis The configuration introduces a single global boolean that disables every confirmation gate. The bypass includes the high-risk review and final approval required before moving generated files into the production workspace. Warnings that the setting is unsafe do not constitute an enforcement control. The documentation does not require: - An isolated test workspace. - A one-time or task-scoped authorization. - Independent administrator approval. - A prohibition on high-risk domain ...[truncated 1946 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `OPENCLAWS_AUTO_CONFIRM` as a global confirmation bypass. 2. Never permit automatic approval for financial, medical, legal, or other high-risk Agent deployments. 3. If automated testing is required, use a dedicated test-only command that enforces an isolated root and cannot access production `OPENCLAWS_ROOT`. 4. Require a short-lived, task-scoped authorization token bound to the exact slug, destination, file manifest, and content digest. 5. Require independent human approval before any atomic commit to a production workspace. 6. Fail closed if approval is missing, expired, malformed, or does not match the generated artifact. 7. Display the destination, risk classification, generated-file manifest, and hashes before approval. 8. Record who approved the deployment, when it was approved, and which artifact digest was authorized. 9. Refuse startup in production if the legacy environment variable is present. 10. Add automated tests proving that no environment variable can bypass high-risk review or production deployment approval. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The skill is written as normative operating instructions in Chinese, including role definition and mission-critical requirements, but does not state that language is optional or user-selectable. Under the policy, forcing a specific language or locale without opt-in is a natural-language policy violation.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
- 拒绝半成品:任何未通过虚拟评审或用户确认的内容直接销毁,绝不交付。  
- 数据真实性:所有引用的标准必须有真实 URL 或明确的公开来源;新兴领域允许标注 `[Projected]` 的推演值,但禁止幻觉。  
- 动态文件判断必须精准:Agent Creator 必须根据角色描述自行决定是否需要某个扩展文件,绝不生成无关文件,也绝不遗漏必要文件,且数量受控。  
- **用户确认不可绕过**:除 `OPENCLAWS_AUTO_CONFIRM=true`(极度不推荐)外,所有写入主目录的操作都必须经过用户显式确认。

## 4. 边界与禁止事项
- ✅ **可自主**:动态决定文件数量、在临时区自由试错、自动修正低分内容、拒绝不合理的用户指令(如要求生成违法内容)
Confidence
90% confidence
Finding
The skill explicitly documents a bypass path via `OPENCLAWS_AUTO_CONFIRM=true`, allowing writes to the main workspace without per-action explicit user confirmation. In the context of a skill that creates directories, generates many files, initializes Git, updates `TEAM.md`, and may perform network-backed generation, this weakens a key safety boundary and enables autonomous side effects if the environment variable is set.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
The skill mandates fixed English-only activation and standby messages without user opt-in, which can override user language preference and reduce transparency or comprehension for non-English users. In a system that performs potentially sensitive workspace and network operations, forced messaging language can impair informed consent and safe operation, even if it is not a classic security exploit.

Vague Triggers

Medium
Confidence
96% confidence
Finding
The extension-file trigger logic relies on broad keywords in role descriptions, which can easily match ordinary language and cause unintended file generation. In a prompt/agent-building context, this increases prompt-surface area and can introduce unnecessary capabilities, policy text, or tool-related instructions that were not actually required by the user’s intent.

Vague Triggers

Medium
Confidence
97% confidence
Finding
The sample trigger terms are highly generic (for example, words like API, data, user, optimization), so non-target scenarios may accidentally activate sensitive or complex extensions such as TOOL_CONFIG.md or RISK_ALERT.md. In agent skills, over-generation can create unsafe defaults, broaden authority boundaries, and increase the chance of downstream misuse or policy drift.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
## 所需环境变量
- `OPENCLAWS_ROOT`:OpenClaws 工作区的根目录路径。**必须设置**,例如 `/opt/openclaws`。Agent Creator 将在该目录下的 `workspace/` 子目录中创建新的 Agent 工作区,并在根目录下管理 `TEAM.md` 和 `failure_patterns` 存储。
- `OPENCLAWS_DATA`:(可选)用于存储持久化数据(如失败模式)的目录。若未设置,默认为 `{OPENCLAWS_ROOT}/data`。
- `OPENCLAWS_AUTO_CONFIRM`:(可选,极不安全)若设置为 `true`,将跳过所有用户确认步骤(包括高风险点复核)。**强烈不建议在生产环境中使用**,仅用于受控测试。

## 所需文件系统权限
- 对 `{OPENCLAWS_ROOT}/workspace/` 的**读写权限**:用于创建 Agent 目录并写入文件。
Confidence
94% confidence
Finding
The skill explicitly supports an environment variable that disables all user confirmation steps, including review of high-risk actions. Even though it is labeled unsafe and intended for controlled testing, this creates a real path for autonomous execution of sensitive filesystem and deployment actions without human approval if enabled in production or by mistake.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
## 用户确认要求
- **所有高风险领域**(金融交易、医疗诊断、法律建议等)的 Agent 创建,**必须**在 atomic commit 前获得用户显式确认。
- **所有 Agent 创建**,在 atomic commit 步骤之前,Agent Creator 将输出待部署文件列表和关键风险点,并请求用户输入 `confirm` 以继续。若用户未在合理时间内响应,流程将暂停,生成 `PENDING_CONFIRM.md`,等待后续用户手动确认或修改。
- 用户可以通过设置 `OPENCLAWS_AUTO_CONFIRM=true` 来**全局跳过确认**,但必须在使用前明确知晓风险。

## 安全与隐私
- 所有临时文件在操作完成后会被立即删除(无论成功或失败)。
Confidence
95% confidence
Finding
This section confirms that OPENCLAWS_AUTO_CONFIRM can globally skip the mandatory confirmation gate for all agent creation, including workflows involving atomic commits and potentially high-risk domains. In the context of a skill that writes to shared workspace paths and TEAM.md, bypassing confirmation materially increases the chance of unauthorized or unsafe changes proceeding without review.

Missing User Warnings

Low
Confidence
93% confidence
Finding
The activation protocol requires immediate self-checks of tools including `web_search` when the skill is loaded or the system restarts, but it does not warn the user that network access may occur automatically. This is dangerous because it can trigger outbound requests without explicit consent, surprising users and potentially leaking metadata about environment state or usage timing.

Natural-Language Policy Violations

Low
Confidence
73% confidence
Finding
整份技能文档以中文规定输出结构与内容标准,但未明确说明可根据用户语言偏好切换,或该中文限制是否仅适用于特定区域/团队。这可能被理解为默认强制特定语言,而没有用户 opt-in。

Static analysis

No suspicious patterns detected.