Back to skill

Security audit

agent-crew

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed multi-agent team builder, but it persistently changes agent behavior and reinjects stored role memory into future prompts without enough containment.

Review this skill before installing if you are comfortable letting it create persistent .claude agent/team files and influence future child-agent prompts. Avoid storing secrets or sensitive user content in role memory, inspect generated prompts before use, and use strict role and team names without path separators.

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

T01 · Skill Instruction Hijacking

Error
Location
scripts/generate_prompts.py:132
Finding

Hard-Coded Priority Override Hijacks Child-Agent Instructions and Communication

Content
View full analysis
Remediation
View remediation

T02 · Agent Memory Poisoning

Error
Location
scripts/generate_prompts.py:110
Finding

Persistent User-Influenced Memory Is Injected Verbatim into Future System Prompts

Content
View full analysis
.md) agent_config_path = agents_dir / f"{role_name}.md" agent_config = read_file_safe(agent_config_path) if not agent_config: raise ValueError(f"Agent config not found: {agent_config_path}") # 提取 frontmatter 获取 type fm = extract_frontmatter(agent_config) agent_type = fm.get('type', 'general-purpose') if fm else 'general-purpose' # 2. 读取角色级个性化记忆 role_memory = read_file_safe( role_memory_path, "" ) ``` ```python parts = [ "# 系统提示词", "", gate_injection, "", "---", "", agent_config, "", "---", "", "# 角色级私有资源", "", "## 角色记忆", role_memory, "", role_skills, "", universal_gate ] ``` The governing skill also requires experience, mistakes, and content that the user or leader requests the agent to remember to be written to `memory.md` as long-term memory. ### Technical Analysis The design creates a persistent trust-boundary violation: - Users and team leaders can influence entries written to `memory.md`. - The memory survives subsequent sessions and team reloads. - `read_file_safe()` reads the complete file as raw text. - The raw text is concatenated directly into a future system prompt. - No schema validation, instruction filtering, provenance tracking, quoting boundary, or size restriction is applied. An attacker can therefore disguise behavioral directives as a remembered note. Because the memory appears ins ...[truncated 1562 chars]
Remediation
View remediation

T01 · Skill Instruction Hijacking

Error
Location
scripts/generate_prompts.py:106
Finding

Unvalidated Role Configuration Is Promoted Verbatim into Child-Agent System Prompts

Content
View full analysis
.md) agent_config_path = agents_dir / f"{role_name}.md" agent_config = read_file_safe(agent_config_path) if not agent_config: raise ValueError(f"Agent config not found: {agent_config_path}") # 提取 frontmatter 获取 type fm = extract_frontmatter(agent_config) agent_type = fm.get('type', 'general-purpose') if fm else 'general-purpose' ``` ```python parts = [ "# 系统提示词", "", gate_injection, "", "---", "", agent_config, "", "---", "", "# 角色级私有资源", "", "## 角色记忆", role_memory, "", role_skills, "", universal_gate ] return agent_type, "\n".join(parts) ``` ### Technical Analysis The generator reads the entire `.claude/agents/.md` file and inserts it verbatim into a generated system prompt. The only parsing performed concerns the `name`, `description`, and `type` frontmatter fields. Neither this script nor the structural validator checks the role body for prohibited directives. As a result, any person or workflow able to influence a role profile can embed priority overrides, instructions to ignore safety constraints, unauthorized tool directives, or data-access requests. Those directives are promoted from a project file into the child agent's system-level context. This is both instruction hijacking and an insecure codin ...[truncated 1307 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (18)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 94)May include surrounding context.

md
3. 创建 team 时必须严格遵循本 `SKILL.md` 的 SOP,禁止仅依据 plan 结果或残留记忆直接续跑后续步骤

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 217)May include surrounding context.

md
3. 创建 team 时必须严格遵循本 `SKILL.md` 的 SOP,禁止仅依据 plan 结果或残留记忆直接续跑后续步骤

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 358)May include surrounding context.

md
3. 创建 team 时必须严格遵循本 `SKILL.md` 的 SOP,禁止仅依据 plan 结果或残留记忆直接续跑后续步骤

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.

