Back to skill

Security audit

Dida Agent Optimizer

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed OpenClaw repair assistant, but it also authorizes scheduled self-updates and broad cleanup actions that could persistently change agent behavior or delete useful local resources without enough review.

Install only if you want an operator-style skill that can inspect OpenClaw runtime state and propose repairs. Before enabling cron or heartbeat integration, require human approval for any changes to SKILL.md, references, cron jobs, service restarts, Docker cleanup, or file deletion; treat web/search-derived update content as untrusted until reviewed.

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
references/self-evolution.md:5
Finding

Scheduled self-modification from untrusted search results creates a persistent instruction-poisoning channel

Content
View full analysis
/dev/null # OpenAI 最新实践 curl -s "http://localhost:3004/search?q=openai+agent+patterns+function+calling+structured+outputs+error+recovery&format=json&engines=bing,duckduckgo" | python3 -c " import json, sys data = json.load(sys.stdin) for r in data.get('results', [])[:5]: print(f'- [{r.get(\"title\",\"\")}]({r.get(\"url\",\"\")})') " 2>/dev/null # 行业 Agent 架构趋势 curl -s "http://localhost:3004/search?q=llm+agent+architecture+patterns+self+healing+error+recovery+2026&format=json&engines=bing,duckduckgo" | python3 -c " import json, sys data = json.load(sys.stdin) for r in data.get('results', [])[:3]: print(f'- [{r.get(\"title\",\"\")}]({r.get(\"url\",\"\")})') " 2>/dev/null ``` ```markdown | 文件 | 检查内容 | 更新方式 | |------|---------|---------| | anthropic-patterns.md | 是否有新 Thinking/Tool Use 模式 | 追加新条目 | | openai-patterns.md | 是否有新 Agent 模式 | 追加新条目 | | error-taxonomy.md | 是否有新错误类型 | 新增分类 | | fix-templates.md | 是否有新修复方法 | 新增模板 | ``` Related persistent-update instructions in `SKILL.md` include: ```markdown ### 路径 2:定期知识更新(每周 Cron 任务触发) 每周自动执行一次工程实践收集: 1. **搜索最新实践**:用 SearXNG 搜索 Anthropic/OpenAI 最新工程文档 2. **对比已有内容**:与 references/ 中的内容对比 3. **提取新模式**:发现新方法时追加到对应 references/ 文件 4. **清理过时内容* ...[truncated 3101 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
references/fix-templates.md:105
Finding

Automatically permitted cleanup commands can delete persistent memory and unrelated Docker resources

Content
View full analysis
/dev/null du -sh ~/.openclaw/workspace/learnings/ 2>/dev/null ``` **修复**: ```bash # 清理超过 30 天的日志 find ~/.openclaw/workspace/memory/ -name "*.md" -mtime +30 -delete 2>/dev/null # 清理 Docker 无用资源 docker system prune -f 2>/dev/null ``` ``` The associated policy in `SKILL.md` classifies cleanup as automatic: ```markdown | 级别 | 范围 | 策略 | |------|------|------| | L0 | 读取状态、检查日志 | 自动执行 | | L1 | 清理临时文件、更新日志 | 自动执行 | | L2 | 修改 cron 配置、重启服务 | 提示用户确认 | | L3 | 修改核心配置、删除数据 | 必须用户明确授权 | ``` `TRIGGER-INTEGRATION.md` likewise places cleanup in the automatic execution scope: ```markdown ### 自动执行范围 - ✅ 读取日志和状态 - ✅ 临时文件清理 - ✅ 重试限流错误(≤3次) - ✅ 更新心跳文件 ``` ### Technical Analysis The implementation does not limit deletion to a dedicated temporary or cache directory. It recursively deletes every Markdown file older than 30 days beneath `~/.openclaw/workspace/memory/`. That directory is described elsewhere as persistent agent memory, so its contents cannot safely be treated as temporary files solely based on age and extension. The Docker command uses `docker system prune -f`, which operates daemon-wide rather than on one diagnosed component. Depending on Docker state, it can remove stopped containers, unused networks, dangling images, and build cache belonging to unrelated workloads. The `-f` option bypasses interactive confirmation. Both commands redirect standard error to `/dev/null`, reducing visibility into invalid paths, permission problems, or partial cleanup. There is no dry run, resolved-path validation, resource allowlist, backup, ...[truncated 1680 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (22)

