T02 · Agent Memory Poisoning
- Location
SKILL.md:502- Finding
Unsanitized External Content Can Poison Persistent Agent Memory
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a coherent book-analysis memory tool, but it needs review because it persists model-generated content for future agent use and can send personalized analysis to external services without enough scoping or per-run control.
Review this before installing if your USER.md, HEARTBEAT-reading.md, or generated reading notes contain private work, company, client, or project details. Prefer local-only use, keep Feishu/Notion tokens in environment variables rather than markdown files, approve external sync per run, and avoid auto-loading generated knowledge entries into future sessions until they are reviewed as untrusted reference material.
SKILL.md:502Unsanitized External Content Can Poison Persistent Agent Memory
SKILL.md:502Unvalidated Model Identifier Is Interpolated into a Filesystem Path
The skill is designed to read USER.md and other local state, then incorporate that personal context into generated outputs and optional external records. This creates a natural-language data exfiltration path: sensitive profession, project, challenge, or organizational details can be restated, stored, and potentially synced outside the workspace.
The skill describes sending analysis outputs to Feishu or Notion but does not clearly warn that generated content, potentially including user-derived context, may leave the local system. That creates a real privacy and data-governance issue because personal or organizational details can be transmitted to third-party services without sufficiently explicit disclosure.
The instructions direct the skill to obtain credentials from local content and use them to write records externally, combining secret-handling risk with outbound data transmission. If HEARTBEAT-reading.md contains tokens or user-derived analysis fields, the skill encourages both secret exposure and external leakage of contextual information.
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.
**Data Persistence**: This skill writes to `thinking-patterns.md` and `reading-history.json` in your workspace. These files persist across sessions.
**Optional Integration**: The "auto-load thinking-patterns.md" feature requires manual configuration in your `AGENTS.md`. The skill does NOT automatically modify your agent's behavior without your explicit setup.
**Export Tokens**: Environment variables (`FEISHU_APP_TOKEN`, `NOTION_API_KEY`) are entirely optional. The skill works perfectly fine without them (local-only mode).
The skill persistently writes pattern files, concepts, and reading-history records across sessions. In this context, persistence is intentional functionality, but it is still security-relevant because it accumulates derived user data and AI-generated material that may outlive the session and be reused in later contexts without clear retention controls.
- memory/reading-history.json # Load previously analyzed books for deduplication (book titles only)
- HEARTBEAT-reading.md # Optional: read schedule config, topic mapping, and Feishu credentials
write:
- memory/knowledge-base/patterns/*.md # Write individual model files with YAML frontmatter
- memory/knowledge-base/concepts.md # Append domain-specific concepts
- memory/reading-history.json # Record newly analyzed book + model for future deduplication
env:
The skill advertises dual-value knowledge extraction but does not clearly warn that each run persistently writes AI-generated files and updates reading history. Users may invoke it expecting ephemeral analysis, causing silent accumulation of records and generated content in the workspace without informed consent.
The top-level description and subsequent templates are written as required Chinese output behavior, and no opt-in or language-selection mechanism is provided. Under the policy, forcing a specific language or locale without user choice is a natural-language policy violation unless clearly justified.
The workflow instructs automatic creation of directories and files during environment checks without a user-facing notice. Silent mutation of workspace state is risky in agent environments because it can surprise users, create unwanted persistence, and normalize unattended file creation.
The skill explicitly requires transfer sections and strategic questions to cite concrete user details such as profession, company, or project context. That requirement increases the chance of disclosing sensitive personal or business information in responses, logs, or copied outputs, even when such detail is not necessary for functionality.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
}
### Step 4.5. Verify Knowledge Base Write (写入验证,必须执行)
**验证逻辑**:
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
}
### Step 4.5. Verify Knowledge Base Write (写入验证,必须执行)
**验证逻辑**:
The skill documentation says credentials may be read from HEARTBEAT-reading.md, while the manifest declares secrets as environment variables. This inconsistency creates a real security risk because operators may place tokens into a readable workspace file, expanding exposure from process environment scope to filesystem scope and making accidental disclosure or downstream propagation more likely.
The file mixes headings with extensive Chinese instructions and user utterance examples, implying the skill operates in Chinese by default. There is no indication that users may choose another language or that the Chinese-only behavior is region-specific and justified, which can violate language/locale policy requirements.
The example declares Chinese as the default output format without indicating that language should be selected based on user preference. While not a direct security exploit, forced default language can mislead users, reduce transparency around agent behavior, and increase the chance that important warnings or consent text are not understood.
The document explicitly states that output will be written to a local knowledge-base file regardless of mode, but it does not mention asking for user consent, showing the destination clearly at runtime, or providing a way to opt out. Silent or automatic local file modification is risky because it can overwrite, append to, or create persistent data the user did not intend to store.
The routing table and trigger examples prioritize Chinese invocations and a Chinese default path, but do not say that users may interact in other languages or choose output locale. This creates an implicit language policy bias rather than a user-selected language setting.
This markdown file contains core operational instructions in Chinese while other sections are in English, effectively imposing a language/locale expectation on the user. The policy allows fixed locale behavior only when it is clearly documented and justified or when users are given a choice, which is not present here.