Skip to content

feat(tools): add internal HTTP request tool#1008

Open
ionut-mihalache-uipath wants to merge 2 commits into
mainfrom
feat/http-tool
Open

feat(tools): add internal HTTP request tool#1008
ionut-mihalache-uipath wants to merge 2 commits into
mainfrom
feat/http-tool

Conversation

@ionut-mihalache-uipath

Copy link
Copy Markdown
Contributor

Summary

Adds an HTTP_REQUEST internal tool that issues outbound HTTP requests to a caller-provided URL, mirroring the existing analyze-files internal tool.

  • Tool arguments (url/method/headers/params/body/timeout) come from the resource's input schema authored in the agent definition. Each may be pinned to a static value, bound to an agent input, or left for the LLM to infer via the shared argument_properties mechanism.
  • Supported methods: GET, POST, PUT, PATCH, DELETE. Default per-request timeout of 30s.
  • SSRF guard: requests resolving to private, loopback, link-local, or cloud-metadata addresses are rejected. The check runs on every request, including redirect hops.
  • httpx client built via get_httpx_client_kwargs() per repo convention.

Changes

  • New http_request_tool.py implementing create_http_request_tool.
  • Wired HTTP_REQUEST into internal_tool_factory.
  • Added INVALID_INPUT_ARGUMENT error code.
  • Bumped uipath dependency to >=2.13.16, <2.14.0 and package version to 0.14.17.

Testing

  • uv run pytest tests/agent/tools/internal_tools/test_http_request_tool.py — 23 passed.
  • ruff check and the custom httpx-client linter pass on the changed files.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Hw5JP9xHn5atKPrASKmDVq

Add an HTTP_REQUEST internal tool that issues outbound HTTP requests to a
caller-provided URL. Arguments (url/method/headers/params/body/timeout) come
from the resource input schema and may be static, agent-input-bound, or
LLM-inferred via the shared argument_properties mechanism.

Requests resolving to private, loopback, link-local, or cloud-metadata
addresses are rejected to guard against SSRF, including on redirect hops.

Wire the tool into the internal tool factory, add the INVALID_INPUT_ARGUMENT
error code, and bump the uipath dependency to >=2.13.16.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hw5JP9xHn5atKPrASKmDVq
Copilot AI review requested due to automatic review settings July 24, 2026 11:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new HTTP_REQUEST internal structured tool to let agents issue outbound HTTP requests using a caller-provided schema, with SSRF protections intended to block private/loopback/link-local/metadata targets. The tool is wired into the internal tool factory, a new runtime error code is introduced for invalid inputs, and dependencies/versioning are bumped accordingly.

Changes:

  • Implement create_http_request_tool with URL normalization, method/timeout/body handling, and SSRF validation.
  • Register HTTP_REQUEST in internal_tool_factory and add INVALID_INPUT_ARGUMENT error code.
  • Bump package version and uipath dependency (and update lockfile).

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
uv.lock Updates lockfile (exclude-newer marker, uipath version, package version).
pyproject.toml Bumps package version and uipath dependency constraint.
src/uipath_langchain/agent/exceptions/exceptions.py Adds INVALID_INPUT_ARGUMENT error code used by the new tool.
src/uipath_langchain/agent/tools/internal_tools/internal_tool_factory.py Wires HTTP_REQUEST into the internal tool handler mapping and updates docstring.
src/uipath_langchain/agent/tools/internal_tools/http_request_tool.py New internal HTTP request tool implementation with SSRF guard and httpx client creation.
tests/agent/tools/internal_tools/test_http_request_tool.py Adds unit tests for the new HTTP request tool and SSRF/normalization helpers.

Comment thread tests/agent/tools/internal_tools/test_http_request_tool.py Outdated
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants