PraisonAI injection defense default threshold too high and can be bypassed
Start here
A GitHub security advisory disclosed that the optional prompt injection defense (enable_injection_defense()) in PraisonAI has a flawed default configuration: block_threshold defaults to ThreatLevel.CRITICAL, so only when three or more detector families are triggered simultaneously will it block. A single detector hit, including instruction override and financial manipulation categories explicitly marked as dangerous, only produces a HIGH-level alert and is written to the log, with the request forwarded to the LLM unchanged. The researcher's validation prompt, which triggers only one instruction override detector, completely bypasses the defense, and financial manipulation prompts are also allowed through. The root cause is that the blocking condition in scan_text requires the level to reach CRITICAL.
Generated by AI from reports · Updated 2026-10-13
Progress timeline
- GitHub Security AdvisoriesSelectedPraisonAI prompt injection defense reportedly only blocks at high severity, single-vector injection can bypass
- GitHub Security AdvisoriesSelectedPraisonAI prompt injection defense default threshold too high, single-vector attacks can bypass blocking
PraisonAI's InjectionDefense prompt injection defense layer has a flawed default configuration: block_threshold defaults to ThreatLevel.CRITICAL, so only 3 or more simultaneous detections trigger blocking. A single detection hit, including categories explicitly marked as dangerous like instruction override and financial manipulation, only produces a HIGH-level alert and is written to logs, without blocking; the request is forwarded to the LLM unchanged. The researchers' verification prompt, triggering only one instruction override detection, completely bypasses the defense, and financial manipulation prompts are also allowed through. Impacts include system prompt extraction, unauthorized tool calls, session context leakage, and financial manipulation when the agent has payment tools. Recommendations: change the default threshold to ThreatLevel.HIGH so any dangerous category hit triggers blocking; operators needing permissive behavior can explicitly pass CRITICAL; and update the threshold comments to explain the mapping between severity levels and blocking.