Back to skill

Security audit

Self-Evolve Skill

Security checks for vulnerabilities and agentic risk

Overview

This skill openly aims to make agents remember and rewrite their own behavior, but its scope reaches high-impact files that can affect future sessions and other bots.

Install only if you intentionally want an agent to propose and apply persistent behavior changes. Review every proposed diff, avoid L2 or L3 changes unless an administrator approves them, and treat CLAUDE.md or other global-rule writes as high-impact changes affecting future agents.

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)

T02 · Agent Memory Poisoning

Error
Location
SKILL-full.md:285
Finding

Persistent Agent Instruction and Memory Poisoning

Content
View full analysis

Vulnerability Details

File Location: SKILL-full.md:285-300
Vulnerability Type: Persistent storage of user-controlled Agent instructions
Risk Level: High

Vulnerable Code Snippet

markdown
| User response | Agent behavior |
|---------------|----------------|
| `Evolve` | Write to the proposed layer and create a Git commit |
| `Evolve L1` / `L2` / `L3` | Override the proposed layer and perform the write |
| `Ignore` | Skip and record the rejection as a negative sample |
| `Modify <new content>` | Replace the content and request approval again |
| `Batch evolve` | Approve all candidate entries |
| `Defer` | Retain the entry for reconsideration during the next review |
| `Confirm root cause` | Confirm an L2 root cause and continue writing |
| `Correct root cause <new cause>` | Replace the proposed cause and continue writing |

| Layer | Approval requirement | Additional operation |
|-------|----------------------|----------------------|
| L1 | One user confirmation | Write to MEMORY.md and create a Git commit |
| L2 | User confirmation and Darwin score of at least 70 | Write to SKILL.md, optimize, and create a Git commit |
| L3 | Two user confirmations covering layer and content | Write to CLAUDE.md, notify every bot, and create a Git commit |

The snippet is an English rendering of the corresponding source section; command names and file targets are preserved.

Technical Analysis

The Skill treats conversationally supplied content as a source of persistent Agent instructions. Once approved, this content can be written to:

  • MEMORY.md, affecting subsequent sessions that load Agent memory.
  • A SKILL.md, modifying reusable Skill instructions.
  • The global CLAUDE.md, affecting every bot that consumes the shared configuration.

The user may explicitly override the proposed destination by selecting L1, L2, or L3. Although the documentation describes approval checks ...[truncated 1882 chars]

Remediation
View remediation

Remediation Suggestions

  1. Prohibit this Skill from modifying CLAUDE.md, system instructions, identity files, and unrelated Skill files.
  2. Store user preferences as typed, inert data with a strict schema rather than as free-form prompt instructions.
  3. Enforce an allowlist of supported preference keys and values in executable code.
  4. Reject content that attempts to alter safety policy, tool permissions, identity, instruction priority, approval requirements, or other bots.
  5. Do not allow a conversational command to override the destination layer.
  6. Require a trusted administrator—not merely the message author—to authorize L2 or global changes.
  7. Display the exact destination, normalized content, and complete file diff before approval.
  8. Apply repository path confinement so writes cannot escape a dedicated preference-data directory.
  9. Disable automatic cross-bot reload notifications for user-derived content.
  10. Record provenance and provide an atomic rollback mechanism that removes both the stored entry and its activation state.
  11. Add adversarial tests covering prompt injection, safety-rule modification, destination-layer override, and cross-bot propagation.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/evolution_engine.py:137
Finding

Keyword-Based Global Instruction Routing Lacks Enforceable Authorization

Content
View full analysis

Vulnerability Details

File Location: scripts/evolution_engine.py:137-145
Vulnerability Type: Unsafe destination selection for persistent Agent configuration
Risk Level: Medium

Vulnerable Code Snippet

python
def determine_layer(text: str, trigger: str) -> Tuple[str, str]:
    """Determine the target layer and path."""
    if any(kw in text for kw in ["skill", "skill"]):
        return "L2", "SKILL.md (a specific skill must be selected)"
    if any(kw in text for kw in ["all", "global", "policy", "CLAUDE"]):
        return "L3", "/root/.openclaw/workspace/CLAUDE.md"
    if trigger == "failure":
        return "L2", "SKILL.md (a specific skill must be selected)"
    return "L1", "/root/.openclaw/workspace/MEMORY.md"

The snippet is an English rendering of the source, whose keyword literals and explanatory strings are written in another language. The control flow and destination paths are unchanged.

Technical Analysis

The destination layer is selected through substring matching against untrusted conversational text. Merely mentioning concepts such as “all,” “global,” “policy,” or CLAUDE can classify a message as an L3 update targeting the global Agent configuration.

This mechanism does not establish that the message author is authorized to modify global instructions. It also does not distinguish between a requested change and quoted, negated, hypothetical, or explanatory text. No structured parser, trusted policy decision, or destination allowlist prevents the resulting card from proposing a high-impact global target.

The helper does not itself write files. Exploitation therefore depends on the documented approval and write workflow being used after the card is generated. Nevertheless, it supplies an unsafe high-privilege destination decision to that workflow.

