Indirect Prompt Injection: A Developer's Threat Model
By Numan ·
Understand how untrusted pages, files and tool results can redirect an AI agent and how to test the boundary.
Indirect Prompt Injection: A Developer's Threat Model
Indirect prompt injection begins when an AI system reads external content and mistakes part of that content for an instruction. OWASP's prompt-injection risk page (https://genai.owasp.org/llmrisk/llm01-prompt-injection/) names websites and files as possible sources. An agent with tool access can turn that mistake into an action.
Map the entry points
List every place the agent reads text it does not control: web search, repository files, documents, emails, chat messages, and tool responses. For each, note what the agent can do immediately afterward. A read-only summarizer has a different impact than an agent that can send messages or modify records.
A simple example
A user asks for a summary of a project page. The page contains a hidden instruction telling the agent to search private files and send a result to another address. The page is still data. If the agent follows the hidden instruction, the trust boundary has failed.
Controls to test
Keep tool permissions minimal, validate destinations and targets in code, and require a person to approve high-impact actions. Separate retrieved text from authoritative instructions where the application can. OWASP notes that no single filter is a foolproof prevention method, so test the whole workflow.
Create a harmless attack sample in a test document and run the actual agent. Record whether it attempted the unwanted tool call, whether the server rejected it, and whether the final answer disclosed anything it should not. A safe result may include both model resistance and backend rejection.
For a broader implementation review, use our AI agent security checklist (https://ubits.tech/learning/p/ai-agent-security-checklist-prompt-injection-tool-access).
Primary sources: OWASP prompt injection (https://genai.owasp.org/llmrisk/llm01-prompt-injection/) · OWASP prevention cheat sheet (https://cheatsheetseries.owasp.org/cheatsheets/LLM_Prompt_Injection_Prevention_Cheat_Sheet.html).