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:
yucheng 2026-09-29 02:16:02 +00:00
parent a369937be3
commit d14fb9e6e2

View file

@ -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()