{"record":{"id":"01a75357d743f48e","repo":"BerriAI/litellm","slug":"failed-to-get-jobid-from-prompt-security","errorCode":null,"errorMessage":"Failed to get jobId from Prompt Security","messagePattern":"Failed to get jobId from Prompt Security","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/guardrails/guardrail_hooks/prompt_security/prompt_security.py","lineNumber":392,"sourceCode":"        # Step 1: Upload file for sanitization\n        files: Final = {\"file\": (filename, file_data)}\n        upload_response: Final = await self.async_handler.post(\n            f\"{self.api_base}/api/sanitizeFile\",\n            headers=headers,\n            files=files,\n        )\n        upload_response.raise_for_status()\n        upload_result: Final = upload_response.json()\n        job_id: Final = upload_result.get(\"jobId\")\n\n        self._log_api_response(\n            url=f\"{self.api_base}/api/sanitizeFile\",\n            status_code=upload_response.status_code,\n            payload={\"jobId\": job_id},\n        )\n\n        if not job_id:\n            raise HTTPException(status_code=500, detail=\"Failed to get jobId from Prompt Security\")\n\n        verbose_proxy_logger.debug(\"Prompt Security Guardrail: File sanitization started with jobId=%s\", job_id)\n\n        # Step 2: Poll for results\n        for attempt in range(self.max_poll_attempts):\n            await asyncio.sleep(self.poll_interval)\n\n            self._log_api_request(\n                method=\"GET\",\n                url=f\"{self.api_base}/api/sanitizeFile\",\n                headers=headers,\n                payload={\"jobId\": job_id},\n            )\n            poll_response = await self.async_handler.get(\n                f\"{self.api_base}/api/sanitizeFile\",\n                headers=headers,\n                params={\"jobId\": job_id},\n            )","sourceCodeStart":374,"sourceCodeEnd":410,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/guardrails/guardrail_hooks/prompt_security/prompt_security.py#L374-L410","documentation":"Error \"Failed to get jobId from Prompt Security\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/guardrails/guardrail_hooks/prompt_security/prompt_security.py:392 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the Prompt Security API response for errors and verify api_base/api_key.","Confirm the file sanitization endpoint is available in your Prompt Security plan."],"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"}