Back to skill

Security audit

Conversation Saver

Security checks for vulnerabilities and agentic risk

Overview

This skill openly aims to save conversation memories, but it can silently persist sensitive chat content and even write conversation-derived text into agent instruction files.

Install only if you explicitly want automatic local memory capture. Review or disable automatic hooks, remove any route that writes extracted chat text to TOOLS.md or AGENTS.md, and inspect stored memory files regularly for private or unintended content.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T02 · Agent Memory Poisoning

Error
Location
scripts/extract.py:175
Finding

Untrusted Conversation Content Can Poison Persistent Agent Instructions

Content
View full analysis

Vulnerability Details

File Location: scripts/extract.py:175-178, scripts/persister.py:78-91, and scripts/persister.py:104-120
Vulnerability Type: Persistent agent-memory instruction injection
Risk Level: High

Vulnerable Code

scripts/extract.py:175-178 classifies conversation text containing system-related keywords as a system rule and assigns instruction-bearing files as persistence targets:

python
elif any(kw.lower() in content for kw in KEYWORD_CATEGORIES["system"]):
    fact["category"] = "system"
    fact["targets"] = ["tools_md", "agents_md"]

scripts/persister.py:78-91 appends the complete, unescaped conversation text directly to TOOLS.md:

python
def append_to_tools(fact: Dict, verify: bool = True) -> None:
    """Append system rule to TOOLS.md."""
    path = Path("/home/admin/.openclaw/workspace/TOOLS.md")
    if not path.exists():
        return

    entry = f"\n> **[{datetime.now().date()}]** {fact['content']}"

    with open(path, "a", encoding="utf-8") as f:
        f.write(entry)
        f.flush()

    if verify:
        with open(path, "r", encoding="utf-8") as f:
            assert fact["content"] in f.read()

scripts/persister.py:104-120 routes facts classified as system rules to that unsafe persistence sink:

python
def persist_facts(facts: List[Dict], config: Dict) -> None:
    """Route facts to their target files."""
    for fact in facts:
        targets = fact.get("targets", ["memory_md"])
        for target in targets:
            if target == "ontology":
                update_ontology(fact)
            elif target == "warm_memory":
                append_to_warm_memory(fact, verify=config["persistence"]["verify_after_write"])
            elif target == "user_md":
                update_user_md(fact, verify=config["persistence"]["verify_after_write"])
            elif target == "memory_md":
               
...[truncated 3017 chars]
Remediation
View remediation

Remediation Suggestions

  1. Do not automatically convert ordinary conversation content into persistent agent rules. Disable routing to TOOLS.md and AGENTS.md for automatically extracted facts.
  2. Store extracted system-related statements in a non-instructional data file using a strict schema containing fields such as content, source, timestamp, author, confidence, and approved.
  3. Require explicit confirmation from an authenticated, trusted administrator before promoting any extracted statement into an instruction-bearing file.
  4. Implement a restrictive allowlist of supported rule types and serialize approved values from predefined enums or templates rather than writing free-form text.
  5. Reject or quarantine content containing prompt-control language, role declarations, tool directives, embedded Markdown instructions, links, or requests to ignore existing policies.
  6. Clearly delimit stored conversation text as untrusted data and ensure the agent's instruction hierarchy explicitly prohibits interpreting memory records as commands.
  7. Add provenance and integrity controls so entries derived from conversation logs cannot be confused with administrator-authored rules.
  8. Use atomic writes, backups, and an audit log for all changes to instruction-bearing files.
  9. Add security tests proving that messages containing system keywords cannot modify TOOLS.md, AGENTS.md, or other files loaded as agent instructions without explicit approval.
  10. Review and remove any existing automatically generated entries from TOOLS.md that cannot be tied to an authorized administrative action.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (28)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README explicitly promotes silent background extraction and persistence of conversation facts without any mention of user consent, minimization, or privacy safeguards. In this skill's context, the feature is designed to collect and retain sensitive conversational content, so the lack of warnings and controls is a real privacy and security risk rather than merely incomplete documentation.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The examples show persistence of highly private details—family travel, location, and personal preferences—into durable memory and ontology files. This concretely demonstrates storage of sensitive personal information, which could expose users to profiling, surveillance, or downstream misuse if the files are accessed by other tools, users, or processes.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The declared description emphasizes automatic extraction of key facts from conversation history using a rule+LLM hybrid approach, then persistence to local memory files. This code chunk does not inspect conversation history, extract facts, invoke any LLM, or implement rule-based extraction. Its actual role is a persistence/router layer that takes precomputed fact dictionaries and appends them to specific markdown files. It also supports writing to USER.md and TOOLS.md and includes an ontology target placeholder, which is more specific and somewhat broader than the description’s generic 'local memory files.' The persistence aspect matches partially, but the primary declared capability—automatic extraction—is absent in this code chunk, so this is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Persisting conversation-derived 'system rules' into TOOLS.md or AGENTS.md gives untrusted natural-language content a path into files that can change agent behavior. This creates a prompt/configuration injection channel where user or conversation text could be transformed into durable operating rules, expanding impact beyond memory retention into future agent actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README explicitly advertises silent background extraction of conversation facts and persistence to local memory files, but it does not clearly warn users that their conversation content will be automatically captured and stored. In the context of an agent skill with read/write/edit access, this creates a meaningful privacy and consent risk because sensitive user data may be retained without explicit awareness or opt-in.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill advertises background collection and storage of user conversation details with no user interaction, including personal information such as location and preferences. Persisting such data automatically creates a meaningful confidentiality risk, especially because users may not expect their transient chat content to be written into durable local memory files.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

