mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-29 01:03:17 +00:00
* fix(guardrails): straiker v3 routes sk_agt_ keys to v3 and stops reading a missing verdict as allow An sk_agt_ key always calls /api/v3/detect, even when the guardrail was saved with api_version 'v1' by the old shared default: the v1 webhook rejects that key with 401. A 200 with no decision, or permissionDecision 'ask', now takes the failure policy instead of allowing the request. A detect-mode action is still not a block. A response-phase block is no longer remembered under the request, so asking the same question again is scored instead of refused from memory. The replay memory is scoped by principal and session together, so two principals on one session id never share a block. A text-only /guardrails/apply_guardrail call relays the text as a user turn. The agent_ref description now matches the code: the configured value wins. * fix(guardrails): straiker v3 relays text beside an empty messages list and keys the memory on the key /guardrails/apply_guardrail sends `messages: []` beside `text`; an empty list is no conversation, so the text is relayed as the user turn. A verdict whose blocked_by is not a list states no decision and takes the failure policy, the same way a missing decision does. A key that names no user is still the caller, so the replay memory is keyed on the key when no user is known. * test(guardrails): build the straiker replay-scope request data without mutating it --------- Co-authored-by: PhimmStraiker <PhimmStraiker@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| guardrail_hooks | ||
| __init__.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_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 | ||