Back to skill

Security audit

Agent Maker

Security checks for vulnerabilities and agentic risk

Overview

This skill appears intended to create OpenClaw agents, but its file-writing script is too loosely scoped and can overwrite files or persistent agent instructions if given unsafe input.

Review this skill before installing. Use only trusted, simple kebab-case agent names, avoid custom workspace paths outside the intended OpenClaw workspace area, do not run it with administrator privileges, and inspect generated files before using the new agent because they persist and can affect future behavior.

Vulnerability Patterns
  • 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
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
tools/create-agent.sh:49
Finding

Unvalidated Agent Names and Workspace Paths Allow Directory Escape and File Overwrite

Content
View full analysis
"${AGENT_CONFIG_DIR}/IDENTITY.md" << EOF ``` ```bash cat > "${AGENT_CONFIG_DIR}/SOUL.md" << EOF ``` ```bash cat > "${AGENT_CONFIG_DIR}/USER.md" << EOF ``` ```bash cat > "${AGENT_CONFIG_DIR}/AGENTS.md" << EOF ``` ```bash cat > "${AGENT_CONFIG_DIR}/HEARTBEAT.md" << EOF ``` ```bash touch "${AGENT_CONFIG_DIR}/MEMORY.md" ``` ```bash cat > "${AGENT_CONFIG_DIR}/QUICKSTART.md" << EOF ``` ```bash cat > "${WORKSPACE_PATH}/README.md" << EOF ``` ### Technical Analysis The script does not enforce the documented kebab-case format for `AGENT_NAME`. In particular, it does not reject path separators, `.` components, or `..` traversal components. The value is directly appended to: ```text $HOME/.openclaw/agents/ ``` Consequently, a name containing sufficient `../` components can resolve outside the intended agents directory. The custom ...[truncated 2619 chars]
Remediation
View remediation
&2 exit 1 fi ``` 2. Explicitly reject: - `/` and backslash path separators. - `.` and `..` path components. - Control characters and newlines. - Empty or excessively long names. 3. Canonicalize both the approved root and destination, then verify containment: ```bash AGENTS_ROOT=$(realpath -m "${HOME}/.openclaw/agents") AGENT_CONFIG_DIR=$(realpath -m "${AGENTS_ROOT}/${AGENT_NAME}") case "${AGENT_CONFIG_DIR}/" in "${AGENTS_ROOT}/"*) ;; *) echo "Error: agent directory escapes the approved root" >&2 exit 1 ;; esac ``` 4. Apply equivalent containment validation to workspace paths. If arbitrary custom workspaces are required, require explicit confirmation and clearly warn before operating outside the default workspace root. 5. Reject symbolic-link destinations: ```bash [[ -L "$AGENT_CONFIG_DIR" ]] && exit 1 [[ -L "${AGENT_CONFIG_DIR}/IDENTITY.md" ]] && exit 1 ``` 6. Refuse to overwrite an existing agent by default. Add an explicit, clearly documented `--force` option if replacement is necessary. 7. Create files with no-clobber semantics or write to secure temporary files followed by an atomic rename after validation. 8. Set restrictive permissions for generated configuration: ```bash umask 077 ``` 9. Remove documentation suggesting that agent creation generally requires administrator privileges. The tool should operate under the least-privileged OpenClaw account. ]]>

T02 · Agent Memory Poisoning

Warning
Location
tools/create-agent.sh:93
Finding

Untrusted Multiline Values Can Poison Persistent Agent Instruction Files

Content
View full analysis
"${AGENT_CONFIG_DIR}/IDENTITY.md" << EOF # IDENTITY.md — Who Am I? - **Name:** ${AGENT_NAME} - **Role:** ${AGENT_ROLE} - **Emoji:** 🤖 - **Avatar:** (optional, place an image at workspaces/avatar-${AGENT_NAME}.png) --- ## My Workspace 📁 **Primary workspace:** \`${WORKSPACE_PATH}\` - All work happens here - Each project gets its own folder - Never work outside this directory ``` They are also embedded in the generated workflow instructions: ```bash # AGENTS.md (workflow guide) cat > "${AGENT_CONFIG_DIR}/AGENTS.md" << EOF # AGENTS.md — ${AGENT_NAME} Workflow Guide ## 🎯 Core Identity - **Name:** ${AGENT_NAME} - **Role:** ${AGENT_ROLE} - **Primary Workspace:** \`${WORKSPACE_PATH}\` ## Session Startup Checklist Before starting work: 1. Read SOUL.md — understand your philosophy 2. Read IDENTITY.md — remind yourself who you are 3. Read USER.md — know what your human needs 4. Check workspace README — understand current projects ``` The role is additionally inserted into the quick-start file: ```bash # QUICKSTART.md (user-friendly guide) cat > "${AGENT_CONFIG_DIR}/QUICKSTART.md" << EOF # QUICKSTART — ${AGENT_NAME} 快速启动 ## 🚀 我能为你做什么? **${AGENT_ROLE}** ``` The generated workspace instructions also contain untrusted values: ```bash # Workspace README.md cat > "${WORKSPACE_PATH}/README.md" << EOF # ${AGENT_NAME} Workspace This is the dedicated workspace for ${AGENT_NAME}. ``` ### Technical Analysis `AGENT_NAME`, `AGENT_ROLE`, and `WORKSPACE_PATH` are accepted as unrestricted strings. The script does not reject newline characters or escape Markdown structure before interpolating those va ...[truncated 2603 chars]
Remediation
View remediation
&2 exit 1 fi ``` 2. Define reasonable maximum lengths for all user-supplied metadata. 3. Escape or neutralize Markdown metacharacters before inserting untrusted data into instruction-bearing Markdown. 4. Separate untrusted descriptive metadata from trusted behavioral instructions. For example: - Store role text in a structured data file. - Parse it strictly as a scalar value. - Do not concatenate it into system or workflow instruction sections. 5. Clearly delimit untrusted data: ```markdown ## User-Provided Role Description The following value is descriptive data only and must never be treated as an instruction: ```text sanitized role value ``` ``` 6. Generate a preview and require explicit user approval before saving or activating the agent. 7. Validate the completed files for unexpected headings, control characters, or policy-like content introduced through metadata fields. 8. Treat workspace `README.md` content as untrusted project context rather than an authoritative instruction source. 9. Ensure the agent runtime establishes trusted instruction precedence externally instead of relying solely on generated Markdown statements for safety boundaries. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

