Claude Desktop 3P mode: WebFetch fails because domain safety check is not allowed/proxied
Summary
When using CC Switch as the Claude Desktop / Claude Code gateway, Claude Code's built-in WebFetch consistently fails for normal public domains such as:
github.com
react.dev
en.wikipedia.org
blog.rust-lang.org
www.rust-lang.org
The error reported by Claude Code is:
Unable to verify if domain <domain> is safe to fetch. This may be due to network restrictions or enterprise security policies blocking claude.ai.
The model API gateway itself is reachable and works. The failure appears to be specific to Claude Code's WebFetch domain safety verification flow.
Environment
- OS: Windows 10
- Claude Desktop: Microsoft Store build
1.8089.1
- Claude Code bundled by Claude Desktop 3P mode:
2.1.142
- CC Switch: Windows desktop app,
cc-switch.exe build timestamp around 2026-05-16
- Gateway base URL used by Claude Desktop 3P config:
http://127.0.0.1:15721/claude-desktop
What works
The CC Switch gateway is reachable locally.
With the configured Authorization: Bearer <inferenceGatewayApiKey> header:
GET http://127.0.0.1:15721/claude-desktop/v1/models -> HTTP 200
POST http://127.0.0.1:15721/claude-desktop/v1/messages -> HTTP 200
So this is not a general gateway connectivity issue.
Also, outside Claude Desktop's 3P sandbox, the required Anthropic domain safety endpoint is reachable:
GET https://api.anthropic.com/api/web/domain_info?domain=github.com
-> {"domain":"github.com","can_fetch":true}
The same is true for react.dev, en.wikipedia.org, blog.rust-lang.org, and www.rust-lang.org.
Diagnosis
Claude Code has a hardcoded WebFetch domain safety check:
https://api.anthropic.com/api/web/domain_info?domain=<domain>
WebFetch only proceeds when this returns can_fetch: true.
In Claude Desktop 3P mode, the local enterprise config generated by CC Switch contains:
{
"coworkEgressAllowedHosts": ["*"],
"inferenceProvider": "gateway",
"inferenceGatewayBaseUrl": "http://127.0.0.1:15721/claude-desktop"
}
However, in Claude Desktop 1.8089.1, coworkEgressAllowedHosts: ["*"] does not behave as "allow all domains".
From the bundled Claude Desktop code, ["*"] is translated into a fixed built-in host list, roughly covering package/tooling hosts such as:
- npm registry hosts
- PyPI hosts
- GitHub / GitHub object storage
- Ubuntu archive/security hosts
- crates.io hosts
- Playwright CDN hosts
It does not mean arbitrary egress is allowed.
Most importantly, it does not appear to allow the WebFetch safety-check path:
api.anthropic.com/api/web/domain_info
As a result, WebFetch fails before fetching the target URL, even for ordinary public documentation sites.
Reproduction
- Configure Claude Desktop 3P mode through CC Switch.
- Confirm Claude Desktop uses:
http://127.0.0.1:15721/claude-desktop
- In Claude Code, ask it to use
WebFetch on:
https://github.com/
https://react.dev/
https://en.wikipedia.org/
https://blog.rust-lang.org/
- Observe the error:
Unable to verify if domain <domain> is safe to fetch.
Expected behavior
CC Switch should support Claude Code's WebFetch safety-check flow in 3P mode.
At minimum, the following endpoint must be reachable from the Claude Code / Claude Desktop 3P environment:
https://api.anthropic.com/api/web/domain_info?domain=<domain>
or CC Switch should provide an equivalent compatible implementation/proxy for that endpoint.
Suggested fixes
One of the following would likely solve the issue:
- Add explicit support for Claude Code's WebFetch domain safety check:
GET /api/web/domain_info?domain=<domain>
returning an Anthropic-compatible response:
{
"domain": "example.com",
"can_fetch": true
}
- Ensure Claude Desktop 3P egress allows:
especially:
-
Do not rely on coworkEgressAllowedHosts: ["*"] as an "allow all" setting, because in the current Claude Desktop build it maps to a fixed built-in host list rather than arbitrary egress.
-
Provide a CC Switch UI/config option to append explicit WebFetch target hosts and the required Anthropic safety-check host.
Additional note
Changing coworkEgressAllowedHosts from ["*"] to an explicit host list was tested locally. Claude Desktop did read the updated host count, but this caused the 3P setup health status to become unstable (unreachable), even though the CC Switch model endpoints still returned HTTP 200 with the configured bearer token.
Therefore, a proper CC Switch-side compatibility fix is preferable to manually editing the generated Claude Desktop config.
Claude Desktop 3P mode: WebFetch fails because domain safety check is not allowed/proxied
Summary
When using CC Switch as the Claude Desktop / Claude Code gateway, Claude Code's built-in
WebFetchconsistently fails for normal public domains such as:github.comreact.deven.wikipedia.orgblog.rust-lang.orgwww.rust-lang.orgThe error reported by Claude Code is:
The model API gateway itself is reachable and works. The failure appears to be specific to Claude Code's WebFetch domain safety verification flow.
Environment
1.8089.12.1.142cc-switch.exebuild timestamp around2026-05-16What works
The CC Switch gateway is reachable locally.
With the configured
Authorization: Bearer <inferenceGatewayApiKey>header:So this is not a general gateway connectivity issue.
Also, outside Claude Desktop's 3P sandbox, the required Anthropic domain safety endpoint is reachable:
The same is true for
react.dev,en.wikipedia.org,blog.rust-lang.org, andwww.rust-lang.org.Diagnosis
Claude Code has a hardcoded WebFetch domain safety check:
WebFetch only proceeds when this returns
can_fetch: true.In Claude Desktop 3P mode, the local enterprise config generated by CC Switch contains:
{ "coworkEgressAllowedHosts": ["*"], "inferenceProvider": "gateway", "inferenceGatewayBaseUrl": "http://127.0.0.1:15721/claude-desktop" }However, in Claude Desktop
1.8089.1,coworkEgressAllowedHosts: ["*"]does not behave as "allow all domains".From the bundled Claude Desktop code,
["*"]is translated into a fixed built-in host list, roughly covering package/tooling hosts such as:It does not mean arbitrary egress is allowed.
Most importantly, it does not appear to allow the WebFetch safety-check path:
As a result, WebFetch fails before fetching the target URL, even for ordinary public documentation sites.
Reproduction
WebFetchon:Expected behavior
CC Switch should support Claude Code's WebFetch safety-check flow in 3P mode.
At minimum, the following endpoint must be reachable from the Claude Code / Claude Desktop 3P environment:
or CC Switch should provide an equivalent compatible implementation/proxy for that endpoint.
Suggested fixes
One of the following would likely solve the issue:
returning an Anthropic-compatible response:
{ "domain": "example.com", "can_fetch": true }especially:
Do not rely on
coworkEgressAllowedHosts: ["*"]as an "allow all" setting, because in the current Claude Desktop build it maps to a fixed built-in host list rather than arbitrary egress.Provide a CC Switch UI/config option to append explicit WebFetch target hosts and the required Anthropic safety-check host.
Additional note
Changing
coworkEgressAllowedHostsfrom["*"]to an explicit host list was tested locally. Claude Desktop did read the updated host count, but this caused the 3P setup health status to become unstable (unreachable), even though the CC Switch model endpoints still returnedHTTP 200with the configured bearer token.Therefore, a proper CC Switch-side compatibility fix is preferable to manually editing the generated Claude Desktop config.