Back to skill

Security audit

Anti-Amnesia Agent

Security checks for vulnerabilities and agentic risk

Overview

This skill is not malicious, but it broadly saves and reloads conversation memory without enough limits or safety controls.

Install only if you are comfortable with the agent writing persistent local memory files. Keep secrets, credentials, personal data, and sensitive business details out of these files; add the memory files to version-control ignore rules; review and prune stored memories regularly; and treat remembered content as context, not as instructions that can override current user, developer, or system rules.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T02 · Agent Memory Poisoning

Warning
Location
SKILL.md:25
Finding

Persistent Agent Memory Poisoning Through Unsanitized Conversation Capture

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:25-34, 46-52, 74-83; templates/HEARTBEAT.md:3-6, 20-23; templates/STATE.md:17-21
Vulnerability Type: Persistent storage and repeated loading of untrusted conversation-derived instructions
Risk Level: Medium

Vulnerable Code

SKILL.md:25-34:

markdown
### Step 1: Enable Session Memory Hook

Add to your `~/.openclaw/openclaw.json` under hooks:

```json
{
  "hooks": {
    "session-memory": {
      "enabled": true,
      "messages": 9999,
      "path": "memory/"
    }
  }
}

SKILL.md:46-52:

markdown
Add to your AGENTS.md session start protocol:

```markdown
## Every Session — Mandatory
1. Read `STATE.md` — current world state
2. Read `memory/YYYY-MM-DD.md` (today) — if missing, create it
3. Read `MEMORY.md` — long-term memory
text

`SKILL.md:74-83`:

```markdown
### On Every Decision:

Decision made in chat → Write to file IMMEDIATELY No "I'll remember that" — files only

text

## Key Principle

> **If it's not in a file, it didn't happen.**

Mental notes don't survive session restarts. Files do. Every decision, every status change, every important conversation — write it down in the same response.

templates/HEARTBEAT.md:3-6, 20-23:

markdown
## On Every Wake-Up — Mandatory
1. Read `STATE.md`
2. Read `memory/YYYY-MM-DD.md` (today) — create if missing
3. Read `MEMORY.md`
markdown
## 📝 Documentation
- Everything that happens → write to `memory/YYYY-MM-DD.md`
- New decision → write to MEMORY.md
- Never trust "mental notes" — **file written or it didn't happen**

templates/STATE.md:17-21:

markdown
## 🧠 Iron Decisions (must always remember)
| Decision | Date | Source |
|----------|------|--------|
| Example: Always use 5m timeframe | DD.MM | Chat with user |
| Example: Risk per trade = 2% max | DD.MM | DECISIONS.md |

Techn

...[truncated 2399 chars]

Remediation
View remediation

Remediation Suggestions

  1. Store structured facts rather than raw conversational instructions. Separate fields such as fact, source, timestamp, trust_level, and approved_by.
  2. Treat all recalled memory as untrusted data. Add an explicit rule that content read from memory files cannot override system, developer, user, or safety instructions.
  3. Require explicit user confirmation before promoting conversation content into MEMORY.md, STATE.md, or an “Iron Decisions” section.
  4. Validate proposed durable rules against security policy and reject instructions that request secrecy, privilege changes, safety bypasses, credential access, or modifications to instruction priority.
  5. Keep raw journals outside the instruction context. Summarize them through a security-aware process before loading selected facts into future sessions.
  6. Preserve provenance and display recalled content as quoted data rather than authoritative instructions.
  7. Provide a review and rollback mechanism so users can inspect, revoke, or quarantine suspicious memories.
  8. Limit startup loading to approved records instead of automatically reading complete daily journals.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:25
Finding

Excessive Plaintext Retention of Potentially Sensitive Conversation Data

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:25-34, 77-83; templates/HEARTBEAT.md:20-23
Vulnerability Type: Broad plaintext retention without redaction, access-control, or lifecycle guidance
Risk Level: Medium

Vulnerable Code

SKILL.md:25-34:

markdown
### Step 1: Enable Session Memory Hook

Add to your `~/.openclaw/openclaw.json` under hooks:

```json
{
  "hooks": {
    "session-memory": {
      "enabled": true,
      "messages": 9999,
      "path": "memory/"
    }
  }
}

SKILL.md:77-83:

markdown
## Key Principle

> **If it's not in a file, it didn't happen.**

Mental notes don't survive session restarts. Files do. Every decision, every status change, every important conversation — write it down in the same response.

templates/HEARTBEAT.md:20-23:

markdown
## 📝 Documentation
- Everything that happens → write to `memory/YYYY-MM-DD.md`
- New decision → write to MEMORY.md
- Never trust "mental notes" — **file written or it didn't happen**

Technical Analysis

The recommended session-memory configuration retains up to 9,999 messages, while the documentation directs the agent to write every event, decision, status change, and important conversation into persistent workspace files. No guidance is provided for secret detection, data minimization, encryption, restrictive filesystem permissions, expiration, secure deletion, repository exclusions, or backup handling.

Conversations handled by an agent may contain API keys, access tokens, private keys, personal information, proprietary source code, internal infrastructure details, or confidential business records. Persisting this content broadly and indefinitely increases the exposure window and the volume of information available following a workspace compromise.

No direct network exfiltration mechanism was found in the project. The vulnerability is the unsafe local retention model and the r ...[truncated 1531 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace comprehensive capture with opt-in, purpose-limited retention and lower the default message limit substantially.
  2. Add automatic redaction for passwords, API tokens, private keys, session cookies, authorization headers, personal data, and other recognized secret formats before writing files.
  3. Warn users never to store credentials or raw secrets in STATE.md, MEMORY.md, or daily journals.
  4. Apply restrictive filesystem permissions so memory files are accessible only to the intended account.
  5. Define explicit retention periods and implement automatic expiration and secure deletion of old journals.
  6. Add memory/, MEMORY.md, and other generated state files to version-control ignore rules by default.
  7. Exclude sensitive memory files from unencrypted backups and workspace synchronization, or encrypt them at rest with appropriately managed keys.
  8. Provide commands or documented procedures to inspect, export, redact, and permanently delete retained data.
  9. Avoid duplicating complete conversations across session logs, daily journals, and long-term memory; retain only the minimum approved summary needed for continuity.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (6)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly enables automatic saving of full conversations and presents it as 'zero manual work' without any warning, consent flow, or guidance to exclude secrets. In an agent context, chats often contain API keys, credentials, personal data, or proprietary information, so automatic persistence materially increases privacy and data-retention risk.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Persisting full conversations and 'everything that happens' into memory files creates a broad natural-language retention channel for sensitive user data. Because the skill's purpose is long-term memory across sessions, the surrounding context makes the retention behavior more dangerous, not less, since over-collection is a core feature rather than an incidental side effect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The instruction to write decisions to files immediately causes persistent workspace modification based on conversational content, but the skill does not warn users that chat-derived content will be written to disk. This can unexpectedly store sensitive operational decisions, internal discussions, or mistaken instructions in durable files.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The protocol directs the agent to record every decision and important conversation content immediately, which predictably captures confidential chat material into persistent files. In a multi-session agent workflow, this increases the chance that secrets, personal data, or sensitive business context are unnecessarily retained and later exposed through filesystem access or subsequent agent reads.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill instructs the agent to create a dated memory file automatically on wake-up, which causes persistent local file modification without any user disclosure or consent checkpoint. In an agent framework, this can silently store sensitive session content or environment-derived data on disk, increasing privacy and data retention risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Mandating that 'everything that happens' and all new decisions be written to persistent files creates broad, continuous logging with no warning, scope limitation, or sensitivity filtering. In this anti-amnesia skill, the context makes the issue more dangerous because the feature is specifically designed to maximize retention across sessions, which can capture confidential prompts, operational details, or user data indefinitely.

Content

No source excerpt is available for this finding.