Prompt
I'm trying to connect an LLM to our company knowledge base without exposing sensitive docs. What should I use?
Latest observation
Oct 19, 2026
OpenAI APIWeb search: off
Use retrieval-augmented generation (RAG) with a permission-aware vector store / search layer rather than fine-tuning on the documents.
Why this is usually the right choice
- Keeps sensitive docs out of the model weights: the LLM doesn’t “learn” the documents permanently.
- Access control is enforceable at query time: users only retrieve documents they’re allowed to see.
- Easier to update: new or revised docs become available immediately without retraining.
Recommended architecture
- Ingest documents from your knowledge base.
- Chunk and index them in a retrieval system:
- vector database for semantic search
- optionally hybrid search with keyword + vector
- Attach metadata/ACLs to each chunk:
- department
- document classification
- user/group permissions
- At query time:
- authenticate the user
- filter retrieval by their permissions
- pass only allowed chunks to the LLM
- Log and audit retrievals and responses.
Important security controls
- Row-level / document-level security in the retriever
- Encryption at rest and in transit
- No training on private docs by default
- Prompt-injection defenses for retrieved content
- Redaction of secrets/PII before indexing where appropriate
- Strict egress control if using a hosted model/API
What not to use
- Fine-tuning on sensitive internal docs unless you have a very specific reason and a strong governance model. It’s harder to control what the model memorizes and who can access it.
If you want a practical stack
- Retriever: Elasticsearch/OpenSearch, Azure AI Search, Pinecone, Weaviate, pgvector, etc.
- Orchestration: LangChain, LlamaIndex, Semantic Kernel
- LLM: hosted or self-hosted, depending on compliance needs
Rule of thumb
- If you need secure Q&A over internal docs → RAG with ACL-aware retrieval
- If you need the model to learn a task/style, not specific sensitive content → fine-tuning
- Often the best setup is RAG + a small amount of fine-tuning for behavior, not for knowledge
If you tell me your environment (Microsoft/Google/AWS, self-hosted vs SaaS, compliance requirements), I can suggest a concrete setup.