T02 · Agent Memory Poisoning
- Location
scripts/analyze_problem.py:40- Finding
Persistent Markdown Injection into Agent Memory
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill’s reasoning purpose is mostly coherent, but its bundled scripts can silently save raw problem text and generated Markdown memory under the user’s home directory.
Review before installing or using the bundled scripts with sensitive personal, business, legal, financial, or strategic problems. The skill does not show exfiltration or destructive behavior, but its helper scripts can keep a long-lived local record of what you submit; use it only if that local persistence is acceptable and inspect or remove ~/.openclaw/workspace/memory/firstprinciples when needed.
scripts/analyze_problem.py:40Persistent Markdown Injection into Agent Memory
scripts/lib/storage.py:7Automatic Retention of Raw User Content with Process-Default File Permissions
The declared purpose presents the skill as an intellectual framework for first-principles analysis. The supplied code does not implement reasoning logic, assumption-challenging, or solution synthesis; instead, it retrieves an existing case record from storage and formats it into a markdown document. While some exported field names relate to first-principles concepts, the code’s actual function is case export tooling. This is a materially different primary purpose and includes undeclared file I/O and CLI-based export behavior.
The declared description promises a broader first-principles reasoning capability: identifying fundamentals, challenging assumptions, and rebuilding better solutions. The supplied code only exposes a command-line tool that extracts inferred assumptions from input text via infer_assumptions. That is related to one subtask of the description, but it does not demonstrate the broader reasoning, truth decomposition, or solution rebuilding behavior claimed. There are no concerning undeclared permissions or resource accesses, but the primary purpose of the code chunk is materially narrower than the declared purpose.
The declared description presents a conceptual reasoning skill focused on first-principles analysis. The supplied code does not implement any reasoning, problem decomposition, or assumption-challenging functionality. Instead, it performs a setup task: importing a storage utility, creating or verifying storage, and printing the resulting path. This is a materially different primary purpose and introduces filesystem/storage behavior that is not reflected in the declared description or permissions.
The declared description presents a conceptual reasoning aid, but the supplied code chunk does not perform reasoning, assumption-challenging, or solution reconstruction. Instead, it provides storage and bookkeeping utilities for cases and patterns, including filesystem writes and persistent memory management. Those are materially different capabilities from the declared purpose and involve resource access not reflected in the description or permissions.
There is a clear mismatch between the declared description and the actual code behavior. The description claims a cognitive/problem-solving function centered on first-principles analysis, but the supplied code only retrieves case records from storage and outputs selected fields in JSON format. This is a materially different primary purpose and introduces undeclared data-access/reporting capability. No evidence in the code supports the claimed reasoning functionality.
The declared description presents a reasoning methodology skill focused on first-principles analysis for solving problems. The code does not implement that kind of user-facing reasoning assistance. Instead, it performs backend processing of stored reasoning cases: loading data from storage, scoring a case, inferring reusable patterns, updating promotion status, saving changes, and optionally appending promoted patterns. This is a materially different primary purpose and includes undeclared data storage and workflow-management behavior.
The declared description presents a cognitive/problem-solving skill focused on first-principles reasoning, with no triggers or permissions. The supplied code does not implement reasoning support or problem decomposition. Instead, it is a data-retrieval CLI tool that loads saved cases from storage, looks up a case by ID, and prints it. This is a materially different primary purpose and introduces an undeclared trigger (--id command-line argument) and storage access behavior unrelated to the description.
The declared description describes a conceptual problem-solving or reasoning skill, but the supplied code does not implement any first-principles analysis behavior. Instead, it functions as a simple data retrieval script for case scores. Its primary purpose, capabilities, and resource access pattern (loading stored cases and printing score data) are materially different from the declared purpose.
Without declared permissions the skill's intent is opaque and cannot be validated.
The skill is presented as a reasoning aid, but it defines persistent storage locations in the user's home directory for cases, exports, patterns, and indexes. That creates a local knowledge base of user-derived content not apparent from the description, which can retain sensitive prompts or derived reasoning artifacts beyond the user's expectation.
Automatically creating user-home storage and export directories is not clearly necessary for a first-principles thinking skill and increases the chance of silent retention of potentially sensitive data. Persistent storage in a fixed hidden directory can surprise users and may violate least-privilege and data-minimization expectations.
This code creates and appends durable index and pattern files that look like a persistent knowledge base, which materially expands the skill's behavior beyond simple reasoning assistance. Because titles and other case metadata are written into shared markdown artifacts, user-derived content may be retained and discoverable later without clear notice.
The 'Use this when the user' section describes broad situations such as wanting 'original thinking' or asking whether something is 'truly necessary, optimal, or possible.' These conditions are common across many ordinary conversations and do not define clear constraints or exclusions, which could lead to unintended invocation of the skill.
The file writes index content to disk without any user-facing warning or confirmation in this code path. While not directly enabling code execution, silent writes reduce transparency and can cause users to unknowingly leave sensitive case metadata on the local filesystem.
The save routine overwrites the persistent JSON case store without any visible disclosure to the user. This is primarily a transparency and integrity concern: users may not realize state is being updated on disk, and silent overwrites can complicate auditing or recovery of prior data.
These append operations write user-derived titles, scores, timestamps, and reusable pattern content into markdown index files without any visible disclosure. Because the content is appended to aggregate files, sensitive or identifying information can accumulate over time and become easier to browse or exfiltrate locally.