Back to skill

Security audit

Self Improving Agent.Bak

Security checks for vulnerabilities and agentic risk

Overview

The skill is not malicious, but it teaches agents to store conversation-derived lessons persistently and promote them into future agent instruction files without enough safeguards.

Install only if you want persistent agent memory. Before enabling global hooks or promoting entries, require human review, redact secrets and user data, keep promoted files version-controlled, and avoid copying raw conversation text into agent instruction files.

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

Warning
Location
SKILL.md:28
Finding

Untrusted Conversation-Derived Rules Can Be Promoted into Persistent Agent Control Files

Content
View full analysis
= 3` + seen in 2+ tasks + within 30 days ``` `hooks/openclaw/handler.js:10-25` reinforces this workflow through bootstrap context: ```javascript After completing tasks, evaluate if any learnings should be captured: **Log when:** - User corrects you → \`.learnings/LEARNINGS.md\` - Command/operation fails → \`.learnings/ERRORS.md\` - User wants missing capability → \`.learnings/FEATURE_REQUESTS.md\` - You discover your knowledge was wrong → \`.learnings/LEARNINGS.md\` - You find a better approach → \`.learnings/LEARNINGS.md\` **Promote when pattern is pr ...[truncated 3019 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/extract-skill.sh:106
Finding

Output Directory Restriction Can Be Bypassed Through a Symlinked Parent

Content
View full analysis
"$SKILL_PATH/SKILL.md" << TEMPLATE ``` ### Technical Analysis The script intends to confine output beneath the current workspace. It rejects absolute paths and path components named `..`, but it does not resolve the canonical filesystem destination or reject symbolic-link components. A path such as `./redirect`, where `redirect` is a symbolic link to an external directory, passes both validation checks: - It is not lexically absolute. - It contains no `..` segment. Both `mkdir -p` and shell redirection follow symbolic links. Consequently, the generated Skill directory and `SKILL.md` can be created outside the workspace despite the stated restriction. The existing-directory check reduces simple overwrite scenarios because the script exits if the final Skill directory already exists ...[truncated 1608 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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 Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description is about recording and reviewing learnings for continuous improvement after failures, corrections, or newly discovered approaches. The supplied code does not capture, store, review, or update learnings entries. Instead, it is a helper utility for extracting/promoting a learning into a new skill by scaffolding a directory and markdown file on disk. This is a materially different primary purpose and includes undeclared filesystem creation/writing behavior. While it references learnings conceptually, its actual function is skill generation, not learning capture or review.

Content

No source excerpt is available for this finding.

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · references/hooks-setup.md (reported line 48)May include surrounding context.

Option 2: User-Level Configuration

Add to ~/.claude/settings.json for global activation:

json
{

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

Scanner excerpt · references/openclaw-integration.md (reported line 177)May include surrounding context.

sessions_send

Send message to another session:

text
sessions_send(sessionKey="session-id", message="Learning: API requires X-Custom-Header")

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest description says to use the skill whenever a command fails, the user corrects the agent, a better approach is found, or before major tasks. These conditions are very broad and lack clear boundaries or exclusion conditions, which could cause the skill to activate in routine conversations or many normal workflows.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The phrase 'Also review learnings before major tasks' does not define what counts as a major task or when review is required. Without concrete criteria, the trigger is subjective and may lead to inconsistent or unintended invocation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs the agent to log and promote learnings into persistent workspace files without any guardrails for secrets, personal data, credentials, or sensitive project details. That can lead to long-lived storage and wider propagation of confidential information from transient conversations or tool output into files like SOUL.md, AGENTS.md, TOOLS.md, and CLAUDE.md.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
91% confidence
Finding

The skill creates and uses a persistent directory under ~/.openclaw/workspace/.learnings, causing session data, errors, and user corrections to survive beyond the current interaction. Persistent local storage increases the chance that sensitive information, internal project details, or prior-user context could be retained and later exposed to other tasks, users, or agents with access to the same environment.

Content

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

Setup

bash
mkdir -p ~/.openclaw/workspace/.learnings

Create three log files: LEARNINGS.md · ERRORS.md · FEATURE_REQUESTS.md

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 · references/examples.md (reported line 301)May include surrounding context.

When the above learning is extracted as a skill, it becomes:

File: skills/docker-m1-fixes/SKILL.md

markdown
---

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 · references/hooks-setup.md (reported line 15)May include surrounding context.

Option 1: Project-Level Configuration

Create .claude/settings.json in your project root:

json
{

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The matcher field is empty for UserPromptSubmit, which means the hook will fire for any submitted prompt rather than a clearly delimited class of prompts. In a markdown setup guide, this is an ambiguous and overly broad activation condition that can lead to unintended invocation across normal everyday use.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The user-level configuration installs the hook globally in ~/.claude/settings.json and uses an empty matcher, causing the script to run for every prompt across all repositories and contexts. That expands the blast radius of any future compromise, unexpected script behavior, or prompt-surface abuse well beyond a single project.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Although presented as a lower-overhead option, the minimal setup still activates on every UserPromptSubmit because the matcher is blank. The guide does not clarify exclusions or provide constraints, so the trigger remains overly broad.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The Codex example repeats the same unconstrained UserPromptSubmit configuration with an empty matcher. In documentation, this is a vague trigger because it does not specify when the hook should or should not activate.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

The instructions create a persistent .learnings directory specifically for storing operational learnings, but they do not define any boundaries on what may be written there or how long it should be retained. In a self-improvement skill, this persistence is especially risky because failures, corrections, and missing capabilities often contain sensitive prompts, system details, API errors, or user data that may later be re-injected or reviewed.

Content

Scanner excerpt · references/openclaw-integration.md (reported line 57)May include surrounding context.

openclaw hooks enable self-improvement

text

### 3. Create Learning Files

Create the `.learnings/` directory in your workspace:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document instructs persistent storage of 'learnings' and promotion of them into workspace-wide prompt files without any guidance to avoid secrets, personal data, or sensitive session content. In a system that injects these files into future sessions, this can unintentionally retain and re-expose confidential data across time and tasks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The cross-session features are documented as normal workflows, including reading transcripts and sending messages, but there is no warning that these actions can propagate sensitive context between sessions or expose data from one task to another. Because the surrounding platform uses injected workspace context, this increases the chance of over-sharing secrets, internal code details, or user data beyond the original session boundary.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This markdown template asks authors to 'Include trigger conditions' but does not require those triggers to be narrow, domain-specific, or accompanied by exclusion criteria. Because this file is a reusable template for skill descriptions, the lack of specificity guidance can lead downstream skills to use vague activation language that causes unintended invocation.

Content

No source excerpt is available for this finding.