Security Policies
KoreShield secures LLM traffic by combining sanitization, detection, and policy enforcement in a single proxy layer. This keeps provider API keys server-side and applies the same safeguards to every request.Core Capabilities
KoreShield provides comprehensive security through:Input Sanitization
Remove unsafe content patterns before they reach the LLM
Threat Detection
Multi-layered detection with keyword rules and pattern analysis
Policy Enforcement
Configurable actions: allow, warn, or block detected threats
Audit Logging
Comprehensive logging and metrics for monitoring and compliance
How It Works
Content sanitization and scanning
Input is sanitized and scanned for security threats using multiple detection layers.
Policy decision
Configured policies determine whether to allow, warn, or block based on threat severity.
Forward or block
Allowed traffic is forwarded to the configured LLM provider. Blocked requests return an error.
Configure Security Defaults
Set default security policies in your configuration:Detection sensitivity level:
high- Strict enforcement, best for regulated workloadsmedium- Balanced defaults for most production uselow- Lenient mode for experimentation
Default action for detected threats:
allow- Log but don’t block (monitoring only)warn- Log and add warning header, but allow requestblock- Reject the request and return error
Enable/disable specific security features:
sanitization- Input cleaning and normalizationdetection- Threat detection enginepolicy_enforcement- Apply configured policies
Sensitivity Levels
- High
- Medium
- Low
Best for:
- Healthcare (HIPAA)
- Financial services (PCI-DSS)
- Public-facing chatbots
- Regulated industries
- Strict detection thresholds
- Lower confidence scores trigger blocks
- More false positives
- Maximum security
Action Types
Allow
Log the threat but allow the request to proceed:- Testing new detection rules
- Monitoring only mode
- Building baseline metrics
Warn
Log the threat, add a warning header, but allow the request:- Gradual rollout of security policies
- You want visibility without blocking users
- Collecting data for tuning
Block
Reject the request and return an error:- Production security enforcement
- High-risk or regulated environments
- Protecting sensitive data
Per-Environment Configuration
Operational Tips
Use structured logging
Use structured logging
Enable
json_logs: true in production for structured logs that integrate with your monitoring stack.Enable Redis for distributed systems
Enable Redis for distributed systems
Use Redis for distributed rate limiting and centralized statistics:
Protect the proxy with API keys
Protect the proxy with API keys
Require authentication to access the KoreShield proxy:
Monitor security metrics
Monitor security metrics
Track key metrics:
- Request volume
- Threat detection rate
- False positive rate
- Response latency
/metrics endpoint (Prometheus format)Custom Policies
Define custom policies for specific threat types:Allowlists and Blocklists
Override detection for known patterns:Next Steps
Attack Detection
Learn about detection layers and tuning
Configuration Guide
Complete policy configuration reference
Compliance
HIPAA, GDPR, and SOC 2 compliance
Monitoring
Set up monitoring and alerting
Related Documentation
- Attack Detection - Detection engine details
- Configuration Settings - Complete configuration reference
- Production Checklist - Security best practices