Back to skill

Security audit

Persistent Memory

Security checks for vulnerabilities and agentic risk

Overview

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.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T02 · Agent Memory Poisoning

Error
Location
scripts/auto_retrieve.py:208
Finding
Persistent Prompt Injection Through Untrusted Memory Retrieval<![CDATA[ ## Vulnerability Details **File Location**: `scripts/indexer.py:25-28`, `scripts/auto_retrieve.py:208-250`, `scripts/unified_setup.sh:78-87`, `SKILL.md:80-100` **Vulnerability Type**: Persistent memory poisoning and prompt injection **Risk Level**: High ### Vulnerable Code `scripts/indexer.py:25-28`: ```python with open(file_path, 'r', encoding='utf-8') as f: content = f.read() ``` `scripts/auto_retrieve.py:208-250`: ```python def auto_retrieve(query_text, n_results=5): """ Main entry point: auto-retrieve memory context for a query. Returns formatted markdown ready for system prompt injection. """ vector = query_chromadb(query_text, n_results) graph = query_graph(query_text) sync = get_sync_status() lines = [] lines.append("## 🧠 Auto-Retrieved Memory Context") lines.append(f"**Query:** {query_text}") lines.append(f"**Sync Status:** {sync['status']} | MEMORY.md hash: {sync.get('memoryMdHash', '?')} | Last sync: {sync.get('lastSync', 'never')}") lines.append("") # Vector results lines.append(f"### Vector Search (ChromaDB — {vector.get('count', '?')} chunks indexed)") if vector.get("error"): lines.append(f"⚠️ Error: {vector['error']}") elif vector["results"]: for r in vector["results"]: lines.append(f"- **[{r['section']}]** {r['relevance']}") lines.append(f" {r['snippet']}") else: lines.append("No relevant results found.") lines.append("") # Graph results lines.append(f"### Knowledge Graph (NetworkX — {graph.get('nodes', '?')} nodes, {graph.get('edges', '?')} edges)") if graph.get("error"): lines.append(f"⚠️ Error: {graph['error']}") elif graph["related"]: for r in graph["related"]: neighbors_str = ", ".join(r["neighbors"][:5]) if r["neighbors"] else "no direct neighbors" lines.append(f"- **{r['node']}** → {neighbors_str}") else: lines.append("No matching g ...[truncated 3572 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Treat all retrieved memory as untrusted data rather than executable instructions. 2. Place retrieved content in a strongly delimited, data-only context and explicitly tell the agent never to follow instructions found inside that content. 3. Record provenance, author, creation time, trust level, and integrity information for every indexed chunk. 4. Exclude session data and directive files from default indexing. Require explicit approval for each additional source. 5. Restrict write access to indexed directories and separate user-authored notes from tool-generated or externally imported content. 6. Detect and quarantine instruction-like content before indexing. Suspicious entries should require human review before becoming retrievable. 7. Do not automatically promote retrieved text into `SOUL.md`, `AGENTS.md`, or other behavioral configuration. 8. Apply output encoding and structured retrieval formats so memory content cannot masquerade as system or developer instructions. 9. Require explicit user confirmation before acting on retrieved content that requests tool execution, data disclosure, configuration changes, or external communication. 10. Provide deletion, revocation, and re-indexing controls for poisoned entries. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/configure_openclaw.py:53
Finding
Overly Broad Global Indexing of Sensitive Agent and Session Data<![CDATA[ ## Vulnerability Details **File Location**: `scripts/configure_openclaw.py:53-76`, `scripts/configure_openclaw.py:84-132`, `scripts/unified_setup.sh:62-87`, `scripts/unified_setup.sh:91-139` **Vulnerability Type**: Excessive access scope and unsafe configuration modification **Risk Level**: Medium ### Vulnerable Code `scripts/configure_openclaw.py:53-76`: ```python def get_memory_search_config(): """Return the complete memorySearch configuration block.""" return { "enabled": True, "sources": ["memory", "sessions"], "extraPaths": [ "SOUL.md", "AGENTS.md", "HEARTBEAT.md", "PROJECTS.md", "TOOLS.md", "IDENTITY.md", "USER.md", "reference/", "ARCHITECTURE.md" ], "experimental": { "sessionMemory": True }, "chunking": { "maxChunkSize": 2048, "overlap": 200 }, "provider": "local", "sync": { "onSessionStart": True, "onSearch": True, "watch": True } } ``` `scripts/configure_openclaw.py:91-132`: ```python # Check if memorySearch already exists memory_config = get_memory_search_config() if 'agents' not in config: config['agents'] = {} if 'defaults' not in config['agents']: config['agents']['defaults'] = {} # Add or update memorySearch configuration existing_memory = config['agents']['defaults'].get('memorySearch', {}) if existing_memory: print(f"⚠️ memorySearch configuration already exists") print(f" Current extraPaths: {existing_memory.get('extraPaths', [])}") # Merge configurations - add any missing extraPaths current_paths = set(existing_memory.get('extraPaths', [])) new_paths = set(memory_config['extraPaths']) missing_paths = new_paths - current_paths if missing_paths: existing_memory['extraPaths'] = existing_memory.get('extraPa ...[truncated 3180 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Index only `MEMORY.md` and a dedicated memory directory by default. 2. Make session memory and every additional path individually opt-in. 3. Show the exact proposed configuration diff and require confirmation before writing it. 4. Avoid changing global `agents.defaults` when a per-agent or per-workspace configuration is available. 5. Add allowlists and deny sensitive files, credential files, private keys, environment files, and secret-bearing configuration. 6. Apply per-user and per-agent authorization checks when searching indexed content. 7. Separate session, identity, directive, reference, and operational indexes so callers only query authorized collections. 8. Add retention periods and secure deletion for session-derived embeddings and documents. 9. Run secret scanning and sensitive-data classification before content is indexed. 10. Create a verified backup during unified setup and write configuration atomically using restrictive file permissions. 11. Document where embeddings and source text are stored and provide an uninstall procedure that removes both configuration changes and indexed data. ]]>

T08 · Insecure Dependencies

Warning
Location
scripts/setup.sh:27
Finding
Dependency Installation and Model Retrieval Without Integrity Verification<![CDATA[ ## Vulnerability Details **File Location**: `scripts/setup.sh:27-37`, `scripts/unified_setup.sh:28-38`, `scripts/indexer.py:74`, `scripts/search.py:19`, `scripts/auto_retrieve.py:59` **Vulnerability Type**: Unverified software and model supply chain **Risk Level**: Medium ### Vulnerable Code `scripts/setup.sh:27-37`: ```bash if [ ! -d "$MEMORY_DIR/venv" ]; then echo "📦 Creating virtual environment..." python3 -m venv "$MEMORY_DIR/venv" fi echo "📦 Installing dependencies..." "$MEMORY_DIR/venv/bin/pip" install -q --upgrade pip "$MEMORY_DIR/venv/bin/pip" install -q \ sentence-transformers==3.3.1 \ chromadb==0.6.3 \ networkx==3.4.2 ``` `scripts/indexer.py:74`: ```python model = SentenceTransformer('all-MiniLM-L6-v2') ``` `scripts/auto_retrieve.py:59`: ```python model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2") ``` ### Technical Analysis The setup scripts install packages directly through pip and upgrade pip without verifying artifact hashes. The three direct dependencies are version-pinned, but their transitive dependencies are not locked in the project, and no `--require-hashes` policy is used. The embedding model is identified by a mutable repository name rather than an immutable revision and verified artifact digest. If it is not already cached, the sentence-transformers library may retrieve model artifacts from an external model repository at runtime. Package installation executes package build or installation logic with the privileges of the user running setup. Imported dependencies then execute in a process that can read the indexed memory files. A compromised package index, package release, transitive dependency, local pip configuration, model repository, or network path could therefore affect the installed runtime. No malicious dependency was identified in the audited repository. The vulnerability is the absence of reproducible integrity controls around externally supplied executable components ...[truncated 1508 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Generate and commit a complete dependency lock file containing all transitive versions and cryptographic hashes. 2. Install with `pip --require-hashes` from the reviewed lock file. 3. Pin the pip version instead of upgrading to the latest available release during setup. 4. Use a reviewed internal package mirror or an explicitly configured trusted index. 5. Disable source builds where practical and allow only reviewed binary artifacts. 6. Pin the embedding model to an immutable repository revision. 7. Verify model configuration and weight files against expected cryptographic hashes before loading them. 8. Prefer offline, pre-reviewed model artifacts for sensitive environments. 9. Run installation and model retrieval in a sandbox with minimal filesystem access and restricted network connectivity. 10. Produce and maintain a software bill of materials and routinely scan locked dependencies for known vulnerabilities. 11. Fail closed when dependency or model integrity verification cannot be completed. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Rogue AgentSelf-Modification, Session Persistence
Findings (23)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
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.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
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.

Ssd 3

High
Confidence
98% confidence
Finding
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.

Ssd 3

High
Confidence
99% confidence
Finding
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.

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
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.

Vague Triggers

Medium
Confidence
93% confidence
Finding
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.

Ssd 3

Medium
Confidence
97% confidence
Finding
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.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
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.
Confidence
75% confidence
Finding
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.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
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.

Session Persistence

Medium
Category
Rogue Agent
Content
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
Confidence
76% confidence
Finding
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.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
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.

Context-Inappropriate Capability

Medium
Confidence
87% confidence
Finding
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 call

Medium
Category
Dangerous Code Execution
Content
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:
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
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 call

Medium
Category
Dangerous Code Execution
Content
"""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:
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Session Persistence

Medium
Category
Rogue Agent
Content
echo "   Memory dir: $MEMORY_DIR"
echo ""

# Step 1: Create memory system
echo "📁 Setting up 3-layer memory system..."
mkdir -p "$MEMORY_DIR"
Confidence
79% confidence
Finding
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.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
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.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
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.

Context-Inappropriate Capability

Medium
Confidence
95% confidence
Finding
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.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
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.

Missing User Warnings

Low
Confidence
84% confidence
Finding
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.

Intent-Code Divergence

Low
Confidence
84% confidence
Finding
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.

Missing User Warnings

Low
Confidence
81% confidence
Finding
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.

Static analysis

No suspicious patterns detected.