T01 · Skill Instruction Hijacking
- Location
scripts/generate_prompts.py:132- Finding
Hard-Coded Priority Override Hijacks Child-Agent Instructions and Communication
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
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.
scripts/generate_prompts.py:132Hard-Coded Priority Override Hijacks Child-Agent Instructions and Communication
scripts/generate_prompts.py:110Persistent User-Influenced Memory Is Injected Verbatim into Future System Prompts
scripts/generate_prompts.py:106Unvalidated Role Configuration Is Promoted Verbatim into Child-Agent System Prompts
Referenced artifact was not completely inspected
3. 创建 team 时必须严格遵循本 `SKILL.md` 的 SOP,禁止仅依据 plan 结果或残留记忆直接续跑后续步骤
Referenced artifact was not completely inspected
3. 创建 team 时必须严格遵循本 `SKILL.md` 的 SOP,禁止仅依据 plan 结果或残留记忆直接续跑后续步骤
Referenced artifact was not completely inspected
3. 创建 team 时必须严格遵循本 `SKILL.md` 的 SOP,禁止仅依据 plan 结果或残留记忆直接续跑后续步骤
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.
输出: markdown 文本
"""
# 路径定义
agents_dir = Path('.claude/agents')
teams_dir = Path('.claude/teams') / team_name
role_dir = teams_dir / role_name
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.
"""
# 路径定义
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'
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.