#19499 [Bug]: Prompt Injection Detection Issues
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### What happened?
## Summary
The built-in prompt injection detection feature has two critical bugs: 1. **Heuristics check blocks the event loop**, causing pod restarts in Kubernetes, given that you are running with the default number of workers, which is 1 2. **LLM API check never executes** due to incorrect class inheritance
## Problem 1: Heuristics Check Blocks Event Loop
### Issue When `heuristics_check: true` is enabled, the synchronous similarity calculation in `check_user_input_similarity()` blocks the entire FastAPI event loop, preventing health check endpoints from responding.
### Location `litellm/proxy/hooks/prompt_injection_detection.py:113-137`
### Code ```python async def async_pre_call_hook(self, ...): if self.prompt_injection_params.heuristics_check is True: # This is a BLOCKING synchronous call inside an async function is_prompt_attack = self.check_user_input_similarity( user_input=formatted_prompt )
def check_user_input_similarity(self, user_input: str, ...): # Triple nested loop with O(n*m) Sequ…