refactor(safety): apply consistent formatting across services and tests
Improved code readability and uniformity by standardizing line breaks, indentation, and inline conditions across safety-related services, models, and tests, including content filters, validation rules, and emergency controls.
This commit is contained in:
@@ -293,7 +293,9 @@ class MCPSafetyWrapper:
|
||||
action_type=action_type,
|
||||
tool_name=tool_call.tool_name,
|
||||
arguments=tool_call.arguments,
|
||||
resource=tool_call.arguments.get("path", tool_call.arguments.get("resource")),
|
||||
resource=tool_call.arguments.get(
|
||||
"path", tool_call.arguments.get("resource")
|
||||
),
|
||||
metadata=metadata,
|
||||
)
|
||||
|
||||
@@ -302,7 +304,9 @@ class MCPSafetyWrapper:
|
||||
tool_lower = tool_name.lower()
|
||||
|
||||
# Check destructive patterns
|
||||
if any(d in tool_lower for d in ["write", "create", "delete", "remove", "update"]):
|
||||
if any(
|
||||
d in tool_lower for d in ["write", "create", "delete", "remove", "update"]
|
||||
):
|
||||
if "file" in tool_lower:
|
||||
if "delete" in tool_lower or "remove" in tool_lower:
|
||||
return ActionType.FILE_DELETE
|
||||
|
||||
Reference in New Issue
Block a user