Back to skill

Security audit

add-openclaw-agent

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-aligned, but it creates persistent agents through shell commands without tight enough argument-safety instructions.

Install only if you are comfortable with a skill that can create persistent OpenClaw agents and write their operating rules. Review the final agent name, workspace path, optional flags, and exact IDENTITY.md/AGENTS.md content before allowing execution or file edits, and avoid storing secrets in those files.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:31
Finding

Shell Command Injection Through Unvalidated CLI Arguments

Content
View full analysis
`. ### 1. Create the agent with exec (non-interactive, JSON) Use the **exec** tool to run the OpenClaw CLI. Non-interactive creation **requires** `--workspace` and `--non-interactive`. Before creating, check whether it already exists: ```bash openclaw agents list --json ``` Before running creation, explicitly ask for confirmation, for example: - `I am ready to run: openclaw agents add --workspace ~/.openclaw/workspace- --non-interactive --json. Run it now?` Only execute the command after the user confirms. Create the agent: ```bash openclaw agents add --workspace ~/.openclaw/workspace- --non-interactive --json ``` Optional flags you can add when needed: - `--model ` – default model for this agent. - `--agent-dir ` – agent state dir (default: `~/.openclaw/agents//agent`). - `--bind ` – route a channel to this agent (repeatable). ``` ### Technical Analysis The Skill directs the agent to construct and execute a shell command using an agent name, normalized agent ID, model ID, directory, and channel binding that may originate from user input. It recommends simple names but does not impose a mandatory allowlist, reject shell metacharacters, require shell-safe quoting, or require an execution interface that passes arguments without invoking a shell. The statement that OpenClaw normalizes agent name ...[truncated 1995 chars]
Remediation
View remediation
- --workspace - - --non-interactive - --json ``` 4. If shell execution is unavoidable, apply robust platform-appropriate quoting to every dynamic argument after validation. Do not rely on manual interpolation or user confirmation as the primary defense. 5. Build the workspace path from the validated normalized ID rather than accepting an arbitrary path. Resolve the resulting path and verify that it remains beneath the intended OpenClaw workspace directory. 6. Update the Skill instructions to require displaying the validated executable and each argument separately before confirmation, and abort when validation fails. ]]>
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

This skill creates a persistent new agent workspace and writes long-lived identity and operating rules into files, which establishes session-like state beyond the current interaction. If misused, sensitive instructions, unsafe policies, or user-derived content could persist and affect future actions by that agent without fresh review.

Content

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

md
---
name: add-openclaw-agent
description: Create a new OpenClaw agent via exec (openclaw agents add) and configure its identity + operating rules by editing the new workspace files (IDENTITY.md, AGENTS.md). Use when the user wants a new agent and can describe what they want it to do; this skill asks for the purpose first, chooses an agent-name, runs the non-interactive CLI with --json, then writes the role/task instructions into the workspace.
---

# Add OpenClaw Agent

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The example appended content at L089 is written in Chinese, and a second Chinese-only example appears later in the file. Because this skill is not documented as China-specific and does not explicitly make language selection optional, the natural-language guidance can steer agents toward a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The sample operating-rules section is entirely in Chinese, which can signal that generated agent instructions should default to that language. Under the policy, forcing or implying a specific language is a violation unless the skill offers explicit user choice or clearly documents a justified locale constraint.

Content

No source excerpt is available for this finding.