T02 · Agent Memory Poisoning
- Location
scripts/learner.py:73- Finding
Unvalidated User-Controlled Data Is Persisted and Reused Across Sessions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The travel skill is mostly understandable, but it includes persistent self-learning and instructions to rewrite its own skill file without clear consent or limits.
Review before installing. The travel features are ordinary, but the self-learning section can save personal travel preferences and usage notes across sessions and may lead agents to modify the skill instructions over time. Install only if you are comfortable with that persistence, or remove/disable the learner and SKILL.md rewrite guidance first.
scripts/learner.py:73Unvalidated User-Controlled Data Is Persisted and Reused Across Sessions
The skill is presented as a travel-planning assistant, but it also introduces a generic cross-cutting learning subsystem that records usage, stores user preferences, performs reflective analysis, and instructs modifying skill documentation over time. This expands the data handling and behavioral scope far beyond the declared purpose, which can mislead users and reviewers and create unauthorized persistence and self-modification risks.
The manifest lists generic trigger terms such as “机票”, “酒店”, “旅游攻略”, and “目的地推荐”, which are broad phrases likely to appear in ordinary conversation and many unrelated travel queries. The file does not provide scope constraints, exclusion conditions, or negative examples to clarify when the skill should or should not activate.
The skill documentation extends beyond travel assistance into persistent learned state and instructions to write experience back into SKILL.md. Persistent memory plus self-modifying documentation can silently change future behavior, reduce auditability, and introduce prompt-level supply-chain risk because the skill evolves outside its reviewed scope.
A generic self-learning and behavior-tracking system is embedded in a domain-specific travel skill without a clear necessity for fulfilling travel-planning tasks. Persisting usage history, error patterns, and preferences creates avoidable privacy and profiling risk, especially because the mechanism appears reusable across arbitrary skill directories rather than tightly scoped to travel assistance.
The skill describes persistent storage of user preferences and usage history, but does not provide a clear user-facing privacy notice, consent flow, retention policy, or deletion mechanism. In a travel context, retained preferences and histories can reveal location interests, language preferences, budgets, and behavioral patterns that users may not expect to be stored across sessions.
Instructions to persist preferences across sessions create a data retention risk because information can accumulate over time without clear limits, review, or deletion. In a travel-planning skill, this may capture recurring destination interests, budgets, travel style, and other personal signals that are not strictly necessary to retain for basic functionality.
The file implements a generic cross-skill self-learning framework rather than travel-planning-specific logic, including persistence and optimization features usable by any skill. This broadens the skill’s effective scope beyond the declared manifest purpose, which increases attack surface and creates a capability mismatch that can hide unwanted data collection or behavior behind an unrelated travel assistant.
The module’s natural-language description, usage text, and user-facing output are written entirely in Chinese, indicating a fixed language choice. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not stated here.
The code persistently stores user preferences, operation history, errors, and notes in learned_patterns.json without any visible minimization, consent, retention limit, or scope restriction. In a travel-planning skill, this can capture sensitive behavioral and preference data unrelated to a single request, creating privacy risk and enabling silent long-term profiling if the file is reused or accessed by other components.
The inline examples for --capability use labels such as '简历优化' and mention '格式识别失败', which are associated with resume or document-processing tasks rather than travel planning. This documentation conflicts with the surrounding claim that the skill is for intelligent travel planning.
The example command stores 输出语言 with the value 中文, which indicates a default language preference being imposed in the skill’s natural-language guidance. The file does not mention any user choice or opt-in for language selection, which can conflict with language/locale policy expectations.