T02 · Agent Memory Poisoning
- Location
scripts/learner.py:85- Finding
Persistent behavioral influence through unvalidated learning data
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is not clearly malicious, but it can bulk-modify other skills and store user behavior/preferences without enough guardrails.
Install only if you intentionally want a tool that modifies other installed WorkBuddy skills. Review the hardcoded target list first, keep backups of affected SKILL.md files, treat learned_patterns.json as potentially sensitive, avoid storing secrets or personal data in notes/preferences, and require human review before applying any suggested SKILL.md changes.
scripts/learner.py:85Persistent behavioral influence through unvalidated learning data
scripts/learner.py:61Potentially sensitive preferences and notes stored in plaintext
声明的核心卖点是“给任意技能注入自进化学习系统”的安装/注入器,一键完成模块复制、记忆文件初始化和 SKILL.md 修改;但提供的代码只是学习子模块本身(记录、偏好、洞察、复盘建议),并非注入器。虽然代码与“记录使用成败、偏好、自动复盘并给出改进建议”这部分描述一致,但缺少声明中最关键的注入与批量改造行为,因此描述对实际代码能力有明显夸大,构成不匹配。
The documentation does not clearly warn users that the skill may modify other skills' files and persist preference/history data. Without explicit notice and consent, users may unknowingly allow cross-skill file changes or ongoing storage of behavioral data, which creates privacy and integrity risks.
The trigger phrases are broad enough that the skill may activate in unintended contexts, increasing the chance it runs file-modifying or persistence-related workflows when the user did not explicitly request them. In a skill that claims to inject code/files into other skills and store learning data, accidental invocation expands the attack surface and risks unauthorized modification or data retention.
The skill explicitly encourages persistent collection and reuse of user preferences, usage outcomes, and error patterns across sessions. Storing this data without minimization, consent, retention limits, or access controls can expose sensitive behavioral information and create a durable privacy risk if the file is accessed by other tools, users, or processes.
The schema and examples normalize writing user-derived notes, error descriptions, and preferences into a persistent JSON file. Because free-form notes may contain personal or sensitive information, this design can lead to unbounded retention of private data and secondary exposure through logs, backups, or later processing by other components.
The script copies learner.py into multiple skill directories without disclosure or integrity verification at the point of modification. In this context, adding executable code to many installed skills expands the attack surface and creates a persistence mechanism across skills, especially because the skill's stated purpose is self-improvement and cross-skill injection.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
shutil.copyfile(LEARNER_SRC, os.path.join(scripts, "learner.py"))
# 3) 初始化 learned_patterns.json
import subprocess
r = subprocess.run([PY, os.path.join(scripts, "learner.py"), "init", d],
capture_output=True, text=True)
# 4) 追加章节
section = open(SECTION_SRC, encoding="utf-8").read()
The script silently appends content to each target skill's SKILL.md without any per-skill confirmation, dry-run output, or backup. In a skill ecosystem, modifying instruction files changes agent behavior and trust boundaries, so undisclosed bulk edits can introduce unexpected capabilities or persistence that operators may not notice.
The module docstring, CLI description, usage comments, and all user-facing status messages are written only in Chinese. For a general-purpose "通用" learning module intended for any WorkBuddy skill, this imposes a specific language/locale on users without opt-in or a documented regional justification.
The skill explicitly documents persistent storage of operation counts, capability usage frequency, error patterns, user preferences, and improvement suggestions in a local JSON file, but provides no notice, consent flow, retention limit, or guidance on handling potentially sensitive content. This creates a privacy and profiling risk because user behavior and preferences can accumulate across sessions and may later influence outputs or be exposed to other users/processes with access to the skill directory.
The section instructs persistent collection of user preferences and usage/error details into a memory file for later reuse and reflection. Because notes and error descriptions may contain user-supplied or operationally sensitive data, this creates a retention surface that can leak personal information, internal workflows, or sensitive prompts if the file is accessed, shared, or reused improperly.
The instructions tell operators to persist user preferences for future automatic reuse, including an example that sets output language, without warning that this preference will survive across sessions and alter later behavior. Silent persistence of preferences can surprise users, embed stale or sensitive assumptions, and cause unauthorized cross-session personalization.
The example explicitly stores '输出语言' with value '中文' for direct future use, and the surrounding document is written as if Chinese is the default operating language. SQP-3 applies to language policy violations when a specific language is imposed without opt-in or a documented regional justification.
The example command records a language preference as “输出语言 --val 中文”, and the document overall is presented only in Chinese while describing behavior that remembers user preferences. This suggests a default language constraint without stating that users may choose another language or opt in to locale-specific behavior.