@@ -29,7 +29,7 @@ Use Pillar Security for comprehensive LLM security including:
2929
3030Add Pillar Security to your ` config.yaml ` :
3131
32- ** 🌟 Recommended Configuration (Dual Mode) :**
32+ ** 🌟 Recommended Configuration:**
3333``` yaml
3434model_list :
3535 - model_name : gpt-4.1-mini
@@ -45,6 +45,8 @@ guardrails:
4545 api_key : os.environ/PILLAR_API_KEY # Your Pillar API key
4646 api_base : os.environ/PILLAR_API_BASE # Pillar API endpoint
4747 on_flagged_action : " monitor" # Log threats but allow requests
48+ fallback_on_error : " allow" # Gracefully degrade if Pillar is down (default)
49+ timeout : 5.0 # Timeout for Pillar API calls in seconds (default)
4850 persist_session : true # Keep conversations visible in Pillar dashboard
4951 async_mode : false # Request synchronous verdicts
5052 include_scanners : true # Return scanner category breakdown
@@ -207,6 +209,8 @@ You can configure Pillar Security using environment variables:
207209export PILLAR_API_KEY="your_api_key_here"
208210export PILLAR_API_BASE="https://api.pillar.security"
209211export PILLAR_ON_FLAGGED_ACTION="monitor"
212+ export PILLAR_FALLBACK_ON_ERROR="allow"
213+ export PILLAR_TIMEOUT="30.0"
210214```
211215
212216### Session Tracking
@@ -245,6 +249,66 @@ Logs the violation but allows the request to proceed:
245249on_flagged_action : " monitor"
246250` ` `
247251
252+ ### Resilience and Error Handling
253+
254+ #### Graceful Degradation (` fallback_on_error`)
255+
256+ Control what happens when the Pillar API is unavailable (network errors, timeouts, service outages) :
257+
258+ ` ` ` yaml
259+ fallback_on_error: "allow" # Default - recommended for production resilience
260+ ` ` `
261+
262+ **Available Options:**
263+
264+ - **`allow` (Default - Recommended)**: Proceed without scanning when Pillar is unavailable
265+ - **No service interruption** if Pillar is down
266+ - **Best for production** where availability is critical
267+ - Security scans are skipped during outages (logged as warnings)
268+
269+ ` ` ` yaml
270+ guardrails:
271+ - guardrail_name: "pillar-resilient"
272+ litellm_params:
273+ guardrail: pillar
274+ fallback_on_error: "allow" # Graceful degradation
275+ ` ` `
276+
277+ - **`block`**: Reject all requests when Pillar is unavailable
278+ - **Fail-secure approach** - no request proceeds without scanning
279+ - **Service interruption** during Pillar outages
280+ - Returns 503 Service Unavailable error
281+
282+ ` ` ` yaml
283+ guardrails:
284+ - guardrail_name: "pillar-fail-secure"
285+ litellm_params:
286+ guardrail: pillar
287+ fallback_on_error: "block" # Fail secure
288+ ` ` `
289+
290+ # ### Timeout Configuration
291+
292+ Configure how long to wait for Pillar API responses :
293+
294+ **Example Configurations:**
295+
296+ ` ` ` yaml
297+ # Production: Default - Fast with graceful degradation
298+ guardrails:
299+ - guardrail_name: "pillar-production"
300+ litellm_params:
301+ guardrail: pillar
302+ timeout: 5.0 # Default - fast failure detection
303+ fallback_on_error: "allow" # Graceful degradation (required)
304+ ` ` `
305+
306+ **Environment Variables:**
307+ ` ` ` bash
308+ export PILLAR_FALLBACK_ON_ERROR="allow"
309+ export PILLAR_TIMEOUT="5.0"
310+ ` ` `
311+
248312# # Advanced Configuration
249313
250314**Quick takeaways**
0 commit comments