Security Features
Security protections built into Fortified LLM Client.
Input Validation
- Max input length - Prevents resource exhaustion (default: 1MB)
- Max input tokens - Prevents context overflow (default: 200K)
- PDF size validation - Max 50MB per PDF
- Guardrails - Pattern + LLM-based validation
API Key Handling
Best practices:
- Use
--api-key-namewith environment variables (not--api-key) - Never commit API keys in config files
- Keys stored in memory only, not logged
Timeout Protection
- Default: 300 seconds (5 minutes)
- Configurable:
--timeoutflag - Prevents hanging on slow/unresponsive APIs
Atomic File Writes
Output files use temp + rename:
1
2
3
4
// Write to temp file
fs::write(&temp_path, content)?;
// Atomic rename
fs::rename(&temp_path, &final_path)?;
Prevents partial writes on failure.
Guardrails-Only Validate User Input
System prompts are trusted - only user prompts validated by guardrails.
No Code Injection
All LLM inputs are data (JSON), not code. No eval() or dynamic execution.