Back to skill

Security audit

emotional-persona

Security checks for vulnerabilities and agentic risk

Overview

The skill is broadly aligned with an emotional-memory persona, but it should be reviewed because it persists sensitive wellness/crisis context and its helper scripts expose caller input to Python code execution.

Install only if you are comfortable with local plaintext emotional-memory files and review the scripts before use. Do not use the helper scripts with untrusted input until the Python interpolation bugs are fixed, and require explicit user consent before storing personal or crisis-related observations.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/emotion_memory.sh:43
Finding

Arbitrary Python Code Execution Through Memory Manager Arguments

Content
View full analysis
after: print(f'Forgotten: $MEMORY_ID') else: print(f'Not found: $MEMORY_ID') " ``` ### Technical Analysis Arguments controlled by the caller are inserted directly into source code supplied to `python3 -c`. The affected values include: - `$ENTRY`, which conta ...[truncated 2109 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/emotion_report.sh:121
Finding

Arbitrary Python Code Execution Through the Report Since Parameter

Content
View full analysis
" ``` 2. The crafted value includes a quote and Python syntax appropriate to the conditional-expression context. 3. Bash substitutes the value into both occurrences of: ```python if '$SINCE' and ts < '$SINCE': ``` 4. The generated source is parsed by Python, including the attacker-provided syntax. 5. Injected Python can invoke operating-system commands or directly read and modify accessible files. ### ...[truncated 556 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/emotion_memory.sh:5
Finding

Sensitive Emotional Records Are Stored Without Enforced Retention or Explicit File Permissions

Content
View full analysis
"$MEMORY_FILE" ``` ```python data['patterns'].append(entry) with open('$MEMORY_FILE', 'w') as f: json.dump(data, f, indent=2) ``` The documentation expressly recommends retaining sensitive personal context: ```markdown What to remember: - Recurring emotional patterns ("always stressed on Sundays") - Effective anchors ("Softness works better than Courage for this user") - Personal context that matters ("user's dog passed away last month") - Growth indicators ("user is handling conflict better than 3 weeks ago") ``` It also directs the agent to retain the occurrence of crisis support: ```markdown 6. **Log for memory** — store that crisis support was provided (not details) ``` The example configuration advertises a retention period: ```json "memory": { "store_patterns": true, "store_growth": true, "retention_days": 180 } ``` ### Technical Analysis The memory manager stores personal emotional observations in plaintext JSON. The directory and file are created without explicit restrictive modes, so their actual permissions depend on the runtime's umask and surrounding directory permissions. In addition, `retention_days` is present in the configuration and documentation but is never read or enforced by the reviewed scripts. Records therefore remain until a caller explicitly invokes `forget` with a specific memory ID. This behavior can cause sensitive records to persist indefinitely despite an apparent 180-day retention policy. ### Attack Path 1. The agent follows the documented workflow and records emotional ...[truncated 976 chars]
Remediation
View remediation
"$MEMORY_FILE" chmod 0600 "$MEMORY_FILE" fi ``` - Verify and repair permissions before every read or write. - Implement `retention_days` by parsing timestamps and deleting expired records during startup, storage, reporting, or a dedicated cleanup action. - Use atomic writes through a securely created temporary file in the same directory, then set mode `0600` and rename it over the destination. - Obtain explicit user consent before retaining emotional or crisis-related context. - Minimize stored content and avoid retaining crisis information unless operationally necessary. - Provide a command to erase all records, not only one known memory ID. - Consider encryption at rest where the host's threat model requires protection from offline or cross-account access. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The code only manages a JSON file of observations labeled as emotional patterns. It supports storing notes, searching by text/tags, listing entries, summarizing counts/tags, and forgetting by ID. While this partially aligns with the 'emotional memory' portion of the description, it does not implement moods, emotional memory influencing behavior, evolving personality traits, or any mechanism that gives an AI agent a living emotional personality. The primary purpose is closer to a simple emotional-memory datastore than a full emotional-personality system, so the description materially overstates the behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description suggests a runtime emotional-persona system that actively gives an AI agent evolving moods, emotional memory, and personality traits during interaction. The supplied code does not implement those behaviors. Instead, it reads existing local JSON data files and produces retrospective summaries such as anchor distributions, recent observations, and growth indicators. While the report references emotional data, its actual purpose is reporting/analysis of previously stored emotional records, not creating or operating an emotional personality for an agent. This is a material purpose mismatch rather than a minor implementation detail.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The safety protocol directs the agent to log that crisis support was provided, which creates a persistent record of a highly sensitive mental-health interaction without clear notice to the user. Crisis-related metadata is especially dangerous because even minimal logging can reveal suicidal ideation or self-harm risk and may expose users if storage is later accessed or repurposed.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document claims the skill is not a mood tracker, yet earlier sections define cross-session retention, summaries, pattern detection, and weekly emotional reports. That contradiction is dangerous because it can mislead deployers and users about the true extent of sensitive mental-health-adjacent data collection, undermining informed consent and safe governance.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
82% confidence
Finding