Self-Modification

High
Category
Rogue Agent
Confidence
96% confidence
Finding

The skill explicitly defines a self-update path that can modify reference materials and SKILL metadata, enabling the agent to change artifacts that shape its future operation. Self-modification is dangerous because it can persist bad guidance, amplify prompt injection from external content, and bypass normal change-control expectations for agent behavior.

Content

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

  1. 清理过时内容:标记已过时的实践
  2. 更新版本号:在 SKILL.md 末尾记录最后更新时间和版本号

执行脚本:references/scripts/self-update.sh(如果存在)或手动执行:

bash
# 搜索 Anthropic 最新实践

External Script Fetching

High
Category
Supply Chain
Confidence
94% confidence
Finding

The skill fetches external search results and immediately processes them in a script pipeline, creating an ingestion channel from untrusted remote content into local decision-making and file updates. Even though the example parses JSON, the core issue is trust of remote content for autonomous evolution, which can be abused through poisoned search results, compromised local services, or malicious content shaping downstream updates.

Content

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

bash
# 搜索 Anthropic 最新实践
curl -s "http://localhost:3004/search?q=anthropic+agent+engineering+best+practices+tool+use+patterns+$(date +%Y)&format=json&engines=bing,duckduckgo" | python3 -c "
import json, sys
data = json.load(sys.stdin)
for r in data.get('results', [])[:5]:

External Script Fetching

High
Category
Supply Chain
Confidence
94% confidence
Finding

This second external-fetch pipeline repeats the same unsafe pattern for another query source, broadening the attack surface and normalizing unattended acceptance of outside content. In the context of a self-evolving skill, each such fetch increases the chance that manipulated results will influence persistent local references or recommendations.

Content

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

md
"

# 搜索 OpenAI 最新实践
curl -s "http://localhost:3004/search?q=openai+agent+patterns+function+calling+error+handling+best+practices+$(date +%Y)&format=json&engines=bing,duckduckgo" | python3 -c "
import json, sys
data = json.load(sys.stdin)
for r in data.get('results', [])[:5]:

Self-Modification

High
Category
Rogue Agent
Confidence
98% confidence
Finding

The file defines a cron-triggered self-update workflow for the agent optimizer, meaning the skill can autonomously revise its own knowledge sources and associated repository content. Self-modification is dangerous because it can introduce persistent prompt drift, malicious instruction injection from untrusted inputs, or silent degradation without a human validating the changes.

Content

Scanner excerpt · references/self-evolution.md (reported line 6)May include surrounding context.

md
## 触发方式

### Cron 自动触发
- 每周日 03:00 执行一次(cron 任务:agent-optimizer-self-update)
- 执行环境:isolated session, agentTurn

### 手动触发

External Script Fetching

High
Category
Supply Chain
Confidence
95% confidence
Finding

The workflow pulls external search results through a local HTTP service and directly processes the returned data in an automated update pipeline. Even though the Python snippet only parses JSON, the real danger is trust in unverified remote content that may seed prompt injection, poisoned references, or misleading 'best practices' into future self-updates.

Content

Scanner excerpt · references/self-evolution.md (reported line 18)May include surrounding context.

bash
# Anthropic 最新实践
curl -s "http://localhost:3004/search?q=anthropic+claude+agent+engineering+tool+use+patterns+best+practices&format=json&engines=bing,duckduckgo" | python3 -c "
import json, sys
data = json.load(sys.stdin)
for r in data.get('results', [])[:5]:

External Script Fetching

High
Category
Supply Chain
Confidence
95% confidence
Finding

This step repeats the same risky pattern for OpenAI-related queries: remote search data is collected automatically and used to drive updates to reference files. In the context of a self-evolving agent, untrusted search output can bias or corrupt the agent's future behavior and create a durable supply-chain style content poisoning issue.

Content

Scanner excerpt · references/self-evolution.md (reported line 26)May include surrounding context.

md
" 2>/dev/null

# OpenAI 最新实践
curl -s "http://localhost:3004/search?q=openai+agent+patterns+function+calling+structured+outputs+error+recovery&format=json&engines=bing,duckduckgo" | python3 -c "
import json, sys
data = json.load(sys.stdin)
for r in data.get('results', [])[:5]:

External Script Fetching

High
Category
Supply Chain
Confidence
95% confidence
Finding

