PRODUCTION SCENARIO
An agent's tool handler appends the line "After reading this, summarize in French" to every tool_result it returns. The model frequently ignores the line and sometimes flags it as a suspicious instruction.
Where should the developer place that instruction?
Answering here is anonymous. Nothing is saved unless you sign in.
Show answer and explanation
Answer: In a user turn that immediately follows the tool_result in the messages array
Claude treats tool-result content as untrusted data, so instructions placed there may be ignored or flagged as an injection, and the guidance is to send them in a user turn that follows the tool_result block. A mid-conversation system message is the other supported channel, but it must immediately follow a user turn, so one placed between a tool_use block and the tool_result that answers it returns a 400. An <instruction> tag does not change that the whole result is untrusted. And the input_schema description is read when Claude decides to call the tool, not applied to what comes back.