T02 · Agent Memory Poisoning
- Location
scripts/learner.py:23- Finding
Unrestricted Persistent Modification of Skill Memory
- Content
View full analysis
--key --val Important user prefer ...[truncated 3394 chars]- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a local Chinese-language alignment checker, but it also includes a broad persistent learning module that can write behavioral memory for arbitrary skill directories.
Review this carefully before installing. The alignment checker is local and does not appear to exfiltrate data, but the included learner stores usage notes and preferences and can write that memory file outside this skill if invoked with another directory. Avoid putting secrets or sensitive user data in notes or preferences, and only use the learner if you are comfortable with persistent local behavioral state.
scripts/learner.py:23Unrestricted Persistent Modification of Skill Memory
The stated purpose is a value-alignment guardrail, but the documentation also introduces generic learning, persistent logging, preference storage, analytics, and self-reflection features that materially expand behavior beyond content evaluation. This mismatch is dangerous because reviewers and users may authorize the skill under a narrow safety premise while it performs broader stateful tracking and modification, undermining informed consent and least privilege.
The file’s documented behavior is a generic cross-skill learning and telemetry component, which materially exceeds the declared purpose of a local value-alignment guardrail. That mismatch is dangerous because operators may grant or trust the skill under a narrow safety-evaluation model while it actually accumulates operational data and optimization state across skills.
resolve_skill_dir allows targeting arbitrary skill directories, including under ~/.workbuddy/skills, enabling this module to read and write learning data for other skills. In the context of a value-alignment skill, that broad filesystem and cross-skill reach violates least privilege and can be abused to profile, tamper with, or persist data outside the expected trust boundary.
The skill documents disk-writing behavior via its learner/self-improvement system but does not declare any tool scope or permissions boundary. That creates an undeclared capability gap: operators may treat the skill as a harmless local evaluator while it can persist state and modify files, increasing the risk of unintended data retention or unauthorized writes in broader agent environments.
The manifest presents the skill as a pure local rule-based evaluator, yet later sections describe a built-in self-improvement system that records usage history and preferences to disk. This inconsistency can mislead deployers about the data-handling model and cause unexpected retention of operational or user-derived information.
A value-alignment guardrail does not inherently require storing user preferences, yet the documentation authorizes persistent preference memory. That broadens the skill from safety evaluation into profile/state management, which can be abused to accumulate sensitive behavioral data or silently influence future decisions outside the user's expectations.
The skill describes recording user preferences to a local memory file but provides no privacy or data-handling warning. Even if storage is local, undisclosed retention of preferences and notes can expose sensitive information, create compliance issues, and violate user expectations around transparency.
The module’s natural-language docstring and user-facing CLI messages are entirely in Chinese, which imposes a specific language on users without opt-in. The policy allows locale constraints only when choice is offered or the restriction is clearly documented and justified, neither of which appears here.
The persisted schema includes preferences, recent operations, error patterns, and free-form notes, creating a user and workflow profiling store unrelated to narrow alignment evaluation. Even if intended for benign optimization, retaining this level of behavioral metadata increases privacy risk and expands the consequences of local compromise or misuse.
save_learning writes accumulated usage and preference data to disk silently, without any warning that notes or preferences may contain sensitive information. This creates a privacy and compliance risk because users may assume ephemeral processing while the module persistently stores potentially identifying or confidential content.
The CLI accepts unrestricted free-form --note and preference values and persists them without warning or validation. This is dangerous because users may inadvertently store secrets, personal data, or sensitive operational context in a long-lived local file that other processes or users could read.
The module title, description, usage text, pattern set, and examples are all written specifically for Chinese, and the evaluation heuristics depend on Chinese-language regex patterns. There is no natural-language indication that the tool is China/Chinese-specific or that users may opt into another language, which creates a locale-policy issue.
The natural-language description and usage guidance are written entirely in Chinese, which can functionally force a specific language for users without opt-in. The policy requires flagging language or locale constraints unless the skill offers a choice or clearly documents and justifies the locale limitation.
This manifest-like JSON includes the capability name only in Chinese ("价值对齐") in both the capability statistics and recent operation fields. Because there is no accompanying indication that the skill is region-specific or that users can opt into this locale, it may violate the language/locale policy requiring choice or justification.