Private AI infrastructure
Private RAG for Regulated Industries: Architecture and Security Guide
By Michael P. Goodman · Published · Updated · 8 min read
A private RAG system answers questions from your own documents using a language model that runs entirely inside your security boundary. Documents, embeddings, prompts, and answers never reach a third-party API. For law, healthcare, and finance, the hard part is not the model. It is making sure the system only retrieves what each user is allowed to see, and proving it afterward.
This guide walks through the architecture I use for private enterprise RAG, the controls that matter in regulated environments, and the mistakes that most often undo them. It pairs with my guide to secure local LLM deployment, which covers hardening the inference host itself.
This is engineering guidance, not legal advice. Which rules apply to you depends on your data and your jurisdiction, so confirm requirements with your compliance counsel.
Key takeaways: private RAG
- Keep every stage of the pipeline (ingestion, embedding, vector store, retrieval, generation) inside one controlled boundary.
- Enforce document-level permissions at retrieval time, using metadata filters. Never rely on the prompt to hide content.
- Treat embeddings and the vector store as sensitive as the source documents.
- Treat retrieved text as untrusted input, because documents can carry instructions meant for the model.
- Require citations, log every retrieval, and make deletion propagate to the index.
What is private RAG?
Retrieval-augmented generation (RAG) gives a language model relevant passages from your own content at question time, so answers are grounded in your documents instead of only in what the model learned during training. The model reads the retrieved passages and writes an answer, ideally with citations to them.
"Private" means the whole chain runs on infrastructure you control, whether that is on-premises hardware or a private network you manage. No document text, embedding, or prompt is sent to an outside service.
Why do regulated organizations need it?
- Confidentiality duties: client files, patient records, and account data often cannot be disclosed to additional processors without contracts, assessments, and approvals.
- Data residency: some data must stay in a defined location or under defined administrative control.
- Auditability: you must show who accessed what, and answer questions about it later.
- Control over change: you decide when models and indexes change, and you can freeze a version for a review.
What does private RAG not solve?
Running locally removes one class of exposure, the third-party provider. It does not fix weak access control, poor document hygiene, or a model that follows instructions hidden in a file. Those are design problems, and they are the subject of the rest of this guide.
What does a private RAG reference architecture look like?
A typical private RAG pipeline has six stages, all inside the boundary:
- Sources: file shares, document management systems, email archives, or databases. Connect read-only and use a service account with the narrowest scope that works.
- Ingestion: extracts text, cleans it, and splits it into chunks. This is where document permissions must be captured.
- Embedding: a locally hosted embedding model turns each chunk into a vector.
- Vector store: stores vectors alongside the text and its metadata (source, owner, classification, and the groups allowed to read it).
- Retrieval service: takes a question and the user's identity, filters by permission, and returns the best-matching chunks.
- Generation: a local language model answers using only the retrieved chunks and returns citations.
Put an authenticated gateway in front of the retrieval and generation services, and block outbound internet access from the hosts that run them. The network and host controls are the same ones described in the local LLM hardening guide.
How do you enforce who can see what?
This is the control that matters most. A RAG system can quietly become a search engine that ignores your existing permissions, so that an intern's question surfaces a partner's privileged memo.
- Capture permissions at ingestion. Store the source system's access list (users or groups) as metadata on every chunk.
- Filter at retrieval, before ranking. Pass the authenticated user's identity and groups to the retrieval service and apply them as a hard filter in the vector query. Chunks the user cannot read must never reach the model.
- Do not use the prompt as a security control. An instruction such as "only answer from documents the user may see" is not enforcement. The model cannot be relied on to withhold text it has been given.
- Keep permissions fresh. When access changes in the source system, update the metadata promptly. Stale permissions are a common way for access to outlive its approval.
- Separate sensitive collections. Where policy demands it (for example, one client matter or one patient population), use separate indexes rather than relying only on filters.
How do you secure the vector store?
Embeddings are not a safe, anonymized copy of your documents. Research has shown that text can sometimes be reconstructed or inferred from embeddings, and the vector store usually holds the original text as well. Handle it as a primary data store:
- Encrypt data at rest and in transit, and manage keys under your own control.
- Require authentication for every client, and restrict network access to the retrieval service only.
- Back up the store and test restores, since a rebuilt index must keep its permission metadata.
- Apply the same retention and legal-hold rules you apply to the source documents.
The OWASP Top 10 for LLM Applications lists weaknesses in vectors and embeddings, and sensitive information disclosure, as distinct risks for exactly this reason.
Why is retrieved content untrusted?
Retrieved passages are text written by someone, and some of it may be written by an attacker: a pasted email, a shared document, a scanned PDF with hidden text. If a passage contains instructions, a model may follow them. This is indirect prompt injection.
- Give the model a fixed system instruction that retrieved text is reference material, not commands.
- Give the model no tools it does not need. A RAG assistant that can only answer questions has far less to abuse than one that can send email or write files.
- Validate and constrain output where it feeds another system. Never execute model output directly.
- Review which sources are ingested. Content from external senders deserves more scrutiny than internal policy documents.
How do you keep answers accurate and checkable?
- Require citations. Every claim should point to the chunk and source document it came from, so a reviewer can verify it quickly.
- Allow "I don't know." If retrieval returns nothing relevant, the system should say so instead of improvising.
- Test with real questions. Build a set of questions with known answers from your own documents, and rerun it after any change to the model, the chunking, or the embedding model.
- Keep a human in the loop for decisions that affect clients, patients, or customers. RAG assists review. It does not replace it.
How do you handle personal and regulated data?
Start by knowing what you are indexing. Classify sources before ingestion and exclude anything the use case does not need. Data you never index cannot leak from the index.
For health information, the HIPAA Security Rule's technical safeguards are a useful checklist even outside healthcare: access control, audit controls, integrity protection, authentication, and transmission security. Map each to a concrete control in your pipeline: authenticated users, retrieval logs, hashes or versioning for source documents, and encrypted connections between services. For other regimes, such as financial-sector or state privacy rules, do the same mapping with your counsel.
What should a private RAG system log and monitor?
- Who asked what, and when: user identity, timestamp, and a request ID.
- What was retrieved: the document and chunk IDs returned, and the filters applied. This is how you answer "who saw this document?"
- Which model and index versions answered, so results can be reproduced.
- Denials and anomalies: failed authentication, unusually broad queries, and bulk retrieval by one user.
Decide deliberately whether to store question and answer text. Prompts often contain the sensitive details. If you keep them for audit, protect the log like the source data and set a retention period.
How do you manage updates and deletion?
- Deletion must propagate. When a document is deleted, expired, or placed under a hold, remove or flag its chunks and vectors, including backups and caches, according to policy.
- Re-index on a schedule, and re-index fully when you change the embedding model, since vectors from different models are not comparable.
- Version everything: the model, the embedding model, the chunking settings, and the index. A frozen, documented version is easier to defend in a review.
- Govern the system. The NIST AI Risk Management Framework and its Generative AI Profile give a structure for mapping, measuring, and managing the risks of a system like this.
Production checklist for private RAG
Data and access
- Sources are classified, and only needed content is ingested.
- Source permissions are stored as chunk metadata and enforced as a filter at retrieval.
- Permission changes in the source system reach the index promptly.
Infrastructure
- Every component runs inside the boundary with no unrestricted outbound access.
- The vector store is encrypted, authenticated, and reachable only from the retrieval service.
- Backups are encrypted and restores are tested.
Model behavior
- Retrieved text is treated as untrusted, and the model has no unnecessary tools.
- Answers include citations, and the system can decline when nothing relevant is found.
- An evaluation set runs after every change.
Operations
- Logs record user, query time, retrieved document IDs, and model and index versions.
- Deletion and legal holds propagate to the index and its backups.
- Owners, review cadence, and an incident process are documented.
Private RAG FAQ
What is the difference between RAG and fine-tuning?
RAG retrieves relevant passages from your documents at question time and gives them to the model, so answers can cite current sources and you can change or delete documents without retraining. Fine-tuning changes the model's weights using training data, which makes individual facts harder to update or remove. For document question answering in regulated settings, RAG is usually the easier approach to control and audit.
Is a private RAG system automatically HIPAA compliant?
No. Compliance depends on how the whole system and your organization handle protected health information, including policies, agreements, access control, audit logging, and risk analysis. A private deployment removes the outside AI provider from the data path, but you still have to implement and document the safeguards. Confirm requirements with your compliance counsel.
Can RAG leak documents a user should not see?
Yes, if permissions are not enforced at retrieval time. If the retrieval service returns chunks without checking the user's access, the model can quote them. Store each document's access list with its chunks and apply it as a hard filter in the vector query, before any text reaches the model.
Do embeddings contain sensitive data?
They can. Embeddings are derived from your text, and research has shown that information can sometimes be inferred or reconstructed from them. Vector stores also typically hold the original chunk text. Protect the vector store with the same encryption, authentication, and retention rules as the source documents.
What hardware does a private RAG system need?
It depends on the model size, the number of concurrent users, and the volume of documents. The main resources are GPU memory for the language model, memory and storage for the vector index, and CPU capacity for ingestion. Size it from a pilot with your real documents and real questions rather than from a generic estimate.
Conclusion: private RAG
Private RAG is a data-access problem wearing an AI costume. Keep the pipeline inside one boundary, enforce each user's permissions at retrieval time, treat embeddings and retrieved text with suspicion, and log enough to answer who saw what. Do those four things and the model becomes the easy part.
Sources: private RAG
- OWASP GenAI Security Project. OWASP Top 10 for LLM Applications. Accessed October 19, 2026.
- National Institute of Standards and Technology. AI Risk Management Framework. Accessed October 19, 2026.
- National Institute of Standards and Technology. Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile (NIST AI 600-1). Accessed October 19, 2026.
- U.S. Department of Health and Human Services. The HIPAA Security Rule. Accessed October 19, 2026.
Verify requirements against the current text of each framework and with your own counsel before relying on this guide.