Back to skill

Security audit

Auto Improving Agent

Security checks for vulnerabilities and agentic risk

Overview

The skill is openly about persistent self-improvement notes, but it allows automatic repository writes, heuristic deletion, and promotion toward agent-behavior files without clear approval gates.

Install only if you want an agent to maintain persistent project learning notes. Use `--dry-run` for retention scoring first, review all proposed writes, and require explicit confirmation before deleting entries or promoting anything into `SOUL.md`, `AGENTS.md`, or `TOOLS.md`. Treat user messages and memory-search results as untrusted until reviewed.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T02 · Agent Memory Poisoning

Error
Location
SKILL.md:71
Finding
Untrusted Content Can Be Persisted and Promoted into Long-Term Agent Behavior<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:71-88` **Supporting Locations**: `hooks/openclaw/handler.js:8-25, 46-52`; `hooks/openclaw/handler.ts:9-26, 53-59` **Vulnerability Type**: Persistent agent memory poisoning **Risk Level**: High ### Vulnerable Code `SKILL.md:71-88`: ```markdown ## Automated triggers These fire without user prompting: 1. **Post-task scan**: After multi-step tasks, check for retried commands, error→workaround sequences, or avoidable file reads. If found, evaluate against write gate and log if it passes. 2. **Session-start sweep**: On `.learnings/LEARNINGS.md` read, flag entries >90 days old for retention scoring. 3. **Promotion detector**: After logging, scan for entries with the same `[Category]` tag appearing 3+ times. If found, auto-suggest a one-liner promotion to: - behavior/style → `SOUL.md` - workflow/process → `AGENTS.md` - tool/env gotcha → `TOOLS.md` 4. **Cross-session pattern detection**: When `memory_search` returns a daily note describing a workaround, check if `.learnings/` already has it. If not and it passes the write gate, log it. ``` `hooks/openclaw/handler.js:8-25, 46-52`: ```javascript const REMINDER_CONTENT = ` ## Self-Improvement Reminder 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 proven:** - Behavioral patterns → \`SOUL.md\` - Workflow improvements → \`AGENTS.md\` - Tool gotchas → \`TOOLS.md\` Keep entries simple: date, title, what happened, what to do differently. `.trim(); // Inject the reminder as a virtual bootstrap file // Check that bootstrapFiles is an array before pushing if (Array.isArray(event.contex ...[truncated 3206 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Require explicit approval before persistence** - Present the proposed learning verbatim to a trusted user. - Do not write it until the user explicitly approves the exact text and destination. - Require a separate confirmation before promotion into `SOUL.md`, `AGENTS.md`, or `TOOLS.md`. 2. **Store structured facts instead of free-form instructions** - Use fields such as source, timestamp, project scope, confidence, expiration, and evidence. - Separate descriptive observations from recommended actions. - Prevent learning entries from containing role changes, policy overrides, or imperatives directed at the agent. 3. **Add instruction-safety validation** - Reject entries that request credential access, secret disclosure, external communication, command execution, permission changes, disabling safeguards, or modification of agent policy. - Treat user messages and `memory_search` results as untrusted data regardless of recurrence. 4. **Track provenance and trust boundaries** - Record the originating session, user identity or trust level, and source message. - Do not allow low-trust or unknown sources to influence global behavior files. - Scope project-specific observations to the relevant project rather than global memory. 5. **Remove recurrence as proof of trust** - Repetition should not make a claim eligible for behavioral promotion. - Require independent verification against trusted documentation, configuration, or code. - Detect near-duplicate submissions intended to manipulate the recurrence threshold. 6. **Constrain promotion** - Generate review-only proposals in a quarantine file rather than modifying behavior files. - Validate promotions against an allowlist of harmless categories. - Preserve an audit trail and provide a straightforward rollback mechanism. 7. **Reduce bootstrap reinforcement** - Update the injected reminder to state that all conversational and m ...[truncated 137 chars]
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The declared purpose emphasizes learning capture and promotion, but the documented retention policy also allows deletion of entries, which is a materially different and more destructive behavior. Omitting destructive behavior from the high-level contract can mislead users into enabling a skill that silently removes historical data.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The declared purpose emphasizes learning capture and promotion, but the documented retention policy also allows deletion of entries, which is a materially different and more destructive behavior. Omitting destructive behavior from the high-level contract can mislead users into enabling a skill that silently removes historical data.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The declared purpose emphasizes learning capture and promotion, but the documented retention policy also allows deletion of entries, which is a materially different and more destructive behavior. Omitting destructive behavior from the high-level contract can mislead users into enabling a skill that silently removes historical data.

Missing User Warnings

High
Confidence
96% confidence
Finding
The skill description markets automatic capture and promotion but does not prominently warn that it may write, archive, or delete entries in `.learnings/` files. Missing user-facing disclosure around persistent and destructive actions undermines informed consent and can cause loss of data or silent repository modifications in normal usage.

Missing User Warnings

High
Confidence
97% confidence
Finding
The retention policy explicitly permits deletion of stored entries based on heuristic scores, yet there is no explicit user-facing warning or approval gate for permanent removal. Heuristic deletion is dangerous because scoring mistakes or stale context can erase useful operational history and make the loss hard to detect later.

Lp3

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding
The skill describes behavior that reads and writes project files, including `.learnings/` and documentation targets, but does not declare an explicit tool scope or permissions boundary. That makes the write capability implicit and harder for users or a runtime policy layer to review, increasing the chance of unintended persistence or modification of repository files.

Vague Triggers

Medium
Confidence
89% confidence
Finding
The skill is designed to fire automatically based on broad conditions like corrections, failures, and discoveries, which are common in ordinary sessions. Ambiguous activation criteria can cause the skill to run unexpectedly, leading to unreviewed persistence, context drift, or writes to repo files without a clear user action.

Vague Triggers

Medium
Confidence
91% confidence
Finding
The 'Automated triggers' section authorizes unprompted actions such as post-task scans, session-start sweeps, promotion suggestions, and cross-session pattern handling. Because these triggers are not tightly bounded and can operate across sessions, they increase the risk of surprising behavior, privacy leakage from prior notes, and unauthorized file modifications.

Static analysis

No suspicious patterns detected.