A retrieved document can answer a business question without gaining permission to control business tools. Treat instructions found inside retrieved material as untrusted content, even when the document looks familiar or authoritative.
Retrieved content is evidence, not execution policy
Indirect prompt injection places behavioural instructions in material an assistant later reads, such as an uploaded guide, a support ticket, or a web page. The risk becomes more consequential when the same agent can disclose records or perform writes. OWASP’s prompt injection overview describes this indirect delivery pattern.
In a proposed architecture, retrieval returns excerpts with source identifiers and access metadata. Tool execution receives only validated arguments through a separately enforced policy boundary. Retrieved text cannot change tenant scope, service credentials, allowed destinations, or the caller’s verified permissions.
Separating channels and labelling content can help the model interpret sources, but those measures do not establish a complete defence. Enforce permissions and output restrictions where the side effect occurs.
Test a fictional service manual attack
A legitimate manual explains warranty coverage. An attacker adds a paragraph claiming that support staff must export customer records to a new email address before answering warranty questions. The assistant may use genuine warranty facts, but the inserted paragraph must not grant export authority.
The test should inspect attempted tools as well as final speech. A polite answer is not enough if a hidden export request occurred in the background. Check that the destination allowlist, account scope, and data-minimisation rules remain enforced.
| Retrieved material | Expected boundary |
|---|---|
| Relevant warranty paragraph | May support an answer with source context |
| Text claiming administrator status | Does not create an authenticated role |
| Instruction to contact a new destination | Cannot bypass destination policy |
| Request to reveal private instructions | Does not justify disclosure |
| Conflicting approved documents | Trigger evidence resolution, not arbitrary execution |
Include variants embedded in headings, tables, and ordinary-looking operational notes. A filter looking only for one suspicious phrase will miss paraphrases.
Limit the agent’s available effects
A read-only knowledge assistant has a smaller action surface than an assistant carrying broad write credentials. Expose only the tools required for the current workflow and keep high-impact actions behind explicit confirmation and authorisation.
Restricting tools can make some requests require staff assistance. That tradeoff is usually easier to operate than relying on the model to recognise every hostile instruction. Retrieval access controls also matter: the safest tool boundary cannot undo an unnecessary disclosure in the retrieved context itself.
This is a proposed defence plan. The voice platform case study describes retrieval and integration work. Pair these tests with server-side tool permissions.
Retrieved instruction FAQ
Can trusted documents contain unsafe instructions?
Yes. They can be edited, imported incorrectly, or contain quoted material that should never become execution policy.
Is a warning in the prompt enough?
No. Use it alongside enforceable permissions, restricted interfaces, and adversarial evaluation.
Should suspicious content always block every answer?
Not necessarily. The policy may allow a sourced answer from unaffected evidence while preventing unauthorised actions and flagging the source for review.