T02 · Agent Memory Poisoning
- Location
SKILL.md:21- Finding
Conversation-Derived Content Can Poison Persistent Agent Instructions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is mostly a disclosed self-improvement logger, but it can persist conversation-derived content into future agent memory and instruction files without strong consent, redaction, or review controls.
Install only if you want an agent to keep persistent self-improvement notes. Keep .learnings local and out of git, review every entry before saving, redact secrets and personal data, and do not promote entries into CLAUDE.md, AGENTS.md, SOUL.md, TOOLS.md, or Copilot instructions without human review. Avoid global hooks or empty matchers unless you are comfortable with reminders on every prompt.
SKILL.md:21Conversation-Derived Content Can Poison Persistent Agent Instructions
SKILL.md:34Installation Instructions Retrieve Mutable Unpinned Code from an External Repository
scripts/error-detector.sh:8Error-Learning Workflow Can Persist Secrets from Command Output
The declared description is about recording and reviewing learnings from failures, corrections, outdated knowledge, and improved approaches. The supplied code does not implement that behavior. Instead, it is a command-line helper that generates a new skill scaffold on disk from a learning entry template. While it references learnings conceptually and mentions updating the original learning entry, its primary function is skill extraction/scaffolding, not capturing continuous-improvement learnings. This is a material purpose mismatch, with undeclared file-creation behavior and unrelated triggers compared to the declared description.
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.
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 encourages activation from broad, ordinary situations like failures, corrections, and major tasks, which can cause the agent to invoke logging behavior far more often than intended. In this skill's context, over-activation matters because invocation may lead to persistent recording of user content and operational details, increasing privacy and data-retention risk.
The skill directs creation of persistent files under a home-directory workspace, establishing session-to-session retention of operational and conversational artifacts. Persistence alone is not always unsafe, but in this context it materially increases the blast radius of the other logging behaviors by making retained data durable and potentially accessible to future sessions, tools, or users on the system.
└── FEATURE_REQUESTS.md
### Create Learning Files
```bash
mkdir -p ~/.openclaw/workspace/.learnings
These instructions explicitly support sharing learnings across sessions using transcript-reading and cross-session messaging tools. In a self-improvement skill, that creates a real risk that user-provided content, mistakes, requests, or sensitive context will propagate beyond the originating session, violating least-privilege and data-minimization expectations.
The logging templates call for storing full context, user feedback, parameters, environment details, and related files without any sensitivity filter. That design can persist secrets, personal data, internal paths, credentials, or proprietary prompts into markdown files that may later be indexed, committed, or shared, turning transient input into long-lived exposure.
The automatic detection triggers rely on generic phrases like corrections, feature wishes, and requests for alternatives that commonly appear in normal conversation. Because those triggers instruct the agent to create persistent entries, everyday user speech can be transformed into durable memory without clear consent, making accidental retention likely.
The automatic triggers instruct the agent to log user corrections, new information, and error situations directly into persistent memory. In practice, this means the skill can capture user-provided content opportunistically and store it long-term without consent gating, which is especially risky because the trigger phrases are broad and common.
The description is overly broad and does not define firm activation boundaries, which can cause the skill to trigger in many routine failure, correction, or planning contexts. In a self-improvement skill, that ambiguity is more dangerous because it can encourage persistent collection or reuse of error-related context beyond what is necessary, increasing the chance of unintended behavior or unsafe autonomy.
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
---
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.
Create .claude/settings.json in your project root:
{
This markdown file defines the hook trigger with an empty matcher, which effectively applies the hook to all UserPromptSubmit events. That is broader than common users may expect and lacks clear constraints or exclusion conditions, increasing the chance of unintended invocation.
The guide instructs users to add a global hook configuration and again uses an empty matcher for UserPromptSubmit. This combination makes the skill activate across all prompts in all contexts, but the documentation does not clearly bound where it should or should not apply.
This setup mirrors the broad Claude Code configuration and applies the hook to every prompt submitted in Codex. The guide does not provide explicit constraints, exclusions, or a recommended narrow default, so activation remains ambiguous and overly broad.
The setup explicitly creates persistent storage for learnings, which can accumulate sensitive operational data over time. Because this is a self-improvement skill designed to capture failures, corrections, and tool behavior, the persistence mechanism materially increases the risk of retaining confidential content beyond the immediate session.
openclaw hooks enable self-improvement
### 3. Create Learning Files
Create the `.learnings/` directory in your workspace:
The guide instructs users to create persistent learning directories in the workspace or skill directory without warning that conversation-derived data may be stored long-term. In a self-improvement skill, this increases the chance that sensitive prompts, errors, credentials, or user corrections are retained on disk unexpectedly and later exposed to other tools, sessions, or users.
The document advertises cross-session history access and messaging features without any privacy or authorization warning. In this skill context, learnings may include sensitive operational context, so normalizing transcript access and inter-session sharing can enable unintended disclosure across agent sessions or operators.
The "Detection Triggers" section lists generic conditions like user corrections, API errors, and knowledge gaps without defining thresholds or exclusions. In a markdown skill/integration guide, this can cause unintended or inconsistent invocation because ordinary conversation and routine failures may match these triggers.
Although presented as a lighter-weight setup, the example still triggers on every UserPromptSubmit because the matcher is empty. The documentation does not clarify limits, exclusions, or safer default patterns, so users may unintentionally enable broader activation than intended.
No suspicious patterns detected.