T02 · Agent Memory Poisoning
- Location
SKILL.md:17- Finding
Conversation-Derived Learnings Can Poison Persistent Agent Instructions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a disclosed self-improvement logger, but it encourages persistent agent-memory changes, broad hooks, and cross-session reuse without enough consent or redaction guidance.
Install only if you intentionally want persistent learning files and possible changes to future agent instructions. Keep .learnings local or gitignored unless reviewed, redact secrets and private data before logging, avoid user-level hooks, use narrow hook matchers, and require human approval before promoting any learning into CLAUDE.md, AGENTS.md, SOUL.md, TOOLS.md, or copilot-instructions.md.
SKILL.md:17Conversation-Derived Learnings Can Poison Persistent Agent Instructions
SKILL.md:153Error Logging Guidance Can Persist Credentials and Sensitive Tool Output
The declared description describes a memory/learning capture feature for recording errors, corrections, failures, and improved approaches. The supplied code does not implement learning capture, review, or continuous-improvement logic. Instead, it is a command-line helper that creates a new skill scaffold on disk from a skill name, including a templated SKILL.md file. This is a materially different primary purpose and includes undeclared file-creation behavior. While the template mentions that the skill was extracted from a learning entry, the script itself does not parse, store, or analyze learnings; it only scaffolds files. Therefore the description does not accurately represent the code's actual behavior.
Instructing users to modify ~/.claude/settings.json establishes persistence in the agent’s configuration directory, which is a sensitive trust boundary. If a malicious or later-compromised script path is referenced there, it will be automatically invoked in future sessions, making this significantly more dangerous than a one-off project setting.
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 skill repeatedly instructs the agent to persist user corrections, requests, and contextual details to markdown files, but it provides no warning or filtering guidance for secrets, personal data, tokens, or confidential business information. In practice, this can cause sensitive user input to be stored locally or in-repo in plain text and later exposed through commits, backups, indexing, or other agents reading those files.
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.
└── FEATURE_REQUESTS.md
### Create Learning Files
```bash
mkdir -p ~/.openclaw/workspace/.learnings
The inter-session features encourage viewing transcript history and sending learnings between sessions without any user-facing consent, access-control, or data-minimization warning. That creates a clear pathway for conversation contents to be reused or disclosed across contexts where users may not expect their prompts, outputs, or embedded secrets to travel.
Cross-session transcript reading and message passing increase the blast radius of any sensitive information already present in a session by normalizing reuse across agents or conversations. Even if intended for productivity, this can expose conversation content beyond its original scope and undermine user expectations of compartmentalization.
The logging instructions explicitly encourage storing 'full context' and source details, which often includes raw prompts, errors, filenames, environment details, and user-provided content. Without redaction guidance, this creates durable plain-text records of potentially sensitive information that may later be searched, synced, or committed.
Feature request logging asks the agent to persist what the user wanted and why they needed it, which can capture business goals, internal workflows, unmet security needs, or sensitive project plans. Storing this material in plain markdown without safeguards increases the risk of privacy leakage and operational intelligence exposure.
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
---
Project-level hook setup introduces session-persistent automated behavior that continues across future agent interactions in that repository. While persistence is part of the feature, it is still security-relevant because it changes future execution context and can silently keep invoking local shell scripts after the initial setup is forgotten.
Create .claude/settings.json in your project root:
{
An empty matcher causes the UserPromptSubmit hook to trigger on every prompt, creating very broad automatic execution scope. In a skill that installs shell-command hooks, this increases the chance of unnecessary context injection, privacy exposure, or abuse if the hooked script is modified or replaced.
The user-level configuration installs the hook in ~/.claude/settings.json, causing broad persistent activation across repositories and sessions without meaningful constraints. This amplifies the blast radius of any bug, script tampering, or unintended data capture because the command hook runs in many more contexts than necessary.
The repeated empty matcher in the minimal setup example normalizes unconstrained triggering and makes insecure broad scope appear standard. Because this skill is about continuous self-improvement and reminders, users may enable it reflexively, leading to persistent automatic command execution on unrelated prompts.
The document’s security section materially understates execution risk by claiming the scripts only output text and do not run commands, while the hooks are explicitly configured as command hooks and one referenced script can create scaffolding. Misleading security claims can cause users to grant trust and install persistent hook execution without understanding the actual capability and privilege level of those scripts.
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.
openclaw hooks enable self-improvement
### 3. Create Learning Files
Create the `.learnings/` directory in your workspace:
The document promotes cross-session transcript access and messaging without any privacy, consent, or data-handling guidance. In an agent environment, normalizing unrestricted reading and forwarding of session history can lead to inadvertent disclosure of sensitive prompts, secrets, or user data across sessions.
This markdown file includes filesystem-changing setup commands such as copying skill and hook directories and creating .learnings/ directories. Because the document does not disclose that these steps alter local OpenClaw configuration and create persistent storage for learned content, users are not explicitly warned about system and data persistence effects.
No suspicious patterns detected.