T02 Β· Agent Memory Poisoning
- Location
SKILL.md:282- Finding
Untrusted Learnings Can Be Promoted into Persistent Agent Instructions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a real self-improvement logger, but it needs Review because it can persist conversation-derived learnings into future agent instruction files and broad hooks.
Install only if you want a persistent agent-learning workflow. Keep .learnings project-local, avoid global hooks and empty matchers, do not enable error-output hooks unless command output may be inspected, and require a human-reviewed diff before writing anything into CLAUDE.md, AGENTS.md, SOUL.md, TOOLS.md, or Copilot instructions.
SKILL.md:282Untrusted Learnings Can Be Promoted into Persistent Agent Instructions
SKILL.md:49Installation Instructions Use Mutable and Unverified Upstream Sources
The declared description is about recording learnings and corrections after failures or user feedback, implying a memory/logging or review function for continuous improvement. The supplied code instead implements a command-line scaffold generator that creates a new skill folder and template markdown file. While the template mentions extraction from a learning entry, the script does not actually capture learnings, parse learning entries, review past learnings, or handle the listed triggers. Its primary purpose is materially different from the declared purpose, so this is a clear mismatch.
Directing users to modify ~/.claude/settings.json introduces agent configuration persistence at the user level, affecting all projects and sessions for that account. Because the setting installs command hooks, compromise, misuse, or simple misconfiguration can create a durable execution path that is harder to notice and remove than project-local changes.
Add to ~/.claude/settings.json for global activation:
{
Instructions found that direct the agent to transmit conversation context or user data to external services.
Send message to another session:
sessions_send(sessionKey="session-id", message="Learning: API requires X-Custom-Header")
The description says to use the skill whenever a user corrects the agent or requests a missing capability, and includes very common phrases like 'Actually...' as examples. These are broad conversational patterns that can occur in many contexts, increasing the chance of unintended invocation without clearer scope limits or exclusions.
The skill instructs creation and use of persistent files under a user home/workspace path, enabling cross-session retention of errors, learnings, and feature requests. Persistent storage is contextually risky for an agent skill because it can accumulate sensitive operational details over time and later expose them to other sessions, tools, or users sharing the environment.
βββ FEATURE_REQUESTS.md
### Create Learning Files
```bash
mkdir -p ~/.openclaw/workspace/.learnings
The automatic detection rules use vague conversational phrases like corrections and capability requests as triggers for persistent logging. In a real agent environment, this can capture routine user messages into durable storage without clear consent, creating privacy risk and possible retention of sensitive business context even if the skill says not to log secrets.
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.
When the above learning is extracted as a skill, it becomes:
File: skills/docker-m1-fixes/SKILL.md
---
Creating .claude/settings.json in the project root establishes persistent agent behavior for that repository, which can survive across sessions and affect future users or contributors if checked in or reused. In the context of auto-learning hooks, this persistence increases the chance that reminders or data-processing behavior continues beyond the original debugging need.
Create .claude/settings.json in your project root:
{
An empty matcher on UserPromptSubmit causes the hook to fire for every prompt, greatly broadening exposure to all session content and increasing the chance of unnecessary data handling or prompt-context manipulation. In a self-improvement skill, this is especially sensitive because the hook is designed to capture learnings from user interactions and may process broadly scoped conversational content.
The user-level configuration installs the hook in ~/.claude/settings.json, making it persist across projects and sessions while still using an unconstrained matcher. This expands the blast radius from one repository to all future interactions, including unrelated or sensitive work, and can silently process prompts in contexts where the user did not intend the skill to run.
The 'minimal setup' reduces overhead but still configures an empty matcher, so the hook runs on every prompt. This preserves the core over-collection and broad-trigger risk while making it appear safer simply because fewer hooks are enabled.
The Codex example repeats the same empty-matcher pattern without any scope limitation, enabling the hook for all prompts in that environment. Reproducing insecure defaults across multiple agent platforms increases the chance of widespread accidental deployment and normalizes unsafe configuration patterns.
The guide claims the scripts 'only output text' and 'don't modify files or run commands', but the configuration explicitly executes shell scripts via command hooks. This creates a misleading security model: users may trust and enable hooks without understanding that arbitrary shell code will run with the agent's privileges.
The guidance instructs persistent storage of learnings in workspace or skill directories, creating a durable memory channel that can retain sensitive prompts, errors, operational details, or user data across sessions. In a prompt-injection-prone environment that already injects workspace files at session start, persistent notes can become a contamination vector, allowing accidental propagation of untrusted or sensitive content into future sessions.
openclaw hooks enable self-improvement
### 3. Create Learning Files
Create the `.learnings/` directory in your workspace:
The 'Detection Triggers' section lists very broad conditions such as 'Knowledge gaps', 'API errors', and user corrections like 'No, that's wrong...' without clear scope boundaries or exclusion conditions. In a markdown integration guide, these vague triggers can overlap with common session behavior and make it unclear when the skill should activate versus when it should not.
The manifest describes a skill focused on recording and reviewing learnings for continuous improvement. This script instead creates new skill directories and writes SKILL.md template files, which is a repository scaffolding capability rather than capturing or reviewing learnings themselves.
Creating directories and authoring new markdown skill manifests is a general code/content generation capability. For a skill whose stated purpose is to capture learnings, errors, and corrections, this write-heavy scaffolding behavior is not an obvious or necessary requirement from the manifest alone.
The changelog text on L7 is written entirely in Chinese, which can indicate a language-specific constraint in the skill metadata without any visible opt-in, alternative language, or justification for a region-specific audience. Under the stated policy, forcing a specific language without user choice can be a natural-language policy violation.