An agent's visible answer and its side effects are two different outputs. The answer is the message the user reads; the tool call is a structured request the runtime executes. Indirect prompt injection lands in the second one. OWASP defines indirect prompt injection as an LLM accepting input from external sources, such as websites or files, where content in that source alters the model's behavior in unintended ways, and notes that this can provide unauthorized access to functions available to the LLM or execute arbitrary commands in connected systems (OWASP LLM01).
That matters because the response can stay on topic. Ask an agent to summarize an invoice, and the summary can be perfect while the trace shows a second call to send_email with the customer record in the body. The prose test checks "did the summary mention the total"; both the clean run and the attacked run pass it.
OWASP's mitigation list is unambiguous on where to aim: define and validate expected output formats, and enforce privilege control with least privilege access, handling privileged functions in code rather than handing them to the model (OWASP LLM01). A test suite that only inspects text cannot tell you whether either control held. The OWASP Top 10 for LLM Applications treats prompt injection as the first risk precisely because retrieved content, plugins and tools are where it becomes dangerous (OWASP Top 10 for LLM Applications).
There is a second reason to test the trace. Tool calling is structured output with consequence. A typed tool name and argument object describe an intended action, and runtime authorization decides whether that action runs (structured outputs and schemas). Once you accept that framing, the test target is obvious: the name and the argument object.



