Skip to main content

http

Full HTTP client for REST APIs and web services. All standard verbs, JSON-shaped helpers, form submission, multipart upload, background downloads with progress tracking. Outbound requests go through the SSRF guard () - same blocklist as the web module.

PropertyValue
Module idhttp
Version1.0.0
Typeuser
Pip depsaiohttp

The 16 actions

Method-specific helpers are easier for the LLM than a single generic request.

ToolRiskPurpose
http.requestmediumGeneric call (full control over method / headers / body / params).
http.getlowGET, auto-parsed by content type.
http.headlowHeaders only - no body download.
http.optionslowAllowed methods + CORS.
http.postmediumPOST, auto-JSON serialisation.
http.putmediumReplace a resource.
http.patchmediumPartial update.
http.deletemediumRemove a resource.
http.json_apimediumJSON API call (auto Accept: application/json).
http.submit_formmediumapplication/x-www-form-urlencoded POST.
http.upload_filemediummultipart/form-data upload.
http.fetch_pagelowFetch + extract readable text from HTML (lighter than web.fetch).
http.downloadmediumStart a background download. Returns a download_id.
http.download_statuslowBytes downloaded / total / progress %.
http.download_cancellowCancel a running download.
http.download_listlowList active + completed downloads.

Egress policy

CONSTRAINTS:

ConstraintTypeDescription
allowed_hostsstring_listAllowlist for write methods (POST / PUT / PATCH / DELETE).
blocked_hostsstring_listBlocklist for every method.

Two modes

App YAMLBehaviour
No tools.capabilities: block (dev / trusted)Write methods allowed to any host.
tools.capabilities: declaredWrite methods to external hosts blocked unless allowed_hosts lists them. Loopback (localhost, 127.0.0.1, ::1) always allowed.

When blocked, the error includes the exact constraint to add:

Host 'api.example.com' not in allowed_hosts.
Add to tools.modules.http.constraints.allowed_hosts.

SSRF guard

Every outbound URL passes through validate_url () - same private-network blocklist as the web module:

  • Loopback: 0.0.0.0/8, 127.0.0.0/8, ::1/128.
  • RFC 1918: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
  • Carrier-grade NAT: 100.64.0.0/10.
  • AWS / GCP metadata: 169.254.0.0/16.
  • IPv6 link-local + ULA: fe80::/10, fc00::/7.
  • Multicast / reserved: 224.0.0.0/4, 240.0.0.0/4.

DNS resolved once and pinned. The original hostname is preserved in the Host header for SNI / vhost routing.

Configuration

The module needs no required config. Tunables (when supplied):

tools:
modules:
http:
config:
timeout: 30 # default request timeout (s)
max_retries: 3 # transient failures
user_agent: "MyBot/1.0" # custom UA header
constraints:
allowed_hosts: [api.github.com, api.openai.com]
blocked_hosts: [evil.example.com]

Cross-references