From d37584f4571bb97b904aa51a0c925ac89114c05a Mon Sep 17 00:00:00 2001 From: Cristi Date: Mon, 8 Dec 2025 12:05:51 +0200 Subject: [PATCH] Add web_request_framework tool to web_pentester (#358) Co-authored-by: root --- src/cai/agents/web_pentester.py | 2 ++ src/cai/tools/web/headers.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/cai/agents/web_pentester.py b/src/cai/agents/web_pentester.py index a78b08d3..66bbfbd5 100644 --- a/src/cai/agents/web_pentester.py +++ b/src/cai/agents/web_pentester.py @@ -13,6 +13,7 @@ from cai.agents.guardrails import get_security_guardrails # Core tools from cai.tools.reconnaissance.generic_linux_command import generic_linux_command from cai.tools.reconnaissance.exec_code import execute_code +from cai.tools.web.headers import web_request_framework # Optional OSINT search (requires PERPLEXITY_API_KEY) from cai.tools.web.search_web import make_web_search_with_explanation @@ -27,6 +28,7 @@ web_pentester_system_prompt = load_prompt_template("prompts/system_web_pentester tools = [ generic_linux_command, # shell one-liners (httpie/curl/waybackurls/etc if installed) execute_code, # light parsing/diffing/payload crafting + web_request_framework, # HTTP request + response/header security analysis ] # Conditional: add web search helper when available diff --git a/src/cai/tools/web/headers.py b/src/cai/tools/web/headers.py index bcca232f..004e6e0f 100644 --- a/src/cai/tools/web/headers.py +++ b/src/cai/tools/web/headers.py @@ -8,8 +8,10 @@ analysis, parameter inspection, and security vulnerability detection. from urllib.parse import urlparse import requests # pylint: disable=E0401 +from cai.sdk.agents import function_tool +@function_tool(strict_mode=False) def web_request_framework( # noqa: E501 # pylint: disable=too-many-arguments,too-many-locals,too-many-branches url: str = "", method: str = "GET",