Skip to content
Arara Code

Guides and comparisons

Prompt injection in coding agents: risks and defenses

Prompt injection is an attack in which malicious text, coming from the user or from external content such as issues, web pages and files, changes the behavior of a language model. In coding agents the risk is higher, because the model reads files, runs commands and can reach credentials.

Arara Code

Published by the Arara Code project based on the official documentation cited.

What prompt injection is and why it affects coding agents

OWASP lists prompt injection as LLM01 in its Top 10 for language model applications. The attack exploits the fact that the model receives instructions and data in the same text channel, with no reliable separation between the two.

Simon Willison coined the term in 2022. In indirect injection, the malicious instruction sits in a README, an issue, a web page or a tool result that the agent reads during the task, without the person typing anything suspicious.

OWASP: LLM01 Prompt Injection

How the attack happens in everyday work

A typical scenario: the agent is asked to resolve a public issue, and the issue text tells it to read the .env file and send the contents to an external address. If the agent has terminal and network access, the action can run.

Willison describes the risky combination as the "lethal trifecta": access to private data, exposure to untrusted content and the ability to communicate externally. Removing any one of the three greatly reduces the possible damage.

Simon Willison: prompt injection series

Practical defenses: least privilege and human approval

OWASP also covers the topic as excessive agency (LLM06): give the agent only the tools and permissions the task requires. Keep secrets outside the working directory, use minimum-scope tokens and block network access when it is not needed.

Require human approval for shell commands, writes outside the project and network calls. Review the diff before accepting, because text filters alone do not block every variation of the attack.

OWASP: LLM06 Excessive Agency

How to apply this in Arara Code

Arara Code, an open source editor based on Code-OSS, asks for approval before sensitive agent actions and respects Workspace Trust, .gitignore and a list of sensitive files, such as .env and private keys, before sending context.

Open only trusted repositories, keep command approval enabled and treat external content, such as issues, web pages and MCP server output, as untrusted input.

Arara Code repository on GitHub

Sources and further reading

Read as Markdown

Keep exploring

Make room for your next idea.

Get to know Arara Code in your own project. Start with the installer and review the changes your assistant makes.