mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-25 22:20:43 +00:00
* feat(guardrails): opt-in Bedrock ApplyGuardrail scan of tool-call arguments and tool descriptions as text Tool calls in the request history are scanned as INPUT and model-generated tool calls as OUTPUT on chat completions, messages and responses. scan_tool_descriptions_as_text now accepts bedrock Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(guardrails): scan decoded tool-call arguments and reject the tool text scans in during_call mode Tool-call arguments are JSON-decoded before the Bedrock scan so escapes cannot hide text, arguments nested too deep to scan are blocked, and both flags are rejected for a Bedrock guardrail running during_call, whose native hook never reaches the scan Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(guardrails): dedupe tool-call keys before the escape check and assert scanned text in the default-off test Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(guardrails): scan streamed chat completions tool calls on the Bedrock post-call stream hook A tool-call-only /v1/chat/completions stream was assembled and scanned as text only, so scan_tool_calls_as_text never saw the streamed arguments Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor(guardrails): type the Bedrock tool-call scan inputs so the typecheck ceilings hold Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(guardrails): scan custom tool calls in the Bedrock tool-call text scan Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(guardrails): scan legacy function_call in the Bedrock tool-call text scan; inject the http handler in tests Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(guardrails): answer the masked tool-call scan test with a masked Bedrock reply Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(guardrails): type the legacy function_call lookup Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(guardrails): block a tool call that the Bedrock tool-call text scan masks Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(guardrails): scan tool-call argument values that a repeated JSON key shadows Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(guardrails): type the tool text scan test parameters and split a two-loop comprehension Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test(guardrails): type the stream helpers in the tool text scan tests Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(guardrails): read scan_tool_calls_as_text through a helper and type the bedrock post-call hook Reads the new flag through effective_scan_tool_calls_as_text_for_guardrail like the sibling guardrail flags, so guardrail objects without the attribute keep working, types the legacy bedrock post-call hook's request body to clear a new basedpyright error, and regenerates the API schema files for the new field --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| containers | ||
| google_genai | ||
| images | ||
| integrations | ||
| interactions | ||
| litellm_core_utils | ||
| llms | ||
| management_endpoints | ||
| mcp_server | ||
| passthrough_endpoints | ||
| prompts | ||
| proxy | ||
| repositories | ||
| responses | ||
| secret_managers | ||
| videos | ||
| access_group.py | ||
| adapter.py | ||
| agents.py | ||
| caching.py | ||
| completion.py | ||
| compression.py | ||
| decisions.py | ||
| embedding.py | ||
| extraction.py | ||
| files.py | ||
| fine_tuning.py | ||
| guardrail_base_init.py | ||
| guardrails.py | ||
| lar1.py | ||
| litellm_params.py | ||
| mcp.py | ||
| memory_management.py | ||
| model_insights.py | ||
| object_permission.py | ||
| policy_engine.py | ||
| rag.py | ||
| realtime.py | ||
| rerank.py | ||
| roi_calculator.py | ||
| roi_observed.py | ||
| router.py | ||
| router_weights.py | ||
| scheduler.py | ||
| search.py | ||
| services.py | ||
| tag_management.py | ||
| token_count.py | ||
| tool_management.py | ||
| utils.py | ||
| vector_store_files.py | ||
| vector_stores.py | ||
| workload_identity.py | ||