T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/memory_manager.py:89- Finding
Persistent Memory Does Not Enforce User Isolation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This looks like a self-learning agent framework, but it gives itself persistent memory, generated-skill deployment, remote upload/deployment paths, and automatic nudges without enough scoping or user-control safeguards.
Review this carefully before installing. Use it only in a controlled single-user environment unless the publisher adds explicit consent gates, per-user data isolation, secret redaction, retention controls, HTTPS allowlists for remote endpoints, safe path validation, and human approval before generated skills, nudges, backups, deletion, sync, or deployment run.
scripts/memory_manager.py:89Persistent Memory Does Not Enforce User Isolation
scripts/memory_manager.py:173Sensitive Interaction Data and Backups Are Stored in Plaintext
scripts/skill_creator.py:247Untrusted Experience Data Can Poison Auto-Generated Skill Instructions
scripts/skill_creator.py:487Unvalidated Skill Names Permit Filesystem Path Traversal
scripts/skill_creator.py:643Configurable Hub Endpoint Can Exfiltrate API Credentials and Skill Content
scripts/self_evolution.py:823Remote Deployment Transmits Tokens and Behavior Models over Configurable Plaintext HTTP
scripts/pattern_recorder.py:112Pattern Recording Consent Control Defaults to Approval
scripts/nudge_system.py:199Proactive Nudges Can Trigger State-Changing Actions Without Fresh Authorization
requirements.txt:1Runtime Network Dependency Is Undeclared and Unpinned
The code chunk only provides the persistent memory portion of the declared system. It does align with the 'cross-session three-layer memory' claim by implementing episodic memory, semantic knowledge storage, and a user model/preferences layer with local persistence. However, there is no code for autonomous learning from experience, no pattern extraction or skill generation, no reinforcement-learning or self-improvement logic, and no trigger/nudge mechanism. Therefore the declared description materially overstates the implemented capabilities relative to this code chunk.
The declared description significantly overstates and mischaracterizes the code. The supplied module is narrowly focused on recording and recalling task patterns, with user confirmation gating storage. It uses SQLite for persistence, computes simple match scores from context, success rate, usage, and recency, and supports basic pattern management operations. There is no evidence of autonomous agent behavior, reinforcement learning, self-evolution, automatic skill generation, layered memory systems, or proactive nudging. While the pattern store could be considered a small supporting piece of a larger learning system, this code chunk by itself does not substantiate the declared framework and instead has a materially different and much narrower purpose.
The code partially matches the declared 'self-evolution' / RL continuous improvement portion: it collects trajectories, computes rewards, trains a simplified policy model, monitors performance, and can deploy/rollback models. However, several major declared features are absent from this chunk: there is no autonomous skill generation, no persistent cross-session memory layer, and no proactive nudge/trigger mechanism. More importantly, the code includes an undeclared capability: remote deployment to staging/production environments using HTTP requests with auth tokens from environment variables, plus health checks. That is a materially different operational capability involving network access and remote system interaction, which is not represented in the description or declared permissions. Therefore the description does not accurately represent the supplied code chunk.
The declared description presents a broad self-improving agent framework with several major subsystems: autonomous learning, reinforcement-learning-based self-evolution, persistent multi-layer memory, and a nudge/proactive trigger system. The supplied code chunk does not implement those broader framework features. Instead, it is a narrower module centered on skill creation from experience patterns. It scans experience records, infers task types heuristically, generates templated skill definitions, performs lightweight simulated validation, stores skills in a local registry, supports rollback, and includes an undeclared HubSync component that uploads/fetches skills over the network using an API key. While 'Skill Creation' is consistent with one declared feature, the actual code materially underdelivers on the main declared framework claims and also adds undeclared remote-sync/marketplace behavior. Therefore the description does not accurately represent this code chunk.
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
1. **Local-Only Storage**: No cloud or external storage
2. **User Consent**: All operations require user awareness
3. **Data Minimization**: Only store necessary information
4. **Easy Deletion**: Users can clear memory anytime
### Data Access Control
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
### Do's ✅
1. **Always confirm with user** before recording
2. **Include clear context** conditions
3. **Track success metrics** actively
4. **Cleanup low-quality patterns** regularly
5. **Use descriptive names** for patterns
clear_all is documented as clearing memory for a single user, but it deletes all episodes and all knowledge globally while only restricting deletion of user_models by user_id. In a multi-user or shared-agent deployment, one user's request could destroy other users' data, causing cross-tenant data loss and denial of service.
The comment states that deployment is simulated, but the implementation imports requests and performs a real HTTP POST with authorization headers and model data. This mismatch is dangerous because reviewers or operators may underestimate the code’s capability, leading to accidental execution of live remote changes and unnoticed data transmission.
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
actions_text = "\n".join([f" {i+1}. {action}" for i, action in enumerate(pattern['common_actions'])])
instructions += f"\n\n## Detected Action Pattern\n{actions_text}"
return instructions
def _generate_triggers(self, pattern: Dict, opportunity: Opportunity) -> Dict:
"""Generate skill triggers."""
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
"""Create isolated sandbox for testing."""
sandbox_dir = tempfile.mkdtemp(prefix='skill_sandbox_')
# Write skill file
skill_path = os.path.join(sandbox_dir, 'SKILL.md')
with open(skill_path, 'w', encoding='utf-8') as f:
f.write(skill.to_skill_md())
The skill presents code and architecture that imply broad capabilities including persistent storage, filesystem interaction, and likely networked components, but it declares no explicit tool scope or permission boundaries. In an autonomous, self-improving agent context, missing capability declarations increase the chance of overbroad execution and reduce a user's ability to assess what the skill may access or modify.
The skill advertises persistent memory and a user model but does not warn users that their inputs, context, and inferred preferences may be stored across sessions. In a system centered on autonomous learning, omission of this notice undermines informed consent and increases privacy and data-governance risk.
The skill describes autonomous skill generation and self-evolution without warning users that behavior may change over time or that new capabilities may be synthesized automatically. That creates governance and safety risk because users may rely on a stable behavior profile while the system can alter itself or expand its functionality.
The interaction capture logic stores full user_input, context, actions, outcome, feedback, and embeddings, then persists them without any stated filtering, minimization, or sensitive-data restrictions. In an autonomous memory system, this can accumulate secrets, personal data, or confidential context that may later be retrieved, exposed in prompts, or mishandled across sessions.
The persistent memory design retrieves user-model data and prior experiences as future context, which can surface private historical information in later prompts or outputs. Because this skill's purpose is cross-session learning and adaptation, the context makes the issue more dangerous: sensitive data is not only retained, but actively reused to influence future behavior.
The documentation promises user awareness and privacy-first handling, but the backup() and restore() examples lack any user identity, consent check, or audit context. In a persistent memory system, restore operations can reintroduce deleted data or import another user's state, creating privacy and integrity risks if implemented as shown.
The usage examples hard-code Chinese text for both user_input and query, which presents the skill as operating in a specific language by default. The document does not state that the memory system is region-specific or provide any user opt-in or language selection, so this is a natural-language locale policy concern.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
2. **Monitor Size**: Keep storage under limit
3. **Backup Important Data**: Before major operations
4. **User Awareness**: Inform users about memory usage
5. **Privacy First**: Never store sensitive data without consent
This markdown file includes a user interaction example entirely in Chinese, including the confirmation phrase the user is expected to provide. Because the document does not offer a language choice or explain that the skill is intentionally region-specific, it implies a fixed language behavior that may violate language/locale policy requirements.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
### Don'ts ❌
1. **Never record without confirmation**
2. **Don't store sensitive information** in patterns
3. **Avoid overly specific patterns** (low reusability)
4. **Don't ignore quality metrics**
The recommendation display hard-codes the agent's user-facing response in Chinese, which can violate language/locale policy when users have not opted into that language. The surrounding documentation does not indicate this is a China-specific skill or provide any mechanism for user language selection.
The code example emits a progress message using Chinese text (执行:), which imposes a specific language for runtime interaction. There is no indication that the language is configurable or that the skill is limited to a Chinese-language context.
The module explicitly promises user awareness and consent, but the implementation performs persistence, retrieval, cleanup, deletion, and backup with no consent, authentication, or authorization enforcement. In a self-improving agent with persistent cross-session memory, this mismatch can lead to silent collection and processing of sensitive user data contrary to user expectations and policy claims.
The example invocation hard-codes Chinese-language user input and outcome strings, which signals a language-specific interaction pattern in the skill file without offering any user choice or documenting this as a justified locale-specific tool. Under the language/locale policy, forcing a specific language without opt-in is a natural-language policy concern.
The scheduler persists nudge metadata and associated data to disk automatically in nudges.json without any consent, disclosure, retention limit, or access control. Because nudge payloads can include experiences and operational context, this creates a privacy and local data-exposure risk if the host is shared, backed up, or inspected by other processes/users.