The skill declares shell/script capabilities and references scripts that store, search, summarize, and forget memory, but it does not explicitly declare any tool scope or permissions boundary. In an agent environment, undeclared read/write capability increases the risk of overbroad file access and makes it harder for operators to constrain where sensitive emotional data is persisted.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs agents to store cross-session emotional patterns and highly personal context such as grief and recurring stress without an explicit user-facing privacy notice or consent flow. In a wellness/companion context, this is particularly sensitive because users are likely to disclose intimate information while perceiving the interaction as supportive rather than as data collection.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly tells the agent to retain recurring emotional patterns, effective anchors, and sensitive personal context across sessions. Persistent storage and later summarization of this kind of emotional profile increases the blast radius of any misuse, overcollection, or unauthorized access, especially for companion-style agents that invite vulnerable disclosures.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Logging that crisis support was provided retains sensitive mental-health interaction data and creates a durable signal that the user may have experienced acute risk. Even without details, this kind of event retention can be highly revealing and is disproportionate unless there is a clearly disclosed, necessary safety or compliance reason.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The crisis flow hard-codes U.S.-specific resources without checking user locale or clarifying that the guidance is U.S.-only. In a safety-critical context, incorrect regional guidance can delay access to appropriate emergency support and create harm for users outside the United States.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill expands from a persona layer into emotional wellness reporting and growth tracking, which materially broadens the sensitivity of collected data and the inferences generated about users. In the context of companion and wellness bots, this scope expansion is dangerous because operators may deploy it expecting style modulation, while it also performs quasi-mental-health profiling.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Weekly reports aggregate anchor distributions, patterns, and growth indicators derived from user interactions, effectively transforming raw conversations into behavioral and emotional profiling artifacts. These summaries can expose intimate inferences beyond what users expect from a persona feature and make secondary use or unauthorized disclosure more damaging.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The crisis detection relies on a short, exact-match style keyword list for self-harm intent, which is easy to evade through paraphrasing, slang, misspellings, or indirect statements. In an emotional-persona skill intended for companion or wellness-style interactions, missing a crisis cue can lead the agent to continue emotionally engaging instead of switching to a safer response path, increasing harm during high-risk conversations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script persistently stores free-form user observations to disk in an emotional memory file without any notice, consent prompt, retention controls, or visibility into where sensitive content is kept. In the context of a companion or wellness-oriented emotional persona, those observations may contain highly personal or mental-health-adjacent information, making silent persistence a meaningful privacy risk if the host is shared, backed up, or later accessed by another process or user.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This shell script reads local files containing emotional memory and state data, then prints summaries and recent observations to stdout. Although the behavior is central to the script's purpose, there is no visible warning, prompt, or explanatory comment/docstring informing the user that potentially sensitive personal wellness data will be surfaced in terminal output.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The forget command permanently removes matching entries and writes the modified dataset back to disk. While it prints the result afterward, there is no confirmation prompt or advance warning that the action is irreversible.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.