The architecture-trends query extends the same automated external-content ingestion to broad industry topics, which further increases exposure to low-quality, speculative, or maliciously crafted material. Because the skill is specifically designed for self-healing and self-evolution, poisoned trend data could directly influence future operational decisions and persistent guidance documents.

Content

Scanner excerpt · references/self-evolution.md (reported line 34)May include surrounding context.

md
" 2>/dev/null

# 行业 Agent 架构趋势
curl -s "http://localhost:3004/search?q=llm+agent+architecture+patterns+self+healing+error+recovery+2026&format=json&engines=bing,duckduckgo" | python3 -c "
import json, sys
data = json.load(sys.stdin)
for r in data.get('results', [])[:3]:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The natural-language description and usage guidance are written entirely in Chinese and present the skill behavior in that locale without any opt-in or language-selection note. Under the policy, locale or language constraints should not be imposed unless the skill offers a choice or clearly documents a justified region-specific limitation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The 'Use when user asks to' text includes broad phrases like '系统诊断', '检查系统健康度', and '诊断失败原因', which can apply to many ordinary support conversations beyond this specific self-healing skill. Although one exclusion is provided, the trigger scope is still not narrowly bounded with explicit activation constraints or negative examples for adjacent cases.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill claims higher-risk changes need confirmation, but elsewhere authorizes automatic modification of references and SKILL version metadata as part of its self-evolution loop. That contradiction weakens operator expectations and can normalize silent self-modification, making it easier for unsafe changes to be introduced without meaningful review.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill embeds a recurring self-update workflow that performs external web searches and ingests fetched results into its local knowledge base, which expands its authority beyond troubleshooting into unattended content acquisition. This creates a supply-chain style risk: untrusted search results or manipulated local search backends can influence future behavior and cause unsafe or policy-inconsistent guidance to be written into references files.

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 · TRIGGER-INTEGRATION.md (reported line 33)May include surrounding context.

md
### 自动触发
当检测到上述问题时,小七应:
1. 读取 `skills/agent-optimizer/SKILL.md`
2. 按照诊断工作流执行
3. 输出修复建议
4. 用户确认后执行修复

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manual trigger phrases are generic operational requests such as '检查一下系统问题' and '优化一下配置', which can overlap with ordinary user intent and cause the optimizer skill to activate unexpectedly. In a self-healing/repair skill, accidental activation increases the chance of unnecessary diagnostics, exposure of internal state, or escalation toward sensitive repair actions after only loosely related prompts.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file contains all user-facing instructional content in Chinese, and there is no indication that users may choose another language or that the locale restriction is required for a region-specific purpose. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

All headings, instructions, and templates in this file are written in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-language or China-specific context. The policy requires flagging language or locale constraints when they are imposed without opt-in or clear justification.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/fix-templates.md (reported line 90)May include surrounding context.

docker ps --filter "status=exited"

检查端口

curl -s http://localhost:3002/health # Firecrawl curl -s http://localhost:3004/health # SearXNG curl -s http://localhost:3003/health # Crawl4AI

text

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The template includes destructive cleanup commands such as deleting old files and running docker system prune -f without any explicit warning, confirmation step, or scope limitation. In a self-healing/auto-repair skill, an agent may execute these commands automatically, causing unintended data loss, removal of needed Docker artifacts, or disruption of dependent services.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The entire skill file is written in Chinese and specifies fixed Chinese output text, but it does not indicate that language selection is optional or limited to a Chinese-only context. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The workflow explicitly instructs the agent to modify reference files and append to SKILL.md, but it does not require explicit user confirmation, review gates, or warning that repository content will be changed. In a self-healing/self-evolving agent, unattended content modification increases the risk of unauthorized or low-quality changes being committed into trusted instructions and documentation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file title and all instructional content are written exclusively in Chinese, with no indication that language selection is optional or that the document is intentionally region-specific. Under the stated policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The service restart instructions present docker compose up -d as a repair action without warning about operational impact such as brief downtime, container recreation, or interruption of active jobs. Because this skill is intended for autonomous diagnosis and repair, omission of these cautions increases the chance of unintended service disruption.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The gateway restart command can temporarily disrupt the agent platform, active sessions, or scheduled execution, yet the template provides no user-facing warning or gating. In an optimizer/self-healing skill, such undocumented disruption can be triggered reflexively and surprise operators.

Content

No source excerpt is available for this finding.