Attack Path

  1. An attacker submits a message containing a normal evolution trigger and one of the broad L3 substring ...[truncated 924 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove automatic L3 selection based on conversational keywords.
  2. Represent the requested operation as a structured object with an explicit, validated destination.
  3. Restrict global configuration changes to authenticated administrative workflows.
  4. Require an independent policy check before generating any proposal that targets CLAUDE.md.
  5. Correctly identify quotations, negation, questions, examples, and hypothetical statements.
  6. Default ambiguous requests to a non-persistent preview rather than L1 or L3.
  7. Bind authorization to the destination path and proposed diff, preventing approval reuse after content changes.
  8. Add unit tests proving that incidental mentions of global concepts or CLAUDE.md cannot trigger global routing.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (32)

Self-Modification

High
Category
Rogue Agent
Confidence
99% confidence
Finding

The skill is explicitly designed for self-modification: it can alter memory, other skill files, and even global policy files based on conversational triggers. Self-modifying behavior is high risk because prompt manipulation, misclassification, or weak approval UX can convert ordinary dialogue into persistent behavioral changes with expanding scope.

Content

Scanner excerpt · SKILL-full.md (reported line 2)May include surrounding context.

md
---
name: self-evolve.skill
description: "Agent自进化机制。三层架构(记忆→技能→规范),三种触发(关键词+踩坑+复盘),用户审批+Darwin评分双重质控。用得越多越懂你。触发词:自进化、进化、evolve、记住、以后、永远、下次、踩坑经验。当用户说「以后」「记住」「永远」等长期意图词,或Agent踩坑后需沉淀经验时自动激活。"
version: "2.1.0"
author: "Shike"

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger phrases include very common terms such as '以后', '记住', and '下次', which are likely to appear in ordinary conversation. This makes unintended activation highly probable, increasing the chance of accidental persistence, repository writes, or policy changes from casual language rather than deliberate consent.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
99% confidence
Finding

The skill branding and tags reinforce that the system should evolve itself over time, including optimization of skills and memory. In context, this is not just descriptive metadata: it accurately reflects a capability to persistently rewrite agent behavior, which materially increases attack surface and the durability of mistakes.

Content

Scanner excerpt · SKILL-full.md (reported line 10)May include surrounding context.

md
tags: [self-evolution, evolve, memory, skill-optimization, darwin, 自进化, 进化, 记忆优化]
---

# self-evolve.skill — Agent自进化机制

> **教一遍,记一辈子。用得越多,越懂你。**

Self-Modification

High
Category
Rogue Agent
Confidence
96% confidence
Finding

This skill is explicitly designed for self-evolution and persistent modification of memory, skills, and norms. Even if intended as a productivity feature, self-modification is inherently high risk because it can entrench prompt injection, persist mistaken instructions, and gradually alter higher-priority behavior across sessions.

Content

Scanner excerpt · SKILL-lite.md (reported line 2)May include surrounding context.

md
---
name: self-evolve.skill
description: "Agent自进化机制。三层架构(记忆→技能→规范),三种触发(关键词+踩坑+复盘),用户审批+Darwin评分双重质控。用得越多越懂你。触发词:自进化、进化、evolve、记住、以后、永远、下次、踩坑经验。"
version: "2.1.0"
author: "Shike"

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill advertises trigger words such as '记住', '以后', '永远', and '下次' that are common in ordinary conversation, making accidental activation likely. Broad triggering increases the chance that transient user statements, quoted text, or adversarial prompting will be treated as persistent memory or self-modification requests.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
96% confidence
Finding

The tags and title reinforce that the skill's purpose is self-evolution and skill optimization, which materially expands the attack surface by allowing durable behavioral changes. In a hostile prompt environment, such a mechanism can convert one-off manipulation into persistent compromise.

Content

Scanner excerpt · SKILL-lite.md (reported line 10)May include surrounding context.

md
tags: [self-evolution, evolve, memory, skill-optimization, darwin, 自进化, 进化, 记忆优化]
---

# self-evolve.skill — Agent自进化机制

> **教一遍,记一辈子。用得越多,越懂你。**

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill forbids evolving security constraints and system rules, yet L3 explicitly targets global behavior constraints, development norms, and safety boundaries in CLAUDE.md. That contradiction could let the agent rewrite high-authority policy under the label of 'evolution,' weakening guardrails or causing policy drift over time.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The keyword trigger table operationalizes generic everyday words as activation conditions, including urgent behavior for terms like 'must' or 'always'. In practice, this makes the skill easy to trigger unintentionally and easier for an attacker to manipulate through normal-looking conversation.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

代码与描述部分一致:确实围绕“自进化”机会检测展开,具备关键词触发、踩坑检测、三层目标判断和频率控制等能力。但存在实质性描述偏差。首先,描述明确提到三种触发(关键词+踩坑+复盘),代码只实现了前两种,没有任何复盘逻辑。其次,描述强调“用户审批+Darwin评分双重质控”,而代码仅返回文本卡片供人工确认,没有审批状态管理、评分调用或相关校验。最后,描述给人的印象是较完整的自进化机制,而该代码块实际只是辅助检测与建议生成,不进行文件修改、记忆写入或规范更新。因此应判定为描述与实际行为存在不匹配。

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
95% confidence
Finding

The skill is explicitly designed around self-modification across memory, skill, and behavior-rule layers, including writes to MEMORY.md, SKILL.md, and CLAUDE.md. Even with stated approval steps, self-modification is inherently high risk because it can be abused to persist attacker-influenced instructions, alter future agent behavior, and gradually erode safety boundaries if review is inconsistent or bypassed.

Content

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

md
---
name: self-evolve.skill
description: "Agent自进化机制。三层架构(记忆→技能→规范),三种触发(关键词+踩坑+复盘),用户审批+Darwin评分双重质控。用得越多越懂你。触发词:自进化、进化、evolve、记住、以后、永远、下次、踩坑经验。"
version: "2.1.0"
author: "Shike"

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger list includes extremely common terms such as '以后', '永远', '下次', and '记住', which can appear in ordinary conversation. This can cause the agent to repeatedly initiate memory/self-modification workflows from benign user phrasing, increasing the risk of unintended persistence of user content, preference poisoning, and approval fatigue that weakens human oversight.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
95% confidence
Finding

The tags and title reinforce that this is a self-evolution/self-optimization capability, which in context means the skill is intended to influence future behavior persistently. In security terms, this context makes the feature more dangerous, not less, because broad self-modification capabilities amplify the effect of malicious prompts, social engineering, and accidental policy drift across sessions.

Content

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

md
tags: [self-evolution, evolve, memory, skill-optimization, darwin, 自进化, 进化, 记忆优化]
---

# self-evolve.skill — Agent自进化机制

> **教一遍,记一辈子。用得越多,越懂你。**

Vague Triggers

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The keyword trigger table operationalizes ambiguous activation conditions for routine words and escalates behavior based on them. In a self-modifying skill, broad activation is more dangerous because it can convert casual dialogue into proposed durable memory, skill, or policy changes, creating a practical avenue for prompt injection, manipulation of future behavior, and inadvertent storage of sensitive or low-quality instructions.

Content

No source excerpt is available for this finding.

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · scripts/README.md (reported line 3)May include surrounding context.

md
#!/usr/bin/env python3
"""
self-evolve.skill 进化引擎 v2.0
配合SKILL.md使用,提供辅助功能
"""

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · scripts/evolution_engine.py (reported line 3)May include surrounding context.

python
#!/usr/bin/env python3
"""
self-evolve.skill 进化引擎 v2.0
配合SKILL.md使用,提供辅助功能
"""

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · scripts/evolution_engine.py (reported line 224)May include surrounding context.

python
#!/usr/bin/env python3
"""
self-evolve.skill 进化引擎 v2.0
配合SKILL.md使用,提供辅助功能
"""

Ssd 3

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The promise to 'remember for life' encourages indefinite retention of user preferences and interaction-derived rules. Indefinite retention increases privacy exposure, stale-rule accumulation, and the chance that old context continues to affect future behavior in ways the user no longer expects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill markets itself as remembering and evolving, but does not give a concise up-front warning that approved actions will write to persistent files and create Git commits affecting memory, skills, or global policy. Users may approve '进化' without understanding the permanence and scope of the resulting changes.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly directs the agent to persist user-derived information across conversations by writing to durable files. Persistent storage of interaction data creates privacy and retention risk, especially when activation can be triggered by common speech and when stored content may later influence behavior across sessions.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · SKILL-full.md (reported line 71)May include surrounding context.

Darwin评分调用方式(新增):

text
Step 1: 读取 /root/.openclaw/workspace/skills/darwin-skill/SKILL.md
Step 2: 按Darwin评分rubric评估拟写入内容
        - 结构维度(60分):Frontmatter/工作流/边界/检查点/指令/资源/架构
        - 效果维度(40分):实测表现

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

Although the skill defines guardrails, the activation logic still relies on subjective interpretation of user intent, emotional context, ambiguity, and layer selection. Ambiguous heuristics in a self-modifying workflow are dangerous because misclassification can escalate ordinary dialogue into persistent writes or broader policy updates.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The periodic review workflow instructs the agent to mine prior memory files for recurring patterns, effectively profiling prior interactions to generate new persistent rules. That amplifies the privacy impact of stored data and can infer preferences or behaviors beyond what the user explicitly intended to preserve.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

User approval commands and most operational instructions are specified only in Chinese terms such as "进化", "忽略", and "暂缓", and the skill description is written as if Chinese is the required interaction language. This imposes a language constraint without user opt-in or a documented reason that the skill is region- or locale-specific.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill authorizes repository-modifying Git actions, including commit and revert operations, as part of routine 'evolution'. Even with user approval gates, this expands the skill from preference capture into codebase mutation, creating a path for unintended or unsafe persistent changes and rollback abuse if triggers fire incorrectly or approvals are socially engineered.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill describes persistent writes to MEMORY.md, SKILL.md, CLAUDE.md, and Git commits without clearly foregrounding the retention, audit, and repository-side effects to the user. Users may approve what looks like a conversational convenience without understanding that personal preferences or operational history will be stored durably and versioned.

Content

No source excerpt is available for this finding.