OpenProgram Docs

Outbound network proxy

A direct, peer-pinned connection cannot reach services available only through the user's proxy. Fake-IP proxies such as Clash also answer local DNS from 198.18.0.0/15, which a local-resolver policy refuses as NON_GLOBAL_ADDRESS though the real resolution happens in the proxy.

Who follows the proxy

ConsumerExamplesRoute
Arbitrary public URLstool.web_fetch, tool.image_result.download, channel attachments and assetsordinary proxy
Fixed audited HTTPS servicessearch APIs including DuckDuckGo, image APIs, updater, skills catalog, office assets, channel APIs, TTSordinary proxy
Providersprovider.*, webui.model_listing.*ordinary proxy only when the exact origin is in the provider API or OAuth inventory
Configured custom origins, loopback callbacksprivate services an owner exception allowsdirect, peer-pinned

The route is chosen before the target policy, for every request and redirect hop. A NO_PROXY match, or no route, connects directly with the full local address check.

Targets the proxy resolves

TargetDecision
IP literalChecked directly; private, loopback, reserved, fake-IP and metadata refused
Single-label, localhost, or .localhost .local .lan .home.arpa .internal .intranet .corp .homeRefused before any lookup
Metadata hostnameMETADATA_ADDRESS
Local answer is a real private, loopback, link-local, reserved or metadata addressRefused
Local answer is fake-IP (198.18.0.0/15), or the lookup failsLeft to the proxy
Malformed answerRefused

The decision carries requires_proxy; building a direct pool or socket for it raises PROXY_ROUTE_REQUIRED. Fixed audited services also accept fake-IP on direct connections, since TLS verifies a hostname the caller cannot choose. Untrusted public URLs never do.

Which proxy

  1. Explicit security.outbound_url.policy_proxy, with its enforcement requirement; ordinary routing is then unused.
  2. OPENPROGRAM_PROXY_URL, keeping NO_PROXY.
  3. Standard variables through HTTPX, with Python's macOS and Windows system settings as fallback. Loopback is always bypassed.
AspectBehaviour
Poolshttpcore proxy pools with a decision-aware backend, for HTTP, HTTPS and SOCKS5
ForwardingHTTPS targets tunnelled by hostname with CONNECT; plain HTTP in absolute form
Proxy addressOwner-selected; metadata and link-local forbidden
CredentialsProxy authentication goes only to the handshake; redirects do not forward credentials across origins
VerificationTLS checks the original hostname; Host comes from the validated origin
FailureNever falls back to direct
Client cacheRouting map is immutable within a client and part of its cache identity; a new call after a change retires stale clients
Explicit transport-security objectsDo not inherit ambient routing
Choices and residual risk
ChoiceDecision
Environment parsingHTTPX's parsing and URLPattern precedence are reused; no second NO_PROXY matcher
PolicyProxyConfigStays apart from ordinary routing: a normal Clash proxy does not enforce URL policy, so local checks still run in front of it
Left outNew profile, disabling URL protection, OAuth change, routing of custom services
CA bundlesStay under outbound security configuration
RiskPosition
Final resolutionBehind a proxy, it is the proxy's
Public hostname with a private real answerCaught only when the local resolver returns that answer; behind a fake-IP resolver, or with DNS rebinding between the check and the proxy's lookup, the proxy's rules decide
Still appliedRead-only methods, the 80/443 limit for untrusted URLs, credential stripping
For a strict guaranteeAn enforcing policy proxy, or hosts in NO_PROXY
Acceptance
  • Sync and async public entries use HTTP, HTTPS and SOCKS5 routes.
  • web_fetch behind a fake-IP resolver reaches the target by hostname.
  • IP literals, local names and real private answers stay refused when proxied; NO_PROXY hosts keep the direct check.
  • A proxy-resolved decision never opens a direct socket.
  • NO_PROXY and override precedence hold; shared clients are replaced when routes change.
  • Unauthorized target and proxy addresses are rejected before network activity; service and proxy credentials stay apart; policy-proxy behaviour and cleanup are retained.
How OpenClaw does it

Sources: references/openclaw/src/infra/net/proxy-env.ts, proxy-fetch.ts, src/infra/net/proxy/, its proxy docs.

  • One environment resolver mirroring undici's EnvHttpProxyAgent: lowercase first; HTTPS prefers https_proxy, then http_proxy; ALL_PROXY as fallback. A full reimplemented NO_PROXY matcher with IPv4 CIDR gates every decision.
  • One override: --proxy-url, proxy.proxyUrl, OPENCLAW_PROXY_URL, optional --proxy-ca-file, over undici ProxyAgent, with a managed proxy lifecycle.
  • Provider helpers route through these; the SSRF guard uses the same matchesNoProxy.

OpenProgram borrows one documented reading of the standard variables and adds a separate policy-proxy boundary. OpenClaw's proxy lifecycle validation is not needed here.

Implementation status

In openprogram/host/security/url_policy.py (proxy_resolves, requires_proxy), safe_http.py (uses_ambient_proxy, route before policy) and load_outbound_security_config. Not yet: the sandbox command proxy (openprogram/host/sandbox/network_policy.py) keeps its own direct public-address rule and does not recognise fake-IP answers.

Last updated · 2026-11-25