[BUG] WebFetch "Unable to verify domain is safe" error

Status Open
Maintainer reply None cached
Activity 15 comments · opened Aug 23, 2025

Environment

  • Platform (select one):
  • Claude CLI version: 1.0.89 (Claude Code)
  • Operating System: macOS (Darwin 24.6.0)
  • Terminal: VS Code integrated terminal

Bug Description

WebFetch tool fails to access Microsoft Learn documentation URLs with "Unable to verify if domain is safe to
fetch" error. This appears to be a regression as the functionality worked previously. The issue affects deep URLs
while base domains work correctly.

Steps to Reproduce

  1. Open Claude Code in VS Code
  2. Use WebFetch tool with command: WebFetch(url: "https://learn.microsoft.com/en-us/semantic-kernel/concepts/plugi

ns/adding-mcp-plugins?pivots=programming-language-python", prompt: "Get documentation content")

  1. Observe the error response

Expected Behavior

WebFetch should successfully fetch and process content from Microsoft Learn documentation pages, as it did in
previous versions.

Actual Behavior

Error: Unable to verify if domain learn.microsoft.com is safe to fetch. This may be due to network restrictions or
enterprise security policies blocking claude.ai.
API Error (Request timed out.) · Retrying in 1 seconds… (attempt 1/10)

Full prompt:
read https://learn.microsoft.com/en-us/semantic-kernel/concepts/plugins/adding-mcp-plugins and make sure we are
following this pattern

⏺ I'll read the Microsoft documentation on MCP plugins in Semantic Kernel to ensure we're following the correct
pattern.

⏺ Fetch(https://learn.microsoft.com/en-us/semantic-kernel/concepts/plugins/adding-mcp-plugins)
⎿ Error: Unable to verify if domain learn.microsoft.com is safe to fetch. This may be due to network restrictions
or enterprise security policies blocking claude.ai.

⏺ Let me try a web search instead to find the Microsoft Semantic Kernel MCP plugin documentation.

⏺ Web Search("Microsoft Semantic Kernel MCP plugins adding pattern documentation 2024")
⎿ Did 0 searches in 360ms

Additional Context

Working URLs:

Failing URLs:

Network Verification:

  • Local network can access all URLs successfully via curl/browser
  • Issue appears to be on Anthropic's infrastructure side, not user network
  • Inconsistent behavior suggests rate limiting or domain filtering policies

Impact: This significantly reduces Claude Code effectiveness for searching web for development workflows and
documentation research tasks.

View original on GitHub ↗

15 Comments

github-actions[bot] · 1 year ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/6188
  2. https://github.com/anthropics/claude-code/issues/4053
  3. https://github.com/anthropics/claude-code/issues/1217

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

csseiip · 1 year ago

using home wifi, not corporate.

grantcarthew · 1 year ago

The comment on https://github.com/anthropics/claude-code/issues/6188 indicates that the WebFetch tool is checking domains via:

https://claude.ai/api/web/domain_info?domain=

We're using Claude Code via Google Vertex AI and the domain claude.ai is blocked by our firewall. This is what's preventing the WebFetch tool from working.

<img width="1837" height="115" alt="Image" src="https://github.com/user-attachments/assets/b245c044-719b-42a2-947e-33db9e6e0ec9" />

The domain check should be to a more generic endpoint. CloudFlare or OpenDNS? Something that is less likely to be blocked by enterprises.

For the time being, I'm having to tell Claude Code to curl the addresses which is far from ideal. Maybe I should make a local tool to bypass this issue.

Your customers are blocked because of this. Do now close this issue. Please address it.

grantcarthew · 1 year ago

Claude Code WebFetch Domain Validation Issue in Enterprise Environments

Problem Summary

Claude Code's WebFetch tool fails in enterprise environments with restrictive firewalls, even when target domains are accessible. The tool requires internet access to claude.ai/api/web/domain_info for domain validation, which is often blocked by corporate security policies.

Technical Details

WebFetch Process Flow

  1. Domain Validation: WebFetch calls https://claude.ai/api/web/domain_info?domain=<target_domain>
  2. Response Check: Expects {"domain":"<domain>","can_fetch":true}
  3. Content Fetch: Only proceeds if validation succeeds
  4. Processing: Converts HTML to markdown and applies user prompt

Failure Scenario

  • Target Domain: Accessible (e.g., curl -I https://docs.gitlab.com works)
  • Validation Endpoint: Blocked by firewall (claude.ai domain restrictions)
  • Result: WebFetch fails with "Unable to verify if domain is safe to fetch"

Error Message

Error: Unable to verify if domain github.com is safe to fetch. This may be due to network restrictions or enterprise security policies blocking claude.ai.

Impact on Enterprise Users

Affected Functionality

  • Documentation research and analysis
  • Code repository examination
  • API documentation fetching
  • General web content analysis

Common Enterprise Scenarios

  • Corporate firewalls blocking claude.ai domain
  • Zero-trust network policies
  • VPN restrictions on AI/ML services
  • Government/regulated industry security requirements

Current Workarounds

1. Network-Level Solutions

  • Firewall Exception: Whitelist claude.ai/api/web/domain_info specifically
  • VPN Toggle: Switch to personal network temporarily
  • Mobile Hotspot: Tether to personal device for WebFetch operations

2. Alternative Tools

  • Bash + curl: Use curl -s <url> for simple HTML fetching
  • Local Tools: Create custom web fetching scripts

3. Administrative Solutions

  • IT Request: Request specific endpoint access for legitimate business use
  • Proxy Configuration: Route validation requests through approved channels

Proposed Solutions

Short-term Fixes

  1. Better Error Messages: Clarify that the issue is with domain validation, not target access
  2. Bypass Option: Allow users to skip validation with a flag or configuration
  3. Fallback Behavior: Attempt direct fetch if validation fails

Long-term Solutions

  1. Local Domain Cache: Pre-approved list of common documentation domains
  2. Offline Validation: Local heuristics for determining "safe" domains
  3. Configuration Override: Allow enterprise admins to disable validation
  4. Proxy Support: Built-in proxy configuration for validation requests

Ideal Enterprise Features

# ~/.claude-code/config.yml
webfetch:
  domain_validation: false  # Disable for enterprise environments
  # OR
  validation_proxy: "http://corporate-proxy:8080"
  # OR
  trusted_domains:
    - "*.github.com"
    - "*.gitlab.com" 
    - "docs.*"

Technical Implementation Suggestions

Option 1: Graceful Degradation

async function validateDomain(domain) {
  try {
    const response = await fetch(`https://claude.ai/api/web/domain_info?domain=${domain}`);
    return await response.json();
  } catch (error) {
    // Fallback: Allow common documentation domains
    const trustedPatterns = [
      /^docs\./,
      /\.github\.com$/,
      /\.gitlab\.com$/,
      /\.readthedocs\.io$/
    ];
    
    if (trustedPatterns.some(pattern => pattern.test(domain))) {
      return { domain, can_fetch: true };
    }
    
    throw new Error(`Domain validation failed and ${domain} not in trusted list`);
  }
}

Option 2: Configuration-Based

Allow users to configure validation behavior:

  • Skip validation entirely
  • Use custom validation endpoint
  • Maintain local whitelist

Option 3: Proxy Detection

Automatically detect corporate proxy settings and route validation requests appropriately.

Business Case for Fix

User Experience Impact

  • Reduced Functionality: Core feature unavailable in enterprise settings
  • Workflow Disruption: Users must find alternative tools
  • Learning Curve: Workarounds require additional technical knowledge

Enterprise Adoption Barriers

  • Security Compliance: Cannot modify firewall rules for single tool
  • Policy Conflicts: AI service restrictions vs. legitimate documentation access
  • Support Overhead: IT departments fielding requests for domain exceptions

Related Issues

  • Enterprise proxy support
  • Offline documentation access
  • Corporate firewall compatibility
  • Zero-trust network environments

Environment Details

  • OS: macOS (Darwin 24.6.0)
  • Network: Corporate environment with restrictive firewall
  • Accessible: Target domains (github.com, docs.gitlab.com) via curl
  • Blocked: claude.ai domain and subdomains
  • Verification: Domain validation API works on personal network

---

Note: This issue affects legitimate business use cases where users need to research documentation, analyze code repositories, and access technical resources that are publicly available but cannot be reached due to the dependency on Anthropic's validation service.

trionia · 9 months ago

As a workaround, you can use the skipWebFetchPreflight flag to disable the security API call check.

grantcarthew · 9 months ago

The skipWebFetchPreflight setting does not appear in their documentation @trionia ?

https://code.claude.com/docs/en/settings

trionia · 9 months ago

@grantcarthew
The feature is not documented. I found it digging the sources. Also, it is mentioned in https://github.com/anthropics/claude-code/issues/6166#issuecomment-3207946059.

ashaykubal · 9 months ago

This happens for home networks too and is not limited to enterprise environments.

vintaclectic · 8 months ago

So there's zero solutions to this shit? Mine has been royally stopped and fucked for 2 days now, can't do anything and paying $108/month. Fix immediately.

tommyhutcheson · 8 months ago

Work around for me has been added the fetch MCP to my Claude code profile. Can't remember which I'm using probs https://mcpservers.org/servers/modelcontextprotocol/fetch

So there's zero solutions to this shit? Mine has been royally stopped and fucked for 2 days now, can't do anything and paying $108/month. Fix immediately.
grantcarthew · 8 months ago

I built my own solution to get around this issue and it is far better. Extremely token efficient.

It's open source MPL2 license.

https://github.com/grantcarthew/snag

Intelligently fetch web page content using a browser engine.

github-actions[bot] · 7 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

grantcarthew · 7 months ago

I don't think it is fixed Mr Bot.

ar-cisco · 7 months ago

This workaround worked for me:

Add skipWebFetchPreflight to your Claude Code settings file: ~/.claude/settings.json:

  { 
    // other settings                                                                                                                                                         
    "skipWebFetchPreflight": true                                                                                                                             
  } 
0l0v3r1 · 4 months ago

Still reproducing on v2.1.98 (macOS, direct API)

Environment:

  • Claude Code: 2.1.98
  • macOS 26.4 (Darwin 25.4.0, ARM64)
  • Node.js v25.8.2
  • Direct Anthropic API (not Bedrock, not headless)
  • Terminal: standard shell (zsh)

Behavior:
The error is intermittent. In the same session:

  1. WebFetch(url: "https://github.com/anthropics/claude-code/releases") → failed with Unable to verify if domain github.com is safe to fetch
  2. Minutes later, same URL → succeeded
  3. Other domains (google.com, example.com, docs.anthropic.com) worked fine in the same session

Network verification:

curl -I https://github.com → HTTP/2 200 ✓

GitHub is fully reachable. The issue is in the preflight verification step, not network connectivity.

Possible v2.1.98 connection:
This release includes significant Bash tool permission hardening and security fixes (backslash-escaped flag bypass, compound command bypass, /dev/tcp redirect checks, etc.). The tightened security layer may have changed or added stricter checks in the WebFetch preflight path, making the intermittent Cloudflare challenge issue more frequent.

Workaround:
"skipWebFetchPreflight": true in ~/.claude/settings.json (from a comment on this thread) — but this shouldn't be necessary for well-known domains like github.com.

This issue is marked stale but clearly not resolved. Please re-triage.