mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-13 23:11:40 +00:00
* fix(guardrails): return the full PANW AIRS scan response on blocked requests The blocked-request error detail was assembled from a hardcoded allowlist, so audit fields like prompt_detection_details, prompt_masked_data, source, transaction_id and session_id never reached the client even though AIRS returned them. Resolves LIT-5638 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * style(guardrails): drop redundant comment in AIRS error detail Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(panw_prisma_airs): withhold response_masked_data from the blocked-response error The full AIRS passthrough also reached the response-side block path, where response_masked_data carries the model's own generation. That branch is only reached when mask_response_content is False, so the operator had explicitly declined to deliver that text, and the error body handed it back anyway. Withhold response_masked_data from the client-visible detail. prompt_masked_data stays: it is the caller's own input and one of the fields the ticket asks for. Every other AIRS field, including prompt_detection_details, source, transaction_id and session_id, is unchanged. * fix(panw_prisma_airs): withhold generated tool args from response-side blocks _scan_tool_calls_for_guardrail calls AIRS with is_response=False because tool_event is request-side in the AIRS schema, so AIRS returns the scanned tool arguments under prompt_masked_data. When the tool calls being scanned are the model's own output, that key holds generated content, and the _CLIENT_HIDDEN_SCAN_FIELDS default (response_masked_data, empty on this path) does not cover it. With the default mask_response_content=False the block branch then shipped the model's masked tool arguments in the 400 -- the same content channel this PR closed for response_masked_data. _build_error_detail takes an extra_hidden_fields argument so the withholding stays in one place, and the tool-call block branch passes prompt_masked_data when is_response is True. Request-side blocks are unchanged and still carry prompt_masked_data, which is what LIT-5638 asks for. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * style(panw_prisma_airs): apply ruff format Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Yucheng Zhu <yucheng@berri.ai> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| guardrail_hooks | ||
| test_content_filter_path_traversal.py | ||
| test_content_utils.py | ||
| test_custom_code_security.py | ||
| test_deferred_guardrail_logging.py | ||
| test_guardrail_coverage.py | ||
| test_guardrail_endpoints.py | ||
| test_guardrail_registry.py | ||
| test_init_guardrails.py | ||
| test_llm_as_a_judge.py | ||
| test_mcp_jwt_signer.py | ||
| test_pillar_guardrails.py | ||
| test_prompt_security_guardrails.py | ||
| test_qostodian_nexus_guardrail.py | ||
| test_usage_endpoints.py | ||