Retrieval augmented generation
RAG / train it on our documents / knowledge base for AI / grounding an AI in your content
Retrieval augmented generation is how an AI answers from your documents without being trained on them. OWASP describes it as combining a pre-trained model with external knowledge sources at answer time. So the documents sit in a store the system reads from, and who can read that store is the question.
Start with what it is not. OWASP describes retrieval augmented generation as a model adaptation technique that improves the performance and contextual relevance of responses by combining pre-trained language models with external knowledge sources. The model is not retrained. Your documents are converted into a form the system can search, and the relevant pieces are pulled in at the moment a question is asked.
That distinction decides which questions matter. Nothing has been baked into a model somewhere. There is a store holding your material, and the real subject is who is allowed to read it.
OWASP names three ways that goes wrong, and the first is the one to raise with any vendor selling a shared product. In multi-tenant environments where several classes of users or applications share the same vector database, there is a risk of context leakage between users or queries. Second, attackers can invert embeddings and recover significant amounts of source information, so the common reassurance that the store holds only mathematical representations rather than your documents is not by itself a guarantee. Third, poisoned data can arrive from insiders, prompts, data seeding or unverified data providers.
There is also an effect nobody warns you about. OWASP notes that retrieval augmentation can alter the underlying model's behavior, and that while factual accuracy and relevance may increase, qualities like emotional intelligence or empathy can diminish. An assistant that becomes more correct can become worse at handling an upset customer.
NIST supplies the standard the store has to meet. It says systems that maintain confidentiality, integrity and availability through protection mechanisms preventing unauthorized access and use may be said to be secure, and lists among common security concerns the exfiltration of models, training data or other intellectual property through AI system endpoints. The endpoint is the assistant itself.
In practice
OWASP's own first remedy is the one to ask for by name: fine-grained access control, so that retrieval respects who is asking. Without it, an assistant that can see everything answers everyone as though they were entitled to everything, and the person who finds that out is usually a customer or a junior member of staff.
Not the same as
- Training or fine-tuning
- Those change the model. This leaves it alone and hands it material at question time.
- Prompt injection
- That is an instruction arriving in content. This is about what the system is able to fetch and show.
Why it matters to you
The phrase you will hear is that they will train it on your documents, and it is almost never what is happening. Knowing the real arrangement changes the contract you should be asking for, because the risk does not sit in the model. It sits in a searchable copy of your files, whose access rules somebody chose, and which can be asked questions by anyone the assistant will talk to.
What to ask or check
- 01Is the store shared with other customers, and what separates them?
- 02Does retrieval respect who is asking, or can the assistant see every document?
- 03When a file should stop being visible, what removes it, and how quickly?
What people get wrong
That the documents have been trained into the model and are therefore gone from view. OWASP describes external knowledge sources combined with a pre-trained model, and notes that embeddings can be inverted to recover significant amounts of source information.
Red flags
- A shared knowledge store with no answer about what separates one customer from another.
- An assistant with one level of access to everything, answering everybody.
- No process for removing a document from retrieval when it should no longer be visible.
Who owns it
Whoever configures the store and its access rules. NIST puts the standard on the deployed system: confidentiality maintained by mechanisms that prevent unauthorized access and use.
Where you will see it
In every proposal that offers an assistant trained on your policies, prices, manuals or past tickets.