T02 · Agent Memory Poisoning
- Location
scripts/memcore/bootstrap_context.py:83- Finding
Conversation-Derived Content Can Persist as Startup Instructions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
MemCore is a coherent local memory tool, but it can automatically turn past conversation logs into future startup context without enough review or control.
Install only if you are comfortable with this skill building a persistent local memory layer from OpenClaw logs and session state. Review MEMORY_BRIEF.md before making it startup context, avoid indexing secrets, and consider disabling or manually controlling first-run indexing, scheduled maintenance, and query logging until provenance, redaction, and deletion controls exist.
scripts/memcore/bootstrap_context.py:83Conversation-Derived Content Can Persist as Startup Instructions
scripts/memcore/trace.py:282Sensitive Memory Content Is Duplicated into Plaintext SQLite Files Without Explicit Permission Hardening
Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.
The repeated documentation/behavior mismatch is a real trust-boundary problem, especially because the skill is positioned as a memory-management and diagnostic component. In this context, overstated fallback, maintenance, and scoring features can cause the agent or human operator to skip manual checks, creating integrity and decision-quality risks.
The repeated documentation/behavior mismatch is a real trust-boundary problem, especially because the skill is positioned as a memory-management and diagnostic component. In this context, overstated fallback, maintenance, and scoring features can cause the agent or human operator to skip manual checks, creating integrity and decision-quality risks.
The repeated documentation/behavior mismatch is a real trust-boundary problem, especially because the skill is positioned as a memory-management and diagnostic component. In this context, overstated fallback, maintenance, and scoring features can cause the agent or human operator to skip manual checks, creating integrity and decision-quality risks.
The skill documents shell execution and file read/write behavior but does not declare any tool scope such as permissions or allowed-tools. In an agent environment, missing capability boundaries can cause the skill to run with broader privileges than intended, increasing the blast radius of prompt mistakes or malicious task inputs.
The invocation guidance is broad and lacks clear exclusion conditions, so an agent may over-trigger the skill in situations involving sensitive files, uncertain context, or tasks that do not require memory maintenance. Overbroad activation criteria increase the chance of unnecessary shell execution, unintended file access, and inappropriate reliance on the skill's outputs.
The skill says health checks are report-only and never auto-fix, but elsewhere documents maintenance flows that perform state-changing feedback and decay operations. This inconsistency can mislead operators into believing a diagnostic invocation is side-effect free when it may mutate memory state, which is risky for auditability and safe operations.
The entire architecture document is written in Chinese, including headings, operational descriptions, and CLI explanations, with no indication that language choice is optional or tied to a region-specific requirement. This creates a natural-language policy concern because the skill documentation effectively mandates a specific language for users without offering a locale choice or documenting a justified constraint.
The documentation describes automatic memory writing, indexing, and pattern induction during normal workflow without a prominent warning that persistent state will be modified automatically. In a memory-management skill, silent background writes are security-relevant because they can alter logs, derived memory, and future agent behavior without informed operator consent.
The automatic maintenance section states that scheduled jobs will index logs, infer patterns, decay memories, and refresh briefs, but does not clearly warn that these background jobs process historical data and mutate stored state without user interaction. This increases the risk of unnoticed data processing, privacy issues, and hard-to-trace changes to the agent's long-term memory behavior.
The documentation contains a materially inconsistent safety claim: it says the original MEMORY.md is never modified, while earlier instructions state lessons are written into MEMORY.md during the shutdown flow. This can mislead operators about data integrity and backup assumptions, causing them to permit the skill to run under false expectations about what files it changes.
Comments and console output throughout the script are written only in Chinese, which effectively forces a specific language for users interacting with the installer. The file does not provide an opt-in language choice or explain that the skill is intended only for a Chinese-speaking or region-specific audience.
The module usage text claims update-memory will '更新 MEMORY.md(自动提取教训)', which implies modifying the MEMORY.md file. But the implemented cmd_update_memory function only computes traces/patterns and prints 'MEMORY.md 更新建议' to stdout without writing any file. This is a clear manifest/documentation-to-behavior mismatch in a user-facing command description.
The brief command writes directly to a fixed file under the user's workspace without checking for an existing file, prompting for confirmation, or using an atomic safe-write flow. In a memory-management skill context, this can silently overwrite locally curated briefing content or automation outputs, causing integrity loss and potentially poisoning subsequent agent context if the overwritten file is trusted as startup input.
The module docstrings and all generated natural-language skill/template text are written in Chinese, and the code does not provide any user opt-in or locale-selection mechanism. This can violate the language/locale policy for skills that should not force a specific language by default.
The code automatically turns pattern data from local databases into SKILL.md content and update patches without any explicit disclosure, review gate, or provenance marking beyond a small auto-generated note in the template. Because fields such as name, description, tags, and solution_template are copied directly from workspace-derived data, an attacker or untrusted upstream source could poison memory/pattern records and cause misleading or unsafe instructions to be surfaced as trusted skill recommendations.
The module docstring and many user-readable comments/docstrings are written entirely in Chinese, which imposes a specific language on operators or maintainers without any opt-in or stated regional justification. Under the language/locale policy, forcing a specific language is a policy concern unless the skill offers a choice or clearly documents why the locale is required.
The module docstring describes tracking references, normalizing feedback signals, and value backpropagation, but the implementation goes further by directly modifying long-lived memory state in external trace databases. In particular, it updates feedback_count, feedback_score, and value_score in trace_index.db, and periodically decays older traces, which is a stronger memory-maintenance behavior than a simple feedback-loop tracker.
The module automatically creates and writes to persistent databases under the user's home directory as part of normal operation, with no visible notice or control. In the context of an agent memory system, silent persistence increases privacy risk and can accumulate sensitive behavioral history that users may not expect to be retained.
The code persists user-derived queries and free-form feedback notes into a local SQLite database without minimization, redaction, retention limits, or user consent. In a memory skill, those fields can easily contain secrets, personal data, internal prompts, or incident details, so compromise of the local profile or unintended reuse can leak sensitive information.
Natural-language strings in the module docstring force a specific language context for the skill description. Under the stated policy, language-specific behavior should either offer user choice or clearly justify the locale constraint.
The retriever is designed to return raw memory content and also logs the user's query, creating a straightforward path for sensitive information disclosure during normal operation. In this skill context, the workspace files and trace databases likely contain historical observations, reflections, and agent state, so overbroad retrieval plus telemetry meaningfully increases leakage risk.
The retriever logs search queries to feedback storage without any user-facing disclosure in this code path. Because memory-retrieval queries often encode sensitive intent, project names, incidents, or credentials pasted by users, silent persistence increases exposure and can violate privacy expectations.
When a query has no usable terms, the code falls back to returning highest-value traces rather than no results, which can expose unrelated stored observations and actions to the requester. In a memory system, this is especially dangerous because traces may include private operational history that the user did not ask for and may not be authorized to see.
The manifest describes a memory retrieval system with adaptive fallback, but spawning an OS command introduces an execution capability beyond ordinary file/database lookup. Since the same fallback could be implemented with native file parsing, the subprocess dependency is not an obvious requirement of the skill's purpose.
No suspicious patterns detected.