T02 · Agent Memory Poisoning
- Location
scripts/auto_retrieve.py:208- Finding
Persistent Prompt Injection Through Untrusted Memory Retrieval
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a real persistent-memory skill, but it makes broad, lasting OpenClaw memory and configuration changes that can retain sensitive workspace and session information without tight opt-in controls.
Install only if you intentionally want a durable local memory system that can index session history and sensitive workspace files. Review the setup scripts first, prefer dry-run/manual configuration, remove extraPaths you do not want indexed, avoid storing secrets or private contact/infrastructure details, and plan how to delete the vector database, graph, heartbeat state, and OpenClaw config changes later.
scripts/auto_retrieve.py:208Persistent Prompt Injection Through Untrusted Memory Retrieval
scripts/configure_openclaw.py:53Overly Broad Global Indexing of Sensitive Agent and Session Data
scripts/setup.sh:27Dependency Installation and Model Retrieval Without Integrity Verification
The skill markets itself as a general persistent-memory system, but the content shows it also changes OpenClaw configuration, restarts services, and broadens indexing of directive and workspace files. That mismatch is dangerous because users may approve it for benign memory features without realizing it performs privileged configuration changes with behavioral impact on the agent runtime.
The skill markets itself as a general persistent-memory system, but the content shows it also changes OpenClaw configuration, restarts services, and broadens indexing of directive and workspace files. That mismatch is dangerous because users may approve it for benign memory features without realizing it performs privileged configuration changes with behavioral impact on the agent runtime.
The instructions explicitly encourage recording raw daily logs and maintaining institutional knowledge including contacts, communication details, and other operational data. Storing such information in persistent markdown, vector indexes, and graphs without minimization or access controls materially increases privacy, confidentiality, and targeting risks.
The recommended reference directory includes highly sensitive categories such as people/contact details, infrastructure hosts/IPs/ports, and business strategies for long-term agent recall. Aggregating these into durable searchable memory makes reconnaissance and misuse easier for any actor or component that gains access to the workspace or memory indexes.
The skill explicitly instructs users to run shell commands, create files, and modify workspace/OpenClaw configuration, but it declares no tool scope or permission boundaries. This is dangerous because consumers cannot tell up front that the skill needs file read/write and shell access, increasing the chance of over-privileged execution and unsafe adoption.
The activation condition says to use the skill whenever the agent needs to remember decisions, facts, context, or institutional knowledge between sessions, which is extremely broad. Broad triggers increase the likelihood of indiscriminate persistence and indexing of sensitive data far beyond what is necessary for a given task.
The skill promotes long-term retention across sessions and broad indexing of workspace information without data minimization, retention limits, or sensitivity controls. In context, this can centralize secrets-adjacent operational data, personal details, and internal directives into searchable stores, increasing exposure and blast radius if accessed or exfiltrated.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
Add these to AGENTS.md or SOUL.md:
### Pre-Response (mandatory)
Before answering questions about prior work, decisions, dates, people, or preferences — search memory first. Use `memory_search` or run `auto_retrieve.py` with the query. Never say "I don't remember" without checking.
**CRITICAL:** OpenClaw's built-in memory search should now automatically find directive files (SOUL.md, AGENTS.md) if `configure_openclaw.py` was run. If memory searches are not finding agent rules or workspace directives, the OpenClaw integration is missing or broken.
The script is explicitly designed to retrieve memory content and format it for system prompt injection before a response, without any user disclosure or consent mechanism. In this skill context, that means prior stored data, potentially including sensitive or user-unexpected context, can silently influence model behavior and leak into responses, making the lack of transparency a real security and privacy issue.
The script is explicitly designed to establish persistent cross-session behavior by modifying OpenClaw configuration, which creates durable recall and indexing of selected files. In a persistent-memory skill, that persistence is expected, but it still carries security risk because it can silently broaden long-term data collection and retention beyond a single session.
Requirements:
- OpenClaw 2026.2.17 or later
- Write access to OpenClaw configuration
Author: Jakebot (2026-02-19)
Issue: Missing OpenClaw memorySearch configuration causes directive violations
The script writes directly to a user configuration file and creates backups without an interactive confirmation step, which can cause unintended persistent changes to agent behavior. In this skill context, those changes alter what files OpenClaw indexes across sessions, so accidental execution can create lasting privacy and operational consequences.
The script's capability extends beyond passive memory management into controlling an external application by restarting OpenClaw and querying its active configuration. In a skill context, that broader authority increases the blast radius: running the skill can change agent runtime behavior and disrupt current sessions, which is more dangerous than simple data persistence.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def restart_openclaw():
"""Restart OpenClaw to apply configuration changes."""
try:
result = subprocess.run(['openclaw', 'gateway', 'restart'],
capture_output=True, text=True, timeout=30)
if result.returncode == 0:
Automatically restarting OpenClaw without explicit user confirmation is a potentially disruptive action that can interrupt active work and immediately apply persistent configuration changes. In an agent-skill environment, hidden or automatic service restarts materially increase risk because the user may not expect the skill to control external processes.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"""Verify the configuration was applied correctly."""
try:
# Use OpenClaw CLI to check configuration
result = subprocess.run(['openclaw', 'config', 'get'],
capture_output=True, text=True, timeout=10)
if result.returncode == 0:
This script intentionally creates a persistent memory store and later performs indexing, enabling retention of information across sessions. In the context of an agent skill, session persistence increases the risk that sensitive prompts, prior conversations, workspace data, or user-specific facts are stored longer than expected and later retrieved in unrelated contexts.
echo " Memory dir: $MEMORY_DIR"
echo ""
# Step 1: Create memory system
echo "📁 Setting up 3-layer memory system..."
mkdir -p "$MEMORY_DIR"
The setup script edits the user's global OpenClaw configuration under ~/.openclaw rather than limiting changes to the local workspace. Even though this appears intended to simplify installation, modifying global agent behavior can silently broaden persistence and data collection across unrelated projects and sessions, creating an unexpected security and privacy boundary crossing.
The script automatically rewrites the OpenClaw config file if found, with no confirmation prompt, no dry-run, and no meaningful consent gate. Silent configuration changes are dangerous because users may not realize agent search, session syncing, and file watching have been enabled globally, increasing the chance of unintended persistence or disclosure.
The installer enables memorySearch with watch/onSearch/onSessionStart sync and adds extraPaths such as AGENTS.md, IDENTITY.md, USER.md, TOOLS.md, and reference/. This causes automatic monitoring and indexing of files beyond the core memory directory, which may capture sensitive workspace directives, identity data, or operational context without clear scoping or consent.
The document states the selected embedding model provides 'Good semantic similarity for English text,' which encodes an English-specific language assumption in the skill's natural-language behavior. Because the file does not mention user choice, multilingual limitations, or a justified region-specific scope, this may conflict with language/locale policy expectations.
The code updates a local heartbeat-state.json file automatically during status checks, without notifying the user that local state is being modified. While this is lower severity than hidden prompt injection, silent file writes still create integrity and transparency concerns, especially in an infrastructure-level memory system that persists across sessions.
The module documentation states that the script adds the missing configuration and makes memory coverage comprehensive. In practice, when memorySearch already exists, the code only merges missing extraPaths and does not reconcile other fields such as provider, sync, chunking, enabled, or sources, so the implementation does not match that stronger claim.
This shell script creates directories, copies files, creates a virtual environment, installs packages via pip, and writes a .gitignore file into the user's workspace. Although it prints progress messages, those messages do not clearly warn the user ahead of time that the script will modify local files and perform network-backed dependency installation.
No suspicious patterns detected.