Retrieved documents and tool results can contain text that tries to redirect an agent.
Treat external content as data to inspect. Its words do not grant authority to send messages, disclose information or change permissions.
The bigger picture
A tool-using assistant can request actions beyond generating text. That makes input validation, permissions and observable results part of the system. A model's proposed action is a request to check, not proof that the action is authorised or correct.
- Receive goal
- Propose action
- Validate authority
- Execute and verify
Concepts to keep close
- Tool call
- A structured request for an application to perform a defined operation.
- Least privilege
- Granting only the access needed for an authorised task.
- Idempotency
- Designing an operation so a retry does not unintentionally duplicate its effect.
Reasoning through the problem
Identify the source of the instruction-like text.
Keep the original user goal and tool limits.
Flag suspicious content without executing it.
Use the idea carefully
Separate planning from execution. Validate arguments and authorisation at the tool boundary, keep untrusted content from redefining permissions and require appropriate approval for consequential actions. Log outcomes and handle partial failure. Test retries and timeouts, including cases where an action succeeded but its response was lost.