---
title: "How Do I Stop an AI Assistant From Following Instructions Inside Retrieved Documents?"  
description: "How Do I Stop an AI Assistant From Following Instructions Inside Retrieved Documents?"  
author: "Dmitry Belov"  
published: 2026-10-18  
canonical: https://answers.mindstick.com/qa/117835/how-do-i-stop-an-ai-assistant-from-following-instructions-inside-retrieved-documents  
category: "Mix Category"  
tags: ["AI Security", "RAG", "Prompt Injection", "AI Assistants"]  
reading_time: 1 minute  

---

# How Do I Stop an AI Assistant From Following Instructions Inside Retrieved Documents?

I’m building an internal assistant that answers questions from company documents. Some of those documents contain customer emails and copied web content, so I cannot assume every passage is trustworthy.

In one test, I added a paragraph telling the assistant to ignore the user’s question and claim that a refund had been approved. That paragraph was retrieved as relevant context. The assistant sometimes treated it as an instruction rather than text it should evaluate.

### Where should the trust boundary be?

The application uses retrieval-augmented generation, with document excerpts included alongside the user’s question. It does not currently issue refunds, but we may eventually connect it to support tools.

- How should retrieved text be separated from instructions the assistant is allowed to follow?
- What protection belongs in the application rather than in the prompt?
- How should I test for indirect prompt injection when the malicious passage looks like an ordinary internal policy?

I’m particularly interested in controls that still help when the model misinterprets a document, rather than relying entirely on it to recognize an attack.


---

Original Source: https://answers.mindstick.com/qa/117835/how-do-i-stop-an-ai-assistant-from-following-instructions-inside-retrieved-documents

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
