Fetch errors
WebFetch "unable to verify" a domain: Claude Code's preflight check
Why Claude Code's WebFetch says it cannot verify a domain is safe, how to test the check's host, and how to turn it off safely with skipWebFetchPreflight and rules.
By Lucian Dyer, FetchMCP team · Published
This article was drafted with AI assistance from the sources listed below and edited and published by the FetchMCP team. Disclosure: the FetchMCP API, which this article mentions, is this site's own product.
- 1Read the errorIt is about the preflight to Anthropic, not the page you asked for.
- 2Test the hostCheck that api.anthropic.com is reachable from this machine.
- 3Allowlist itAsk the network team to let api.anthropic.com through.
- 4Or skip the checkSet skipWebFetchPreflight: true in a settings file.
- 5Add domain rulesPair it with WebFetch(domain:...) allow rules for the sites you need.
You ask Claude Code to read a docs page, and WebFetch answers with something like "Unable to verify if domain learn.microsoft.com is safe to fetch." The page opens fine in your browser. The failure is not about that page. It is about a check WebFetch runs before it fetches anything.
Checked against the Claude Code docs on 2026-11-23.
What the check does
WebFetch asks Anthropic first. Before it fetches a URL, the tool sends the requested hostname to api.anthropic.com, where it is checked against a safety blocklist that Anthropic maintains. The docs list what is sent:
- The hostname only.
- Not the full URL, not the path, not the page contents.
A pass is cached for five minutes. A hostname that is blocked, or whose check failed, is checked again on the next request. That explains why the error can come and go: the next attempt makes a fresh check.
Why it fails on some networks
api.anthropic.com has to be reachable. If your network blocks that host, every WebFetch call fails, whatever the target site is.
The provider does not matter. The docs say the check runs whichever model provider you use, so a session on Amazon Bedrock or Google Cloud's Agent Platform still makes it. The WebFetch domain check is listed as on by default for every provider.
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC does not stop it either. That variable turns off other traffic, but the docs state that it does not affect the WebFetch check, which has its own opt-out.
A bug report opened in August 2025 against Claude Code 1.0.89 quotes the message ending in "enterprise security policies blocking claude.ai." The current docs name api.anthropic.com as the host the check uses.
Step 1: test the host
Run a request to the check's host from the same machine and network:
curl -sS -o /dev/null -w "%{http_code}\n" https://api.anthropic.com
If the request times out or the connection fails, look at the proxy or firewall between this machine and the host.
Step 2: allowlist the host
api.anthropic.com on the proxy allowlist is the clean fix. The docs give it as the first of two options. With the host reachable, WebFetch keeps the blocklist check and works as designed.
Step 3: or turn the check off
skipWebFetchPreflight is the documented setting. Set it to true in a settings file, and pick the file that matches who should get it:
| File | Who it affects |
|---|---|
~/.claude/settings.json | You, in every project on this machine |
.claude/settings.json | Everyone in the project, once committed |
.claude/settings.local.json | You, in this one project |
| Managed settings | Everyone your organization deploys them to |
Settings files are strict JSON, so a // comment or a trailing comma is an error.
The trade-off is spelled out in the docs: with the check off, WebFetch tries any URL without consulting the blocklist. The docs recommend pairing it with WebFetch permission rules if you need to limit which domains Claude can reach.
Step 4: add domain rules
WebFetch(domain:…) rules match the hostname of the requested URL. A user settings file that turns the check off and allows example.com and all of its subdomains without a prompt:
{
"skipWebFetchPreflight": true,
"permissions": {
"allow": [
"WebFetch(domain:example.com)",
"WebFetch(domain:*.example.com)"
]
}
}
Three matching details from the permissions docs:
WebFetch(domain:example.com)matchesexample.comonly. It does not coverapi.example.com.WebFetch(domain:*.example.com)matches subdomains at any depth, but notexample.comitself. That is why the snippet needs both lines.- Wildcards in WebFetch rules need Claude Code v2.1.172 or later.
Domains with no allow rule still prompt. WebFetch asks for approval by default, apart from a built-in set of preapproved documentation domains. Deny rules from any scope are evaluated before allow rules, so a team or managed deny still wins over your allow.
Run /status after you save. Its Setting sources line shows which settings files Claude Code loaded.
Where a fetch MCP server fits
The check is part of the WebFetch tool. A fetch MCP server is a different tool: Claude Code reaches it over the transport you configured, and its tool names start with mcp__. Its permissions use mcp__<server>__<tool> rules, not WebFetch(domain:…) rules.
If you use one, the WebFetch vs fetch MCP comparison shows what each hands the model, and the fetch errors guide covers the errors an MCP fetch tool returns.
Try it with a real server
FetchMCP API runs a remote fetch MCP server with a bearer key. The MCP server registers 2 tools. Failed fetches cost 0 credits. The add command for Claude Code is in the MCP docs.
Frequently asked questions
Why does Claude Code say it is unable to verify if a domain is safe to fetch?
Before WebFetch reads a URL, Claude Code sends the hostname to api.anthropic.com to check it against a blocklist Anthropic maintains. If that request fails, for example because a firewall or proxy blocks the host, WebFetch fails even when the target site is reachable.
Does CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC turn off the WebFetch domain check?
No. The Claude Code docs say the check is not affected by that variable and runs on every model provider, including Bedrock and Google Cloud. The only documented opt-out is skipWebFetchPreflight: true in a settings file.
What does Claude Code send in the WebFetch domain check?
Only the hostname. The docs say the full URL, the path and the page contents are not sent. A hostname that passes is cached for five minutes; a blocked or failed one is checked again on the next request.
Does the WebFetch domain check apply to a fetch MCP server?
The documented check is part of the WebFetch tool. A fetch MCP server is a separate tool, and its permissions use mcp__<server>__<tool> rules rather than WebFetch(domain:...) rules.
Sources
- Data usage: WebFetch domain safety check (Claude Code docs) (Documentation)
- Configure permissions: WebFetch rules (Claude Code docs) (Documentation)
- Settings files and precedence (Claude Code docs) (Documentation)
- [BUG] WebFetch "Unable to verify domain is safe" error (anthropics/claude-code #6388) (News)