mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-15 09:12:18 +00:00
A Straiker verdict that blocks the prompt now comes back as a reply (HTTP 200, finish_reason content_filter) on chat completions, text completions, messages and responses, the way an answer-side block already does, instead of an HTTP 400 that some clients show as a malformed request. Routes that cannot send a reply, such as embeddings and /guardrails/apply_guardrail, keep the HTTP 400. A blocked answer on those routes is now an HTTP 400 too, where it was a 500. A backend failure still fails closed with an error. HTTP 408, 429 and 500 from Straiker now follow unreachable_fallback once retries are spent, and an attempt that times out is no longer retried. The new stream_mode option picks how a streamed response reaches the client. "buffered", the default, holds it until Straiker has checked the whole response. "streaming" sends chunks as they arrive and checks the assembled response at the end. Each v3 phase now writes its own guardrail log entry with the session, action, turn id and controls, in place of the generic entry that read "allow" even when the guardrail failed open. A claude-cli/ User-Agent is named Claude only for Claude Code entrypoints, so other clients that share the prefix are no longer misnamed. |
||
|---|---|---|
| .. | ||
| guardrail_hooks | ||
| __init__.py | ||
| test_anthropic_sse.py | ||
| test_auto_router_compression.py | ||
| 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_helpers.py | ||
| test_guardrail_initializers.py | ||
| test_guardrail_load_balancing.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 | ||
| test_usage_tracking.py | ||