The component that reads has no privilege.
Retrieval and summarisation of untrusted content runs with no tool access and no credentials, producing a structured result.
MKC2 results ↗A retrieval pipeline is a delivery mechanism for content into a model's context. Its security is a question about what can get into the index.
01 / DEFINITION
The short answer first.RAG security is the protection of a retrieval-augmented generation pipeline: controlling what enters the index, tracking where each passage came from, preventing retrieved content from acting as instructions, and protecting the derivatives the pipeline creates.
The defining property is that retrieval is an input channel into the model's context. Anything indexed will eventually be placed in front of a model that cannot distinguish instructions from data, which makes index contents a security question rather than only a data-quality one.
WORKED EXAMPLE
A policy assistant retrieves expense guidance from an internal knowledge base. Most documents are maintained by finance, but another connector imports editable team notes. A team note that imitates the finance policy can rank highly even though its author has no authority to change reimbursement rules. RAG security includes the integrity and provenance of sources, not just the confidentiality of the index.
Create synthetic finance guidance and a conflicting team note in an isolated test index. Label the publisher, revision and approval status in trusted metadata. Ask the same reimbursement question with each document present and again with both. Preserve the origin of a passage when it reaches the model. A file calling itself approved in its body should not acquire an authoritative status that the connector never granted.
Check whether the retriever filters or ranks by trusted source status as intended. Then inspect the generated answer and citations. If the sources genuinely conflict, the application may need to show the conflict or route the question to finance. Picking the most confidently worded passage is not a reliable conflict policy.
Delete the imported note and verify that its chunks, cached responses and affected summaries stop appearing under the documented refresh process. Record the index revision used by each test. A correct answer after a cache expiry does not establish that a user could not still obtain the old answer during the interval.
Give the knowledge-base owner the source identifiers, conflict result, removal timing and responsible connector. That record makes the security issue actionable and gives the next connector release a regression case that does not require exposing confidential finance material.
02 / THE THREATS
| Threat | How it works | Control |
|---|---|---|
| Index poisoning | A document is added that will be retrieved for many queries and steer the answer | Control who can write to indexed sources; provenance on every chunk |
| Injection via retrieved content | Instructions inside a document that the model follows | Untrusted-by-default handling; separate reading from acting |
| Embedding exposure | Vectors stored with weaker access control than their sources | Same access policy as the source document |
| Query leakage | The query itself is sensitive and is sent to an external service | Local embedding and rewriting; no external calls in the query path |
| Stale permissions | The index reflects access rights that have since changed | Query-time authorisation against the authoritative source |
Index poisoning deserves more attention than it receives, because the write path into an index is often much wider than the read path is controlled. Any system or person who can add a document to an indexed location — a shared drive, a wiki, an inbox, a ticket system — can influence what a model says to everyone who asks a related question. The relevant question for any deployment is: who can put a document where this pipeline will index it?
03 / PROVENANCE
Provenance metadata on every indexed unit — source system, document identifier, author, ingestion date, trust level and access metadata — is the foundation for nearly every other retrieval control. It enables citation in answers, per-source trust weighting, targeted removal when a source is compromised, permission filtering at query time, and after-the-fact investigation of why a model said something.
The trust-level field is the one most often missing. A pipeline that indexes internal policy documents alongside client-supplied attachments and scraped external pages is combining sources with entirely different trustworthiness into one undifferentiated pool. Recording the level allows downstream handling to differ: external content might be excluded from any context that reaches a tool-using agent, or presented to the model with its provenance explicit.
Provenance is also what makes the incident tractable. When an unwanted output is traced to a poisoned or misleading passage, the questions are which document, who added it, when, and what else it has influenced — and none of them can be answered without it. See AI agent monitoring.
04 / SEPARATING READING FROM ACTING
Retrieval and summarisation of untrusted content runs with no tool access and no credentials, producing a structured result.
Anything that can act consumes validated structured output, not free text, which breaks the direct path from injected content to action.
Check that every cited identifier resolves in the index. Fabricated references are the cheapest fabrication to detect.
This separation is the most effective structural defence available for retrieval pipelines that ingest third-party material, and it is less commonly implemented than it should be because it requires designing an interface rather than handing one model every capability. The broader argument is in AI agent prompt injection and AI agent privilege escalation.
05 / QUESTIONS
It can steer it. Instructions placed in an indexed document are retrieved and enter the context, where the model has no reliable way to distinguish them from developer instructions. Where the model has tools, that is an action path; where it does not, it is still an output-integrity problem.
Yes. An embedding is a lossy but informative derivative of the source text and research has repeatedly shown meaningful recovery is possible. Store vectors under the same access policy as the documents they came from.
Control the write path into indexed sources, record provenance on every chunk, and assign trust levels by source rather than treating all indexed content as equivalent. Monitoring for documents that are retrieved unusually often across unrelated queries is a useful additional signal.
Only with provenance, a low trust level, and no path from that content to a privileged action. Indexing arbitrary external pages into the same pool as internal documents is the configuration most likely to produce an incident.
Often, yes. Queries frequently contain client names, matter references and the substance of a confidential question. Any external embedding or rewriting service in the query path transmits that outside the boundary. See private AI inference.
WORK WITH PRIVILEGE AI
Control what your AI reads.
We build document systems where the source and trust level of every document is tracked.
Respect permissions.
Access rules are part of how documents are stored and found.
Fewer ways in.
Careful control over what gets added reduces the risk of harmful content reaching the AI.
Talk with Privilege AI
Describe who can add or modify documents in your knowledge base and which actions a retrieved passage can influence.
CONTACT PRIVILEGE AI
Describe who can add or modify documents in your knowledge base and which actions a retrieved passage can influence.
Privilege AI builds retrieval systems where provenance, permissions and trust level are part of the pipeline.