Skip to content

Commit 7f75107

Browse files
committed
fix ruff
1 parent 59ce80d commit 7f75107

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/predicate_secure/adapters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ def create_openclaw_adapter(
360360
AdapterError: If OpenClaw adapter initialization fails
361361
"""
362362
try:
363-
from .openclaw_adapter import OpenClawAdapter, OpenClawConfig, create_openclaw_adapter as create_adapter_impl
363+
from .openclaw_adapter import create_openclaw_adapter as create_adapter_impl
364364
except ImportError as e:
365365
raise AdapterError(
366366
f"OpenClaw adapter requires openclaw_adapter module. Error: {e}",

src/predicate_secure/openclaw_adapter.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,14 @@
99

1010
from __future__ import annotations
1111

12-
import asyncio
1312
import json
1413
import os
1514
import subprocess
1615
import threading
1716
from dataclasses import dataclass
1817
from http.server import BaseHTTPRequestHandler, HTTPServer
19-
from pathlib import Path
2018
from typing import Any, Callable
21-
from urllib.parse import parse_qs, urlparse
22-
23-
from .detection import Framework
19+
from urllib.parse import urlparse
2420

2521

2622
@dataclass
@@ -241,7 +237,10 @@ def start_cli(self, task: str | None = None) -> subprocess.Popen:
241237
env["PREDICATE_PROXY_URL"] = f"http://localhost:{self.config.skill_proxy_port}"
242238

243239
# Start process
244-
process = subprocess.Popen(
240+
# Security: cmd is built from trusted config (cli_path) and user-provided task
241+
# The cli_path comes from OpenClawConfig which is controlled by the developer
242+
# Task parameter is validated and passed as a separate argument (not shell-interpolated)
243+
process = subprocess.Popen( # nosec B603
245244
cmd,
246245
cwd=working_dir,
247246
env=env,

0 commit comments

Comments
 (0)