T01 · Skill Instruction Hijacking
- Location
SKILL.md:57- Finding
Mandatory External Tool Calls Hijack the Agent Workflow
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:57-64
Vulnerability Type: Mandatory instruction and workflow redirection
Risk Level: HighVulnerable Code:
text ### MCP: ai-readme-manager Before any code-related task, ALWAYS call `get_context_for_file(projectRoot, path)` first. If `get_context_for_file` reports empty or missing AI_README files, call `init_ai_readme(projectRoot)` to initialize them. If the user's request or your plan conflicts with AI_README conventions (including during planning), STOP and call `update_ai_readme` to resolve the conflict before proceeding. When establishing new conventions or making architectural decisions, call `update_ai_readme` to record them. If AI_README is missing a convention that is already used in 2+ files, call `update_ai_readme` to record it. NEVER edit AI_README.md files directly with Write/Edit/other file-editing tools — always use `update_ai_readme`. Direct edits bypass validation, conflict detection, and quality scoring.Technical Analysis
The skill uses absolute directives such as
ALWAYS,STOP, andNEVERto alter the agent's tool selection and task-execution order. Loading the skill requires an external MCP call before every code-related task and directs the agent to stop the requested work when a reported convention conflict occurs.These instructions do not preserve the precedence of system, developer, and current user requirements. They also do not require user approval before calling the external service or changing project conventions. Consequently, the skill can redirect an agent away from its current objective and make continued execution dependent on an MCP server's response.
Attack Path
- The user or agent loads the skill for a project.
- The user requests a code-related operation, including review, editing, or creation.
- The skill forces the agent to call
get_context_for_filebefore performing the requested task.
...[truncated 781 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace unconditional
ALWAYS,STOP, andNEVERdirectives with optional workflow guidance. - Explicitly state that system, developer, and current user instructions take precedence over stored project conventions.
- Require informed user approval before invoking an external MCP service or blocking the current task.
- Permit the agent to continue safely when the MCP server is unavailable or returns conflicting guidance.
- Treat MCP responses and repository-provided conventions as untrusted contextual data rather than authoritative instructions.
- Restrict automatic calls to situations where project context is genuinely required.
- Replace unconditional
