T02 · Agent Memory Poisoning
- Location
SKILL.md:213- Finding
Persistent Memory Can Store and Reapply Attacker-Controlled Behavioral Instructions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is for persistent agent memory, but it can save broad conversation, project, and error details across sessions without clear opt-in or deletion controls.
Review this carefully before installing. Use it only if you want the agent to maintain persistent local memory, and avoid letting it store secrets, raw command output, private project details, or sensitive user information. Periodically inspect and delete the generated memory and .learnings files, and be cautious with the packaging script.
SKILL.md:213Persistent Memory Can Store and Reapply Attacker-Controlled Behavioral Instructions
scripts/error-detector.sh:11Error Logger Persists Arbitrary Tool Output Without Secret Redaction
scripts/package_skill.py:14Skill Packager Can Include Sensitive Files and External Symlink Targets
The skill explicitly promotes 'self-evolution' and continuous performance optimization, which is a self-modification pattern. Even if framed as improvement rather than code mutation, it encourages the agent to change durable behavior and memory heuristics based on conversational input, creating a pathway for prompt-driven policy drift, persistence of bad instructions, or adversarial poisoning of future behavior.
---
name: max-self-improvement
description: MiniMax Agent self-evolution system with 5-layer memory architecture and continuous learning. Triggers: "remember this preference", "continue from last time", "improve your response", "analyze failure", "do you remember", "self-evolve", "record this lesson", build personal memory system.
---
# Max-Self-Improvement — Self-Evolution & Memory System
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""排除的文件模式"""
return {
'__pycache__', '.pyc', '.git', '.DS_Store',
'Thumbs.db', '*.log', '.env', 'node_modules'
}
The trigger list in the frontmatter uses broad conversational phrases like 'improve your response', 'do you remember', and 'record this lesson', which can cause the skill to activate in normal discussion rather than from explicit user intent. Because this skill performs persistence and memory actions, accidental activation increases the chance of unintended logging or retention of user and project data.
The skill advertises persistent memory and continuous learning but does not present a clear user warning or consent mechanism for storing conversation-derived information. This is dangerous because users may unknowingly disclose preferences, project details, or sensitive context that the system is instructed to retain across sessions.
The skill's core purpose is to persist user preferences, session context, and lessons into long-term memory files, which creates a direct data retention and disclosure risk. In context, the danger is elevated because broad activation rules can cause storage of conversation-derived material without precise user intent or minimization.
The feature-request patterns include very generic phrases such as 'Can you also...' and 'Is there a way to...', which appear frequently in ordinary conversation. This makes the skill likely to log routine dialogue as feature requests, creating unnecessary persistent records and possible capture of sensitive user intent or context.
The entry templates instruct the system to log full context, error output, inputs, parameters, environment details, and user context in plain language. These fields are likely to capture secrets, personal data, internal paths, tokens, prompts, or proprietary project information, turning routine logging into a durable disclosure surface.
The promotion rules explicitly move behavioral patterns, workflow improvements, tool tips, and project facts into persistent memory locations, encouraging long-term accumulation of user and project data. This increases the blast radius of any mistaken capture, since ephemeral conversation details can be normalized into durable knowledge stores.
The instruction to always read prior notes and save all in-progress state before restart promotes wholesale retention of session state. In practice, this can preserve sensitive transient details that should remain ephemeral, especially when no minimization, consent, or redaction requirements are defined.
This markdown template instructs authors to define trigger phrases using placeholders like "When user says..." and "When situation..." without emphasizing specificity, scope limits, or exclusion conditions. If reused as-is or followed loosely, it encourages ambiguous activation criteria that overlap with common speech and makes unintended invocation more likely.
The entry point section shows conditions as simply "When...", which provides no guidance on how to distinguish valid activation contexts from invalid ones. For a skill template, this omission can propagate ambiguous invocation logic into downstream skills.
The architecture explicitly defines persistent storage for user preferences marked as never deleted and additional long-term memory files, but it provides no consent, minimization, retention, or privacy controls. In an agent skill, this can lead to silent accumulation of personal or sensitive data across sessions, creating privacy, compliance, and unintended data exposure risks.
The workflow describes automatically writing successes, failures, lessons, and promoted knowledge into persistent memory without warning users that their task outcomes and interactions may be retained. This is dangerous because task results can contain sensitive prompts, project details, mistakes, or derived personal information that become durable records without transparency or approval.
The file includes a persistent preference entry Code comments: en-US and later states that all code comments will automatically use English. This is a natural-language policy concern because it imposes a specific language behavior across sessions rather than offering a language choice or clearly documenting a justified locale constraint.
The note '用户偏好永不自动删除' directs indefinite retention of user preference data across sessions, which creates unnecessary long-term storage of user-provided information. Even if the data seems low sensitivity here, indefinite persistence increases exposure in the event of memory leakage, unauthorized access, over-collection, or future repurposing beyond the user's expectations.
The user_preferences.md template includes Code comments: en-US | zh-CN, which hard-codes language/locale options for generated code comments. This can create a language/locale policy issue because it frames comment language as a preset constraint without stating that the user must explicitly choose or opt in.
The script persists error details to a local markdown log and only prints a generic confirmation message to stdout. This creates a transparency and privacy problem because users may not realize potentially sensitive failure data is being retained on disk for later exposure to other local users, backups, or tooling.
The script writes arbitrary command output directly into a persistent file, and that output may contain secrets such as tokens, API keys, credentials, file contents, or other sensitive data produced during failures. In a skill context that captures command errors automatically, this is more dangerous because failures often include verbose diagnostics and echoed inputs, making accidental secret retention likely.
This Python file contains user-facing natural-language strings and comments in Chinese, including the module docstring and function docstrings, without offering a language choice or explaining that the skill is region-specific. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.
This Python file contains user-facing natural-language strings and comments in Chinese, including the module docstring and validation descriptions. Under the policy, forcing a specific language without opt-in or a documented locale-specific reason is a language/locale policy violation.
The correction-detection phrases are broad enough that ordinary clarification or disagreement could be treated as a structured learning event. While less severe than the main trigger issue, it still creates a risk of unnecessary persistence and inaccurate memory formation.
The example learning entry states 'Code comments should use English' and suggests changing comment language to English by default. This is a natural-language locale/language constraint presented without opt-in, alternatives, or a documented region-specific justification, which fits the policy-violation criteria.