The documented write-verification behavior reinforces durable session persistence by ensuring extracted data is successfully stored, which strengthens retention of potentially sensitive information. While persistence verification is not inherently malicious, in this skill's privacy-sensitive context it increases the reliability of unauthorized or unexpected data retention.

Content

Scanner excerpt · README.md (reported line 10)May include surrounding context.

md
- **Silent operation**: No user interaction required, runs in background
- **Smart classification**: Routes facts to WARM_MEMORY, MEMORY, ontology, USER.md automatically
- **Hybrid extraction**: Fast regex + LLM semantic understanding
- **Write verification**: Immediate read-after-write to ensure persistence
- **Configurable**: Adjust keywords, filters, and targets via config.json

## Installation

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The post-conversation hook instructs automatic extraction after every session, turning one-time conversations into an ongoing retention pipeline. This increases the attack surface and privacy impact by normalizing continuous collection of user-provided content without case-by-case necessity or consent.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill documentation clearly describes read/write access to local files and automated persistence, but it does not declare any explicit tool scope or permission boundaries. This creates a transparency and least-privilege problem: users and host systems cannot easily evaluate or constrain what files the skill may access before installation or execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill emphasizes silent background operation and automatic persistence of conversation facts, but it does not present a strong upfront warning or consent model for users whose data will be retained. This is risky because sensitive personal details may be stored without clear awareness, creating privacy and compliance problems.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Silent background capture and persistence of conversation details increases the risk of retaining sensitive data without timely review or minimization. Even with local-only storage, persistent files can later be read by other tools, plugins, or users with system access, turning transient conversation content into durable exposure.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documented storage targets include personal details, schedules, locations, and preferences, all of which are sensitive profile data when aggregated over time. Persisting these categories automatically raises privacy and surveillance risks, especially if classification or extraction is inaccurate and users are not asked to confirm what is stored.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest frames the skill as local-first persistence to memory files, but the storage table includes writing conversation-derived content into TOOLS.md or AGENTS.md. Those files influence agent behavior and configuration, so this is a materially different and more sensitive action than ordinary memory storage.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% 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.

Content

Scanner excerpt · SKILL.md (reported line 46)May include surrounding context.

md
### 3. Trigger Modes

- **On Session End**: Automatically run after each conversation (requires AGENTS.md hook)
- **Heartbeat Backfill**: Scan recent days for missed conversations (configurable)
- **Manual**: `uv run scripts/extract.py --session <sessionKey>` or `--days N`

Ssd 3

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Running automatically at session end means every conversation may be scanned and saved without an explicit approval checkpoint. That makes accidental retention of confidential or irrelevant material much more likely, and the persistence becomes systematic rather than user-directed.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The category lists include very broad terms such as 'must', 'rule', 'reply', 'today', 'day', and 'like' that are common in ordinary conversation and not tightly scoped to explicit memory-safe entities. In a background conversation-saving skill, this increases the chance of over-collecting and persisting incidental or sensitive user content, especially because extraction is automatic and deduplicated across sessions.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The overall design is to extract and retain conversation-derived 'facts' such as preferences, locations, and times, which are often sensitive personal data. In the context of a background memory skill, this creates a real privacy and surveillance risk, especially when retention scope and minimization controls are not evident in this file.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The regex and keyword rules are broad enough to capture arbitrary user statements containing terms like 'remember' or 'must,' which can sweep in sensitive information without meaningful context checks. Because this runs as a silent extraction mechanism, the loose patterns increase the chance of indiscriminate retention of private or security-relevant details.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The function docstring says it will 'Use LLM to extract facts from messages', and the manifest also describes 'rule+LLM hybrid extraction'. However, the implementation immediately states it is a simplified mock and only performs local keyword matching as a fallback, with no actual LLM invocation. This is an active documentation-to-code contradiction, not just an omitted detail.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script silently persists facts derived from chat history into local memory files without any notice, consent, or confirmation in this flow. In an agent skill whose purpose is background extraction from conversations, that makes privacy-sensitive retention more dangerous because users may not realize personal details, preferences, locations, and schedules are being stored long term.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code silently persists extracted conversation content into several local memory files without any user-facing consent, notice, or approval step. Because the skill is specifically designed for background extraction and writes potentially sensitive user facts to durable storage, this creates a real privacy and data-governance risk if the extraction is overbroad, incorrect, or captures secrets.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The docstring states the function extracts dates from Chinese date expressions, and the hardcoded regex patterns only recognize Chinese formats. This creates a locale-specific behavior in natural-language handling without any opt-in, fallback, or documentation that the skill is intentionally limited to Chinese inputs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The file presents the skill instructions entirely in Chinese, and there is no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking context. Per the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The example session hook is written only in Chinese, and the limitations section says the skill is optimized for Chinese conversations, but the documentation does not offer an opt-in language choice or clarify whether non-Chinese usage is supported. This can create a locale-policy issue by implicitly steering usage toward a specific language without user choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The description is written only in Chinese ("自动从对话历史中提取关键事实,持久化到本地记忆文件"), which indicates a language-specific presentation without any stated user choice or opt-in. The policy for this review flags natural-language locale or language constraints when they are imposed without offering an alternative or documenting a justified regional scope.

Content

No source excerpt is available for this finding.