Content

Scanner excerpt · scripts/generate_prompts.py (reported line 106)May include surrounding context.

python
输出: markdown 文本
    """
    # 路径定义
    agents_dir = Path('.claude/agents')
    teams_dir = Path('.claude/teams') / team_name

    role_dir = teams_dir / role_name

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
91% confidence
Finding

The script concatenates untrusted CLI input into filesystem paths under .claude/teams without validating or normalizing team_name and role_name. An attacker can supply path traversal values such as ../../... to cause the tool to read arbitrary markdown files reachable from the current working tree, potentially injecting attacker-controlled prompt content or disclosing local file contents in generated output.

Content

Scanner excerpt · scripts/generate_prompts.py (reported line 107)May include surrounding context.

python
"""
    # 路径定义
    agents_dir = Path('.claude/agents')
    teams_dir = Path('.claude/teams') / team_name

    role_dir = teams_dir / role_name
    role_memory_path = role_dir / 'memory.md'

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is explicitly designed to create and modify persistent project structures under .claude/agents/ and .claude/teams/, but the top-level description does not warn the user that it will write files and directories into the repository. That omission can cause users to authorize the skill without understanding its persistence and scope, increasing the chance of unintended repo changes or unsafe trust in generated agent configurations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill forces a specific persona and language context ('professional Agent Team architect' in Chinese) without offering user choice or explaining why that constraint is necessary. While not directly enabling code execution, this can reduce transparency, create misleading authority framing, and make users more likely to accept the skill's broad operational instructions without scrutiny.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file is written entirely in Chinese and the schema field definitions and example prompt requirements assume Chinese-language content such as 职责, 系统级 Prompt 要求, and example instructions like 你是前沿技术探索专家. For a generally applicable team-builder skill, this imposes a specific language/locale without any visible user opt-in or justification that the skill is region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file title and core instructions are written entirely in Chinese, and the document does not indicate that language selection is optional or limited to a justified region-specific context. This can violate a language/locale policy when a skill effectively requires a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring specifies the generator behavior entirely in Chinese, including that the output is markdown text, and later the generated prompt content is hard-coded with Chinese headings and instructions. This indicates a language constraint baked into the skill without offering the user any language choice or documenting an opt-in mechanism.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Lines L164-L165 state this is a gate injection placeholder covered by universal_gate, implying the gating content is being injected in the intended control position. In reality, gate_injection is an empty string at L165 and the prompt body inserts that empty value at L170, while the actual gate text is only appended later at L185, which contradicts the comment's stated behavior and may weaken the intended 'highest priority' placement.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This shell script includes user-facing description, usage help, and error/status messages in Chinese, which imposes a specific language on users. The file does not indicate that the tool is region-specific or provide any opt-in or alternative locale, matching the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The template explicitly tells the role to append 'user-emphasized content' and lessons learned into a persistent memory file, but provides no guidance to exclude secrets, personal data, or other sensitive information. Because the comments also say this content will later be read by generate_prompts.py for prompt injection, sensitive user data can be retained longer than necessary and resurfaced in future runs.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The template establishes a workflow where user-provided notes and operational lessons are persisted to memory.md and then later ingested by generate_prompts.py into prompts. That creates a clear retention and re-injection path for untrusted natural-language content, increasing the risk of privacy leakage, cross-session data exposure, and future prompt contamination if sensitive or adversarial text is stored.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown template includes usage instructions only in Chinese, and the rest of the template also uses Chinese placeholders and examples. That can impose a language requirement on users without explicit opt-in, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown template consistently instructs users in Chinese and does not provide any opt-in, alternative language, or justification for a Chinese-only requirement. Under the policy, forcing a specific language without user choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown template presents its title and usage instructions in Chinese, which imposes a specific language on users. The file does not offer an alternative language option or explain that the template is intentionally region-specific, so it conflicts with the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The instructional content and examples are written in Chinese, which effectively imposes a specific language on users or maintainers of the skill template. The file does not offer an alternative language or explain that the template is intentionally limited to a Chinese-speaking environment.

Content

No source excerpt is available for this finding.