Back to skill

Security audit

Shiyi Proactive Agent

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed proactive assistant, but it reads shared workspace memory and recent interaction history and writes task/log files by default with broad monitoring scope.

Review before installing. Use it only in a workspace where it is acceptable for the skill to read agent memory, recent interaction history, planning files, and content metadata, and to write task/log files under memory. Do not run daemon or heartbeat integration unless you want repeated background checks. Treat trading/content suggestions as advisory only; the reviewed code did not execute trades or publish content.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/context_analyzer.py:12
Finding
Workspace Memory and Recent Interaction History Exposed Through Context Analysis<![CDATA[ ## Vulnerability Details **File Location**: `scripts/context_analyzer.py:12-27, 54-69, 148-151` **Vulnerability Type**: Unauthorized access to Agent memory and interaction history **Risk Level**: Medium ### Vulnerable Code ```python class ContextAnalyzer: def __init__(self, base_path=None): self.base_path = base_path or Path(__file__).parent.parent.parent self.memory_path = self.base_path / "memory" self.learning_path = self.memory_path / "learning" def get_current_context(self): context = { "timestamp": datetime.now().isoformat(), "time_slot": self._get_time_slot(), "day_of_week": datetime.now().strftime("%A"), "is_weekday": datetime.now().weekday() < 5, "pending_tasks": self._get_pending_tasks(), "recent_interactions": self._get_recent_interactions(), "active_projects": self._get_active_projects(), "market_status": self._get_market_status(), "content_status": self._get_content_status() } return context ``` ```python def _get_pending_tasks(self): tasks = [] memory_file = self.memory_path / "MEMORY.md" if memory_file.exists(): content = memory_file.read_text(encoding="utf-8") import re todos = re.findall(r'- \[ \] (.+)', content) tasks.extend(todos) return tasks def _get_recent_interactions(self): interactions_file = self.learning_path / "interactions.json" if interactions_file.exists(): with open(interactions_file, 'r', encoding='utf-8') as f: interactions = json.load(f) return interactions[-5:] if interactions else [] return [] ``` ```python analyzer = ContextAnalyzer() if args.json: print(json.dumps(analyzer.get_current_context(), ensure_ascii=False, indent=2)) ``` ### Technical Analysis The default `base_path` resolves to three directory levels above the script rather than re ...[truncated 2399 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Use Skill-local storage by default** - Resolve the default base directory to the project root rather than its parent workspace. - Do not implicitly access shared `memory`, `planning`, or `content` directories. 2. **Require explicit authorization** - Add command-line options for every external data source. - Require the caller to provide an approved memory or interaction-history path. - Disable interaction-history collection unless the user explicitly opts in. 3. **Apply data minimization** - Return only counts or predefined non-sensitive metadata where possible. - Do not include raw interaction objects in context output. - Define an allowlist of permitted fields rather than serializing complete records. 4. **Redact sensitive information** - Remove credentials, tokens, personal data, message bodies, and confidential identifiers before producing output. - Provide a separate privileged debugging option if raw data is genuinely required. 5. **Constrain file access** - Resolve paths canonically and verify that they remain inside an explicitly approved directory. - Reject symbolic links or resolved paths that escape the allowed data root. - Apply reasonable file-size and record-count limits before loading JSON or text files. 6. **Separate summaries from raw data** - Ensure normal CLI output contains only sanitized summaries. - If raw context export is required, clearly label it as sensitive and require an explicit confirmation or authorization control. ]]>
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (21)

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill advertises scripts that analyze context and auto-save proposed tasks, and the static analysis detected file read/write capabilities, but the manifest declares no explicit tool scope or permissions boundary. In an agent ecosystem, this can lead to overbroad access and unclear operator expectations, increasing the chance that the skill reads or writes local data beyond what users intended.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The description says the agent 'anticipates needs and takes initiative' and 'monitors environment' without clear activation criteria, stop conditions, or user-approval gates. In a proactive skill, ambiguous trigger language can cause an orchestrator or user to invoke it too broadly, leading to unnecessary monitoring, unsolicited actions, or action recommendations in sensitive contexts like trading.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The README introduction repeats broad proactive behavior without defining operational boundaries, reinforcing the risk that the skill is treated as always-on or universally applicable. Because the skill also references monitoring, task initiation, and suggestions tied to market activity, unclear boundaries can increase the likelihood of intrusive or high-consequence behavior.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The documentation describes daemon/background monitoring and task auto-save behavior but does not warn about resource usage, persistence, file modification, privacy implications, or how alerts are throttled in practice. Users may enable continuous monitoring without understanding that the skill may repeatedly inspect context and write files over time, which increases operational and data-handling risk.

Natural-Language Policy Violations

Medium
Confidence
81% confidence
Finding
The natural-language labeling in this file is entirely in Chinese, and there is no indication that language choice is configurable or based on user preference. This can violate a language or locale policy when the skill imposes a specific language without explicit user opt-in or documented regional justification.

Vague Triggers

Medium
Confidence
89% confidence
Finding
This manifest enables monitoring across very broad domains such as "time," "market," "content," "tasks," and "learning" without defining explicit trigger boundaries or exclusion conditions. Because the file does not specify when these domains should not activate, the proactive behavior could be invoked more broadly than intended.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
- learning  # 学习优化

# 自动执行权限
auto_execute:
  - reminders  # 提醒
  - research  # 研究
  - preparation  # 准备工作
Confidence
85% confidence
Finding
The configuration authorizes autonomous execution of reminders, research, and preparation without an approval gate. In a proactive agent context, this can cause the system to take initiative based on inferred context, potentially triggering unwanted external interactions, excessive data gathering, or cascading task execution without clear user consent.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This code's user-facing natural-language description and all visible suggestions are hard-coded in Chinese, with no indication that users can select another language or opt in to this locale. The policy explicitly calls for flagging language or locale constraints when a specific language is forced without user choice.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This code contains natural-language descriptions in Chinese and later presents user-facing CLI help and printed output in Chinese only. That creates a language/locale policy concern because the skill forces a specific language without user opt-in or any documented region-specific justification.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The file’s natural-language description states the skill as a Chinese-language '主动监控器', and all user-facing CLI messages throughout the script are hardcoded in Chinese. There is no visible user opt-in, locale selection, or documentation justifying a Chinese-only interface, which can violate language/locale policy requirements.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
This file contains user-facing natural-language descriptions and CLI help text in Chinese, beginning with the module docstring and continuing throughout the script. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified, which is not present here.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
"查看小红书昨日数据",
                    "确认今日待办事项"
                ],
                "auto_execute": False
            },
            "trading": {
                "name": "交易监控",
Confidence
85% confidence
Finding
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.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
"查看小红书昨日数据",
                    "确认今日待办事项"
                ],
                "auto_execute": False
            },
            "trading": {
                "name": "交易监控",
Confidence
85% confidence
Finding
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.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
"查看小红书昨日数据",
                    "确认今日待办事项"
                ],
                "auto_execute": False
            },
            "trading": {
                "name": "交易监控",
Confidence
85% confidence
Finding
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.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
"查看小红书昨日数据",
                    "确认今日待办事项"
                ],
                "auto_execute": False
            },
            "trading": {
                "name": "交易监控",
Confidence
85% confidence
Finding
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.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
"查看小红书昨日数据",
                    "确认今日待办事项"
                ],
                "auto_execute": False
            },
            "trading": {
                "name": "交易监控",
Confidence
85% confidence
Finding
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.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
"查看小红书昨日数据",
                    "确认今日待办事项"
                ],
                "auto_execute": False
            },
            "trading": {
                "name": "交易监控",
Confidence
85% confidence
Finding
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.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
"查看小红书昨日数据",
                    "确认今日待办事项"
                ],
                "auto_execute": False
            },
            "trading": {
                "name": "交易监控",
Confidence
85% confidence
Finding
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.

Description-Behavior Mismatch

Medium
Confidence
92% confidence
Finding
The manifest describes a proactive agent that monitors context, suggests actions, and proposes tasks. This file goes beyond proposing by creating a persistent task database and mutating task status in `proactive_tasks.json`, which is a state-management capability not stated in the manifest description.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
The example output presents user-facing content in Chinese, but the document does not state that the skill is Chinese-only or allow the user to choose their preferred language. This can violate language/locale policy expectations when a skill implicitly forces a language without opt-in.

Intent-Code Divergence

Low
Confidence
88% confidence
Finding
The top-level docstring says "任务发起器 - 主动提出并执行任务" (proactively propose and execute tasks), but no code in this file actually executes task steps or carries out external actions. The implementation manages task metadata and status only, creating a direct mismatch between the documented intent and the behavior.

Static analysis

No suspicious patterns detected.