LlamaIndex Integration Guide
Integrate Koreshield with LlamaIndex to add a security layer to your RAG (Retrieval-Augmented Generation) pipelines.Overview
The best way to integrate is by subclassingCustomLLM. This allows Koreshield to intercept the prompt before it is sent to the underlying model (e.g., OpenAI, Anthropic).
Implementation
Create a custom LLM class:Usage
Advanced Configuration
Custom Security Settings
Async Support
RAG Pipeline Example
Benefits
Centralized Security
Protects all indexes and query engines automatically.
Audit Logging
All RAG queries are logged in Koreshield’s dashboard.
Fail-Fast
Malicious queries are blocked before retrieving documents, saving vector DB costs.
Zero Refactoring
Drop-in replacement for existing LlamaIndex LLMs.
Monitoring & Analytics
Related Documentation
Python SDK
Complete Python SDK documentation
RAG Security
Best practices for securing RAG pipelines
LlamaIndex Docs
Official LlamaIndex documentation