{"record":{"id":"1bdbdd3680af7398","repo":"BerriAI/litellm","slug":"blocked-by-prompt-security-violations-join","errorCode":null,"errorMessage":"Blocked by Prompt Security, Violations: {', '.join(violations)}","messagePattern":"Blocked by Prompt Security, Violations: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/guardrails/guardrail_hooks/prompt_security/prompt_security.py","lineNumber":280,"sourceCode":"        )\n        response.raise_for_status()\n        res: Final = response.json()\n\n        self._log_api_response(\n            url=f\"{self.api_base}/api/protect\",\n            status_code=response.status_code,\n            payload={\"result\": res.get(\"result\")},\n        )\n\n        result: Final = res.get(\"result\", {}).get(\"response\", {})\n        if result is None:\n            return inputs\n\n        action: Final = result.get(\"action\")\n        violations: Final = result.get(\"violations\", [])\n\n        if action == \"block\":\n            raise HTTPException(\n                status_code=400,\n                detail=\"Blocked by Prompt Security, Violations: \" + \", \".join(violations),\n            )\n        elif action == \"modify\":\n            modified_text: Final = result.get(\"modified_text\")\n            if modified_text is not None:\n                # If we combined multiple texts, return the modified version as single text\n                # The framework will handle distributing it back\n                inputs[\"texts\"] = [modified_text]\n\n        return inputs\n\n    def _extract_texts_from_messages(self, messages: list) -> list[str]:\n        \"\"\"Extract text content from messages.\"\"\"\n        texts: Final = []\n        for message in messages:\n            content = message.get(\"content\")\n            if isinstance(content, str):","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_hooks/prompt_security/prompt_security.py#L262-L298","documentation":"Error \"Blocked by Prompt Security, Violations: {', '.join(violations)}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/guardrails/guardrail_hooks/prompt_security/prompt_security.py:280 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Review the joined violations list and remove the offending content from the prompt.","Tune the Prompt Security policy thresholds for false positives."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}