Skip to content

web_fetch useTrustedEnvProxy ignores NO_PROXY env variable #93807

Description

@Coldwings

Bug Report

Version

2026.6.6

Summary

tools.web.fetch.useTrustedEnvProxy ignores the NO_PROXY env variable, causing all requests (including local addresses) to be routed through the proxy.

Current Behavior

When useTrustedEnvProxy: true is set, web_fetch reads HTTP_PROXY/HTTPS_PROXY from environment variables but does not respect NO_PROXY. As a result, requests to localhost, 127.0.0.1, or 192.168.* addresses are still sent through the proxy instead of being accessed directly.

Expected Behavior

web_fetch should check NO_PROXY (or no_proxy) and bypass the proxy for matching domains/IPs, consistent with standard HTTP client behavior.

Reproduction Steps

  1. Configure environment variables:
    HTTP_PROXY=http://192.168.31.164:7890
    HTTPS_PROXY=http://192.168.31.164:7890
    NO_PROXY=localhost,192.168.*,127.0.0.1
    
  2. Set OpenClaw config:
    {
      tools: {
        web: {
          fetch: {
            useTrustedEnvProxy: true
          }
        }
      }
    }
  3. Use web_fetch to access a local address (e.g., http://192.168.31.33:8123 or http://localhost:8080)
  4. Observe that the request is routed through the proxy instead of direct access

Impact

  • Local services (Home Assistant, internal APIs) fail or suffer unnecessary latency
  • Users must choose between: (a) no proxy for external sites, or (b) proxy for everything including local

Workaround

Use exec + curl with manual proxy control for local access, or disable useTrustedEnvProxy and accept that external sites won't work through proxy.

Related

  • useTrustedEnvProxy was introduced in 2026.6.6
  • ssrfPolicy allows fake-IP proxy ranges, but does not address the NO_PROXY gap

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions