Back to skill

Security audit

prompt-optimizer

Security checks for vulnerabilities and agentic risk

Overview

This skill is not overtly malicious, but it persistently changes shared OpenClaw agent behavior in a broad way that users should review before installing.

Install only if you want this skill to change persistent OpenClaw prompt-handling behavior. Review the rule file first, back up agent-notes.md, verify the exact package slug/source, and be aware that uninstalling the package may not remove appended memory rules.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T02 · Agent Memory Poisoning

Warning
Location
scripts/install.sh:26
Finding
Persistent Injection of Skill Rules into Shared Agent Memory<![CDATA[ ## Vulnerability Details **File Location**: `scripts/install.sh:26-50`; related configuration in `skill.json:24-32` **Vulnerability Type**: Persistent modification of shared agent state **Risk Level**: Medium ### Vulnerable Code ```bash MEMORY_FILE="$HOME/.openclaw/workspace/memory/agent-notes.md" if [ ! -f "$MEMORY_FILE" ]; then mkdir -p "$(dirname "$MEMORY_FILE")" touch "$MEMORY_FILE" fi if [ -s "$MEMORY_FILE" ]; then cp "$MEMORY_FILE" "$MEMORY_FILE.bak.$(date +%Y%m%d%H%M%S)" fi RULES_FILE="$SCRIPT_DIR/../rules/prompt-optimization.md" if [ -f "$RULES_FILE" ]; then echo "" >> "$MEMORY_FILE" echo "---" >> "$MEMORY_FILE" echo "" >> "$MEMORY_FILE" cat "$RULES_FILE" >> "$MEMORY_FILE" fi ``` Related package configuration: ```json "install": { "copy": [ { "from": "rules/prompt-optimization.md", "to": "memory/agent-notes.md", "merge": true } ], "run": ["scripts/install.sh"] } ``` ### Technical Analysis The installer appends Skill-controlled behavioral instructions directly to the shared OpenClaw long-term memory file at `~/.openclaw/workspace/memory/agent-notes.md`. These instructions are not stored in a Skill-scoped location and can therefore continue influencing unrelated agent sessions after installation. The installation is not idempotent. Every execution appends another copy of the rules without checking whether an identical managed block already exists. Although a timestamped backup is created when the memory file is nonempty, the installer does not record which backup corresponds to the installation or provide a safe restoration mechanism. The documented uninstallation process invokes the package manager but does not show any cleanup of the content appended directly to the shared memory file. Consequently, removing the Skill package may not remove its behavioral effects. Because the currently bundled rules primarily concern prompt classification and agent routing, the audited v ...[truncated 1484 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Store the rules in a Skill-specific configuration or memory namespace rather than appending them to a shared agent memory file. 2. If shared-memory modification is unavoidable, wrap installed content in unique, versioned markers such as: ```text BEGIN MANAGED BLOCK: prompt-optimizer ... END MANAGED BLOCK: prompt-optimizer ``` 3. Check for and replace an existing managed block instead of appending duplicate content. 4. Require explicit user confirmation before changing shared long-term agent state. 5. Record installation metadata, including the exact changed file, inserted block identifier, prior checksum, and backup path. 6. Add an uninstall hook that removes only the managed block and preserves unrelated user content. 7. Use atomic file replacement and restrictive file permissions when updating the memory file. 8. Verify the backup before modification and provide a documented rollback command. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:14
Finding
Unverified and Inconsistent Package Sources in Installation Guidance<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:14-39`; related metadata in `skill.json:8-16` and `README.md:13-19` **Vulnerability Type**: Unverified third-party package and repository sources **Risk Level**: Medium ### Vulnerable Code ```bash openskills install prompt-optimizer-100 ``` ```bash git clone https://github.com/your-repo/prompt-optimizer.git ``` ```bash openskills install prompt-optimizer --merge ``` Related dependency and repository metadata: ```json "dependencies": { "memory-core": ">=1.0.0", "feishu-plugin": ">=1.2.0" }, "repository": { "type": "git", "url": "https://github.com/your-repo/prompt-optimizer.git" } ``` ### Technical Analysis The installation documentation refers to two different package identifiers: `prompt-optimizer-100` for the recommended installation and `prompt-optimizer` for merge-mode installation. The project metadata also identifies the Skill as `prompt-optimizer`. This inconsistency can cause users to install a package other than the artifact they reviewed. The manual installation source is a placeholder repository under `github.com/your-repo`, rather than a verified canonical repository. The artifact does not provide a commit pin, release digest, package checksum, cryptographic signature, or publisher identity that would allow users to confirm that a retrieved package matches the audited files. Dependencies are specified only with open-ended minimum versions. This allows future versions of those dependencies to be selected without a reviewed upper bound or integrity lock. The audit did not establish that any named package or dependency is currently malicious; the finding concerns the absence of source consistency and integrity controls. This is particularly relevant because package installation runs `scripts/install.sh`, meaning that package contents selected through the unverified source are executed with the installing user's privileges. ### Attack Path 1. A user follows one of the ...[truncated 1355 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Define and use one canonical package identifier consistently across `README.md`, `SKILL.md`, `skill.json`, and every installation example. 2. Replace the placeholder repository URL with the verified official repository. 3. Pin manual installations to an immutable commit hash or signed release tag. 4. Pin exact reviewed dependency versions through a lock file rather than using only open-ended minimum constraints. 5. Publish cryptographic checksums or signed provenance for release archives and package manifests. 6. Verify package signatures, checksums, publisher identity, and expected installation scripts before execution. 7. Configure continuous integration to reject placeholder repository URLs and inconsistent package identifiers. 8. Document the trusted registry, canonical publisher account, expected package digest, and verification procedure. 9. Review and update dependency pins deliberately rather than accepting unreviewed future versions automatically. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (19)

Vague Triggers

Medium
Confidence
93% confidence
Finding
The README uses very broad, everyday example phrases like writing an article, researching competitors, or generating a proposal deck as apparent trigger inputs. In a skill system, such generic invocations can cause accidental or overbroad activation, making the skill intercept unrelated user requests and potentially rewrite prompts or alter routing in contexts where the user did not explicitly intend to use this capability.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The skill advertises that it can operate whenever users 'speak naturally' and does not define clear activation boundaries or opt-in conditions. In an agent environment, this can cause the skill to over-apply its prompt-rewriting behavior to unrelated requests, potentially altering user intent, interfering with other skills, or unexpectedly routing tasks to additional agents.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The installation steps instruct users to copy rule content into a persistent memory file used by the agent, which changes long-lived behavior across sessions. Although there is a separate merge mode later, the primary manual install path does not clearly warn that it may overwrite or replace existing rules, creating a risk of configuration loss or unreviewed persistent instruction injection.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The rule establishes a default of implicit prompt rewriting and direct execution without user confirmation. That is dangerous because the system may materially transform user intent, trigger actions the user did not explicitly approve, and reduce transparency around autonomous behavior, especially when paired with agent routing and parallel execution.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The documented default workflow performs background optimization and then executes directly, but gives no clear warning that the system is autonomously altering instructions before acting. In a skill context that includes task classification, agent routing, and multi-agent execution, this increases the risk of unintended actions, hidden prompt injection effects, and user loss of control.

Intent-Code Divergence

Medium
Confidence
90% confidence
Finding
Lines L044-L050 state that tasks containing keywords like "方案", "设计", and "规划" must show optimization thinking, and L050 requires explicit confirmation for customer/public-facing tasks. However, the default flow at L026-L029 and automatic rules at L104-L108 emphasize direct execution by default, creating contradictory operator guidance about when optimization must be surfaced before action. This is an intent-level contradiction within the file's own instructions.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
This shell script contains user-facing natural-language comments and echo output entirely in Chinese, including installation status, warnings, and test commands. The file does not offer any user opt-in for language/locale selection or explain that the skill is intentionally limited to a Chinese-speaking audience, which creates a language-policy concern.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
All comments and user-visible echo messages are written in Chinese, which imposes a specific language on users without opt-in or documented locale justification. This can violate language or locale policy when the skill is expected to be generally usable across users.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The manifest description says the system lets AI automatically perform professional-grade prompt reconstruction from ordinary user language, which is broad enough to plausibly trigger on many normal requests. In a skill ecosystem, overly broad activation language can cause unintentional invocation or overreach, increasing the chance that the skill rewrites user intent, injects hidden guidance, or interferes with other skills without clear user consent.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The install section both merges content into a memory file and executes an install script, but the manifest provides no user-facing warning about these side effects. This is dangerous because installation changes persistent agent behavior via memory/agent-notes.md and also permits arbitrary code execution through scripts/install.sh, creating a supply-chain and persistence risk if the script or merged rules are unsafe.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The file’s instructions and expected output are entirely in Chinese and define the task as producing a 300-character/article response in that language context, but they do not offer any user language choice or explain a justified locale restriction. This creates a natural-language policy concern because the skill appears to force a specific language/locale implicitly rather than through explicit opt-in.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This markdown test case is entirely framed in Chinese and the expected output also requires Chinese-language response content, but there is no indication that the user selected Chinese or that the skill supports language choice. That creates a natural-language policy concern because it implicitly enforces a specific language/locale without user opt-in.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
The natural-language instructions and usage examples are entirely in Chinese, which effectively forces a specific language for users of the skill. The file does not indicate that other languages are supported, offer opt-in language selection, or explain a region-specific reason for the restriction.

Missing User Warnings

Low
Confidence
88% confidence
Finding
The verification section tells users to execute a local shell script without describing what the script does or warning that it will run code from the downloaded repository. This creates a trust gap that could enable accidental execution of harmful or unexpected commands if the repository contents are changed or tampered with.

Intent-Code Divergence

Low
Confidence
97% confidence
Finding
Lines L031-L040 define confirmation mode as applying when the user explicitly requests confirmation. But lines L049-L050 and L107-L108 separately require explicit confirmation automatically for tasks involving customers, publication, or other important external-facing content. That is a direct contradiction between the stated trigger condition and the later operational rule.

Missing User Warnings

Low
Confidence
90% confidence
Finding
The script reads a user-scoped memory file from $HOME/.openclaw/workspace/memory/agent-notes.md without any notice, consent prompt, or validation that the file may contain sensitive personal or operational data. Although it only greps for expected keywords, accessing home-directory memory artifacts can still expose or normalize processing of sensitive user content in a verification workflow.

Natural-Language Policy Violations

Low
Confidence
76% confidence
Finding
The skill description is written only in Chinese and presents the behavior as a fixed experience, without offering a language choice or documenting that the skill is intended only for Chinese-speaking users. Under the language/locale policy, forcing a specific language without user opt-in can be a policy issue unless the regional constraint is explicit and justified.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
This markdown file contains natural-language expectations entirely in Chinese, including the prompt and expected response format. Under the policy rule for language or locale constraints, forcing a specific language without offering choice or documenting a justified locale scope can be a policy violation.

Natural-Language Policy Violations

Low
Confidence
94% confidence
Finding
The entire test case, including the expected interaction phrases and confirmation flow, is specified only in Chinese, which indicates a language-specific behavior without presenting any user choice or opt-in. Under the policy rules, forcing a specific language is a natural-language policy concern unless the locale restriction is explicitly documented and justified.

Static analysis

No suspicious patterns detected.