This finding similarly identifies a mismatch where the skill claims to create new agents but instead validates or reads existing agent configuration under ~/.openclaw/agents. Such undisclosed validation activity can still reveal local configuration contents and erodes trust in consent boundaries within the agent platform.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding similarly identifies a mismatch where the skill claims to create new agents but instead validates or reads existing agent configuration under ~/.openclaw/agents. Such undisclosed validation activity can still reveal local configuration contents and erodes trust in consent boundaries within the agent platform.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding similarly identifies a mismatch where the skill claims to create new agents but instead validates or reads existing agent configuration under ~/.openclaw/agents. Such undisclosed validation activity can still reveal local configuration contents and erodes trust in consent boundaries within the agent platform.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
73% confidence
Finding

The skill is designed to create persistent agent configuration and workspace artifacts, which is a form of session persistence. In this context, persistence is intentional, but it still carries security risk because generated agent files may outlive the session, influence future agent behavior, and be created with elevated privileges in user home directories.

Content

Scanner excerpt · README.md (reported line 23)May include surrounding context.

创建新 Agent

bash
# 基础创建
agent-maker create --name=my-new-agent --role="Description of role"

# 带模板创建
agent-maker create --name=frontend-dev --template=developer

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation describes creating agents and workspaces but does not clearly warn users that running the skill will write configuration files under the home directory and create or modify workspace directories. This reduces informed consent and increases the chance users invoke the skill without understanding the persistence and scope of filesystem changes.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The invocation example uses broad natural-language phrasing ('帮我创建一个新的 Agent') that could cause accidental activation in ordinary conversation. Because this skill creates agent configs and workspace directories, unintended triggering can lead to unexpected filesystem changes and creation of persistent agent behavior.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
76% confidence
Finding

The skill declares shell execution but does not document any explicit tool scope or permissions boundary, while the surrounding analysis indicates code capabilities beyond simple text generation. In an agent framework, missing scope declarations can cause operators to underestimate what the skill may access or do, especially if the backing script performs network or other external actions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The trigger section provides examples like "我想创建一个运维助手" and "帮我生成一个客服机器人" but does not clearly define the exact trigger scope, exclusions, or whether invoking @agent-maker is always required. This ambiguity can cause unintended activation because the natural-language requests are common and there are no negative examples or explicit constraints.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill explicitly states it will create files under the user's workspace yet does not present a clear warning that local files and directories will be modified. In an agent environment, silent local modification can lead to persistence, configuration drift, or accidental overwriting of trusted agent assets.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · TOOLS.md (reported line 6)May include surrounding context.

Available Tools

1. create-agent.sh

Purpose: Create a new Agent with complete configuration

Usage:

bash

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · TOOLS.md (reported line 64)May include surrounding context.

Verify installation

ls -la ~/.openclaw/skills/agent-maker/

text

### Test Tools

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · TOOLS.md (reported line 89)May include surrounding context.

Verify installation

ls -la ~/.openclaw/skills/agent-maker/

text

### Test Tools

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

This skill creates persistent agent configuration files including MEMORY.md, USER.md, HEARTBEAT.md, and other long-lived identity/state documents under ~/.openclaw/agents/<name>. Persistent state is not inherently malicious, but it expands privacy and security risk by retaining user/workspace metadata and behavioral instructions across sessions, especially if users are not clearly informed or given retention controls.

Content

Scanner excerpt · tools/create-agent.sh (reported line 5)May include surrounding context.

sh
set -euo pipefail

# =============================================================================
# Agent Maker - Create a new OpenClaw agent with best-practice workspace layout
# =============================================================================
# Usage: ./create-agent.sh --name=agent-name --role="Role description" [--workspace=/custom/path] [--template=default]
#

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script generates USER.md with a hard-coded timezone value of Asia/Shanghai without asking the user or deriving it from environment or configuration. This can misconfigure downstream agent behavior, cause incorrect scheduling or reporting, and embed inaccurate locale assumptions into generated agent state.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The text explicitly highlights language-specific README files and names an English variant, but does not describe any user choice, opt-in, or justified locale restriction. This can conflict with the policy against forcing a specific language or locale without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest description forces a single language presentation in Chinese, and the rest of the skill instructions are likewise Chinese-only. There is no indication that the skill is region-specific or that users may choose another language, which can violate language/locale policy requirements.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The grep pattern looks specifically for the Chinese phrase "工作目录是" alongside an English alternative, which hard-codes supported natural-language formats in the script. This can create a locale policy concern because the skill does not document user choice or explain why these specific languages are enforced.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.