{"record":{"id":"6fdcc9fc4b578c33","repo":"BerriAI/litellm","slug":"invalid-pipeline-e","errorCode":null,"errorMessage":"Invalid pipeline: {e}","messagePattern":"Invalid pipeline: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/policy_engine/policy_endpoints.py","lineNumber":626,"sourceCode":"    ```bash\n    curl -X POST \"http://localhost:4000/policies/test-pipeline\" \\\\\n        -H \"Authorization: Bearer <your_api_key>\" \\\\\n        -H \"Content-Type: application/json\" \\\\\n        -d '{\n            \"pipeline\": {\n                \"mode\": \"pre_call\",\n                \"steps\": [\n                    {\"guardrail\": \"pii-guard\", \"on_pass\": \"next\", \"on_fail\": \"block\"}\n                ]\n            },\n            \"test_messages\": [{\"role\": \"user\", \"content\": \"My SSN is 123-45-6789\"}]\n        }'\n    ```\n    \"\"\"\n    try:\n        validated_pipeline: Final = GuardrailPipeline(**request.pipeline)\n    except Exception as e:\n        raise HTTPException(status_code=400, detail=f\"Invalid pipeline: {e}\")\n\n    data: Final = {\n        \"messages\": request.test_messages,\n        \"model\": \"test\",\n        \"metadata\": {},\n    }\n\n    try:\n        result: Final = await PipelineExecutor.execute_steps(\n            steps=validated_pipeline.steps,\n            mode=validated_pipeline.mode,\n            data=data,\n            user_api_key_dict=user_api_key_dict,\n            call_type=\"completion\",\n            policy_name=\"test-pipeline\",\n        )\n        return result.model_dump()\n    except Exception as e:","sourceCodeStart":608,"sourceCodeEnd":644,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/policy_engine/policy_endpoints.py#L608-L644","documentation":"Validation guard in the test-pipeline endpoint: constructing the GuardrailPipeline Pydantic model from the request payload raised (bad mode, unknown step fields, missing guardrail names); the validation error is surfaced as an error response.","triggerScenarios":"Thrown at litellm/proxy/policy_engine/policy_endpoints.py:626 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the policy pipeline definition per the error detail (step names, order, parameters).","Refer to the policy engine docs for the valid pipeline schema."],"exampleFix":null,"handlingStrategy":"validation","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"}