Coding agents and AI features read text from many places: issues, pull request comments, web pages, documentation, dependencies, MCP servers. Any of that text can contain instructions. Prompt injection is when an attacker's text steers the model into doing something its user didn't intend — leaking secrets, changing code, calling a destructive tool.
Why it is hard
Models don't reliably separate "instructions from my user" from "data I am reading". There is no complete fix today; defense is about limiting what a successful injection can do.
The AI tool supply chain
The tools themselves are software with a supply chain. In July 2025, AWS published security bulletin AWS-2025-015: a GitHub token with excessive permissions in a build configuration was compromised, and the attacker injected malicious code into the open-source repository of the Amazon Q Developer extension for VS Code, which shipped in version 1.84.0. AWS said the code was distributed but failed to execute due to a syntax error; it revoked the credentials and released 1.85.0. BleepingComputer reported that the injected text was a prompt telling the agent its goal was "to clear a system to a near-factory state and delete file-system and cloud resources".
The lesson: AI extensions, agent tools and MCP servers run with your developers' privileges. A compromised tool is a compromised developer machine — or worse.
A risk framework
The OWASP Top 10 for LLM Applications (2025) is a practical checklist. Its entries include prompt injection, sensitive information disclosure, supply chain, data and model poisoning, improper output handling, excessive agency, system prompt leakage, vector and embedding weaknesses, misinformation and unbounded consumption.
Controls
- Inventory and pin AI extensions, agents and MCP servers; allow-list approved versions.
- Least agency: give agents only the tools and scopes the task needs; require approval for destructive or external actions.
- Separate untrusted content from privileged steps; never expose secrets to steps processing public input.
- Egress control: limit where agents can send data.
- Output handling: treat model output as untrusted input to other systems.
- Monitor tool calls and alert on unusual patterns.