#26877 [Bug]: policies/test-pipeline returns 500 after the pipeline already passes
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### What happened?
Hi team,
I think there is a bug in the policy pipeline test endpoint.
I am using LiteLLM 1.83.10. When I call /policies/test-pipeline, the pipeline itself appears to run successfully, but the endpoint still returns 500.
From the logs, I can see that the pipeline step completed normally first:
Pipeline 'test-pipeline' step 5: guardrail=SSN_PII Native Block, outcome=pass, action=next
Right after that, FastAPI fails while serializing the response:
TypeError: 'InstrumentationInfo' object is not iterable
During handling of the above exception, another exception occurred:
TypeError: vars() argument must have __dict__ attribute
...
File "/app/.venv/lib/python3.13/site-packages/fastapi/routing.py", line 305, in serialize_response return jsonable_encoder(response_content)
...
ValueError: [TypeError("'InstrumentationInfo' object is not iterable"), TypeError('vars() argument must have __dict__ attribute')]
So this does not look like a guardrail decision failure. It looks like the endpoint runs the pipeline, but then crashes while building…