diff --git a/agentic_security/http_spec.py b/agentic_security/http_spec.py index de36f07..dcb938d 100644 --- a/agentic_security/http_spec.py +++ b/agentic_security/http_spec.py @@ -1,7 +1,7 @@ import base64 from enum import Enum - from urllib.parse import urlparse + import httpx from pydantic import BaseModel @@ -161,11 +161,13 @@ def parse_http_spec(http_spec: str) -> LLMSpec: method, url = lines[0].split(" ")[0:2] # Check url validity - valid_url= urlparse(url) - # if missing the correct formatting ://, urlparse.netloc will be empty - if valid_url.scheme not in ("http", "https") or not valid_url.netloc: - raise InvalidHTTPSpecError(f"Invalid URL: {url}. Ensure it starts with 'http://' or 'https://'") - + valid_url = urlparse(url) + # if missing the correct formatting ://, urlparse.netloc will be empty + if valid_url.scheme not in ("http", "https") or not valid_url.netloc: + raise InvalidHTTPSpecError( + f"Invalid URL: {url}. Ensure it starts with 'http://' or 'https://'" + ) + # Initialize headers and body headers = {} body = "" diff --git a/agentic_security/probe_data/modules/rl_model.py b/agentic_security/probe_data/modules/rl_model.py index 002158c..1b5befd 100644 --- a/agentic_security/probe_data/modules/rl_model.py +++ b/agentic_security/probe_data/modules/rl_model.py @@ -121,7 +121,8 @@ class CloudRLPromptSelector(PromptSelectionInterface): current_prompt: str, reward: float, passed_guard: bool, - ) -> None: ... + ) -> None: + ... class QLearningPromptSelector(PromptSelectionInterface):