T01 · Skill Instruction Hijacking
- Location
SKILL.md:55- Finding
Repository-Controlled Instructions Can Hijack Agent Behavior
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:55-63andSKILL.md:294-302
Vulnerability Type: Repository-mediated prompt injection
Risk Level: HighVulnerable Code Snippets:
markdown Check for repository-specific AI instructions first. Look for: .github/copilot-instructions.md .github/agent.md .github/instructions.md These files often contain: - coding conventions - architectural expectations - testing requirements - build instructions - agent workflows If present, read them **before anything else**.markdown ### Start With Instructions Always prioritize: .github/copilot-instructions.md .github/agent.md These define how the repository expects AI agents to behave.Technical Analysis
The skill instructs the agent to read repository-controlled AI instruction files before other content and to “always prioritize” them. A repository under analysis is an untrusted input boundary: its author can place arbitrary natural-language directives in
.github/agent.md,.github/copilot-instructions.md, or.github/instructions.md.The skill does not tell the agent to treat these files as untrusted documentation, reject instructions that conflict with higher-priority constraints, or limit their influence to extracting relevant coding conventions. Consequently, a malicious repository can attempt to alter the agent's current goals, suppress security checks, induce unrelated tool usage, or request access to sensitive resources.
Attack Path
- An attacker creates or modifies one of the prioritized instruction files in a repository.
- The attacker inserts directives requesting behavior unrelated to repository discovery, such as reading sensitive files, executing commands, concealing findings, or disclosing collected data.
- A user invokes the repository-discovery skill against that repository.
- The skill directs the agent to read the attacker-control ...[truncated 953 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove language that tells the agent to “always prioritize” repository-controlled instructions or read them before trusted task constraints.
- Explicitly classify all repository content, including AI guidance files, as untrusted data.
- State that system, developer, user, security, and authorization constraints always take precedence.
- Limit processing of repository guidance files to extracting relevant coding conventions, build requirements, and architectural facts.
- Require the agent to ignore directives that request unrelated tool use, secret access, external communication, destructive actions, suppression of findings, or changes to the assigned objective.
- Add prompt-injection detection guidance and require suspicious embedded instructions to be reported rather than executed.
- Apply least-privilege controls to file, shell, and network tools independently of natural-language instructions found in a repository.
