T02 · Agent Memory Poisoning
- Location
scripts/learner.py:74- Finding
Unvalidated Persistent Agent State Enables Cross-Session Memory Poisoning
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The causal experiment tool is mostly coherent, but it also includes a persistent learning logger that stores usage/preferences and encourages later changes to its own skill instructions.
Review this skill before installing. The causal experiment code itself is local, standard-library Python with no observed network or credential access, but the bundled learning system stores usage history, errors, notes, and preferences across sessions and encourages future changes to the skill instructions. Install only if you are comfortable with that persistence, keep sensitive data out of notes/preferences, and avoid copying learned_patterns.json content into SKILL.md without manual review.
scripts/learner.py:74Unvalidated Persistent Agent State Enables Cross-Session Memory Poisoning
The advertised purpose is causal experiment design, but the document additionally introduces a generic persistent learning/telemetry mechanism unrelated to that function. This mismatch is dangerous because users and reviewers may authorize the skill for analytical reasoning while missing that it also stores cross-session usage data, preferences, and possibly modifies skill content.
The file implements a generic cross-skill telemetry and preference logger rather than the advertised active causal experiment design capability. This mismatch increases risk because users or orchestrators may invoke the skill under false assumptions, causing unrelated data collection and persistence outside the expected causal-analysis scope.
The skill documents file-writing behavior via the learning subsystem but does not declare any tool scope or permission boundary. Undeclared write capability is dangerous because it expands what the skill can persist or modify without clear operator review, especially when it can write both memory files and potentially the skill document itself.
The added 'self-evolving learning system' introduces cross-session memory and behavior adaptation that are outside the causal-experiment scope. Scope drift matters because unrelated persistent state can be used to accumulate sensitive operational details over time and makes the skill less auditable and predictable.
Recording user preferences and prior usage across sessions is a persistent memory feature not proportionate to the stated task. Even if intended as convenience, it creates unnecessary retention of potentially sensitive user and workflow metadata that could be reused in ways users do not expect.
The skill states that usage history and user preferences are automatically recorded, but it provides no clear privacy warning, consent flow, or retention policy. Silent persistent collection is dangerous because it can capture behavioral and preference data across sessions without informed user approval.
The documented memory file stores cumulative operations, error patterns, user preferences, and improvement notes across sessions. Persistent storage of this metadata is risky because it creates a longitudinal profile of user behavior and operational context, and the file may become a source of sensitive information or prompt-injection persistence if later consumed automatically.
The instructions explicitly tell operators to save user preferences for future automatic reuse without warning the user about persistent storage. Reusing preferences across sessions can leak sensitive habits or assumptions and creates consent and transparency issues.
The module writes notes, errors, and preferences directly to a local JSON file without any user-facing notice, consent flow, redaction, or sensitivity checks. If users include secrets, personal data, or internal operational details in notes or preferences, that information will be silently persisted and may later be exposed to other tools, users, or backups.
The code accepts and stores arbitrary user preferences and operational telemetry without constraining them to the stated causal-experiment function. In this skill context, that broad collection is dangerous because it enables unnecessary accumulation of potentially sensitive behavior and preference data under a misleading skill label.
L56将技能描述为“确定性可复现”,通常暗示给定相同输入时行为稳定且文档/状态不随使用而演化;但L62-L85又声明会自动积累经验、记录偏好,甚至在错误累计后“将经验回写本 SKILL.md”。这使文档对技能运行特性的表述与后续说明存在明显张力,容易让使用者误以为该技能是静态、无状态的。
This Python file contains all user-facing documentation and CLI help context in Chinese, which effectively imposes a specific language/locale on users without offering a choice. The policy for SQP-3 flags language or locale constraints when they are forced rather than optional or clearly justified as region-specific.
The module's natural-language documentation, usage instructions, and output strings are exclusively in Chinese, which effectively forces one locale for users interacting with the skill. The policy allows locale constraints only when documented and justified or when users are offered a language choice, neither of which appears here.