diff --git a/litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/categories/prompt_injection_malicious_code.yaml b/litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/categories/prompt_injection_malicious_code.yaml new file mode 100644 index 00000000000..1045208ceaf --- /dev/null +++ b/litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/categories/prompt_injection_malicious_code.yaml @@ -0,0 +1,147 @@ +# Malicious Code Injection Detection - Detects attempts to inject executable code +# Uses conditional logic: BLOCK if an identifier word + block word appear in same sentence +category_name: "prompt_injection_malicious_code" +description: "Detects attempts to inject or execute malicious code via prompts" +default_action: "BLOCK" + +# IDENTIFIER WORDS - Code execution actions +identifier_words: + - "execute" + - "run" + - "eval" + - "exec" + - "spawn" + - "system" + - "shell" + - "invoke" + - "call" + - "launch" + - "process" + - "compile" + - "interpret" + - "inject" + +# ADDITIONAL BLOCK WORDS - Dangerous commands and patterns +additional_block_words: + # Shell commands + - "rm -rf" + - "rm -f" + - "chmod 777" + - "chmod +x" + - "sudo" + - "su root" + - "curl | bash" + - "curl | sh" + - "wget -O -" + - "wget | sh" + - "/etc/passwd" + - "/etc/shadow" + - "mkfs" + - "dd if=" + - "> /dev/sda" + - "fork bomb" + - "crontab" + - "nc -e" + - "netcat" + - "ncat" + - "reverse shell" + + # Script injection + - "powershell -enc" + - "powershell -e" + - "base64 -d" + - "base64 --decode" + - "