mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
test(mcp): return one masked text per scanned string in the selected-guardrail REST test
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
a369937be3
commit
d14fb9e6e2
1 changed files with 2 additions and 1 deletions
|
|
@ -3300,7 +3300,8 @@ async def test_request_selected_tool_specific_guardrail_applies_to_virtual_execu
|
|||
default_on=False,
|
||||
custom_code="def apply_guardrail(inputs, request_data, input_type):\n"
|
||||
' if inputs.get("tools", [{}])[0].get("function", {}).get("name") == "execute":\n'
|
||||
f' return {{"action": "{action}", "reason": "resolved tool blocked", "texts": ["redacted"]}}\n'
|
||||
' texts = [t.replace("confidential", "redacted") for t in inputs.get("texts", [])]\n'
|
||||
f' return {{"action": "{action}", "reason": "resolved tool blocked", "texts": texts}}\n'
|
||||
" return allow()\n",
|
||||
)
|
||||
manager: Final = mcp_server_manager.MCPServerManager()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue