Memory Scan for Openclaw

A dedicated security scanner for AI agent memory files and configurations designed to detect prompt injections, credential leaks, and malicious instructions.

dgriffin831
v1.0.0
Feb 3, 2026
1
2.1k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install memory-scan

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install memory-scan using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Memory Scan?

Memory Scan is an essential security utility for maintaining the integrity of AI agent environments. It systematically audits MEMORY.md, daily activity logs, and critical workspace configurations to identify vulnerabilities like malicious instructions, guardrail bypass attempts, and sensitive data exposure. By integrating this into your Openclaw Skills workflow, you ensure that stored memories do not become a vector for prompt injection or unauthorized data exfiltration.

The skill operates using a multi-tiered security level system ranging from SAFE to CRITICAL, allowing developers to prioritize intervention. Whether running local pattern matching or leveraging redacted remote LLM analysis, Memory Scan provides the transparency needed to manage long-term agent memory safely and effectively.

Memory Scan Use Cases

  • Auditing daily logs to prevent accidental API key or credential leakage in stored memory.
  • Detecting sophisticated prompt injection patterns hidden within agent interaction history.
  • Monitoring workspace configuration files for unauthorized changes to agent identity or security policies.
  • Running automated daily security audits to ensure continuous compliance for Openclaw Skills.
  • Investigating agent behavior after suspicious activity by scanning for malicious instructions.

How Memory Scan Works

  1. The scanner initializes by identifying all relevant memory files, including long-term storage and the last 30 days of daily logs.
  2. It performs a local scan using regex and pattern-matching to detect immediate threats like hardcoded secrets or known malicious strings.
  3. If the user enables the remote flag, the tool sends redacted content to a configured LLM provider for advanced semantic threat analysis.
  4. Every detected threat is assigned a severity score and mapped to specific file locations and line numbers.
  5. The tool generates a report and, if a critical threat is found, can trigger an alert via a configured communication channel.
  6. Users can then opt to quarantine the threat, which triggers a backup and redaction process.

Memory Scan Setup

To perform an immediate scan of your agent's memory, execute the main Python script from your terminal:

python3 skills/memory-scan/scripts/memory-scan.py

For automated daily monitoring, you can install a standalone cron job that runs a security audit every afternoon:

bash skills/memory-scan/scripts/schedule-scan.sh

If you prefer advanced analysis using an LLM, ensure your API keys are configured and use the remote flag:

python3 skills/memory-scan/scripts/memory-scan.py --allow-remote

Memory Scan Data Schema & Taxonomy

Memory Scan organizes its findings based on the following file types and metadata structure:

Data Category Target Files Description
Long-term Memory MEMORY.md Primary persistent storage for the agent.
Daily Logs memory/*.md Historical logs of interactions and agent thoughts.
Configurations AGENTS.md, SOUL.md, GUARDRAILS.md System-level instructions and safety parameters.
Quarantined Files .memory-scan/quarantine/ Backups of redacted files for manual review.
Severity Levels SAFE, LOW, MEDIUM, HIGH, CRITICAL Taxonomy used to categorize detection urgency.

Memory Scan Advanced Features

  • Automated Quarantine: Quickly back up and redact dangerous instructions from memory files using a dedicated quarantine script.
  • Heartbeat Integration: Embed security scans into your HEARTBEAT.md for consistent, self-triggered weekly health checks.
  • Redacted LLM Analysis: Safely use high-end models for threat detection without exposing raw sensitive data to third-party providers.
  • Custom Alert Channels: Configure specific Openclaw Skills alert channels to receive real-time notifications when medium or high-risk threats are detected.
  • Flexible JSON Output: Supports a --json flag for easy integration into custom security dashboards or CI/CD pipelines.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*