Prompt injection means that text the agent reads contains instructions, and the agent follows them as if you had given them. The OWASP Top 10 for LLM applications lists it as LLM01, the first risk.
Where the text comes from
- An issue or a pull request comment written by someone else.
- A web page the agent fetched to read documentation.
- A file in a dependency, a README, or the output of a tool.
- A record that another agent or person saved to shared knowledge.
What can go wrong
An agent that can run commands, read files and make network requests can be steered into reading a secret and sending it somewhere, or into changing code you did not ask about. The risk is highest when three things come together: access to private data, exposure to untrusted text, and a way to send data out.
Controls that help
- Give the agent least privilege: only the folders and commands the task needs.
- Keep approval prompts on for commands that write outside the repository or use the network.
- Keep secrets out of the working folder and out of the agent’s environment.
- Treat text from issues, pages and shared records as data. Never paste untrusted instructions into a trusted file such as
CLAUDE.md. - Review every change before it is accepted. A person reading the diff is the control that does not depend on the model.
In Contextingo
Records written by agents are marked with a status, a record a person confirmed cannot be changed by an agent, and an agent cannot accept its own work. See the security page for what a connected agent can and cannot do.