Claude Code “Unable to Verify if Domain Is Safe to Fetch”: WebFetch Fix

Claude Code “Unable to Verify if Domain Is Safe to Fetch”: WebFetch Fix

The Claude Code “unable to verify if domain is safe to fetch” error means the WebFetch tool could not finish its domain safety check, so it refused to download the page; unable to verify domain means the check failed, not the site. Before every new site, WebFetch sends just the hostname to api.anthropic.com and asks if it is on Anthropic’s blocklist. If that request is blocked, times out or fails, you get this message instead of the page.

It almost always shows up on corporate networks, behind a strict proxy or firewall, or on setups that use Amazon Bedrock, Google Cloud’s Agent Platform or Microsoft Foundry with locked-down outbound traffic. The website you asked for is usually fine. The check in front of it is what fails.

You have two real fixes. Allowlist api.anthropic.com in your proxy or firewall, or skip the check by adding "skipWebFetchPreflight": true to a Claude Code settings.json file. If you skip it, add WebFetch domain rules so you still control which sites Claude can reach.

Browse all our Claude Code tutorials for more fixes and how-tos.

Tested with Claude Code v2.1.328 on macOS on November 20, 2026. To trigger the error safely, we used a throwaway demo folder, a proxy address that is switched off, and a tiny local test server we wrote that stands in for the model, so no real model calls were made.

Quick Summary

QuestionShort answer
Exact messageUnable to verify if domain example.com is safe to fetch. This may be due to network restrictions or enterprise security policies blocking claude.ai.
What failedThe WebFetch domain safety check, not the website
Host the check usesapi.anthropic.com (only the hostname is sent)
Fix 1Allowlist api.anthropic.com in your proxy or firewall
Fix 2"skipWebFetchPreflight": true in settings
Keep controlAdd WebFetch(domain:...) allow and deny rules
Similar messageThe safety check for domain ... is rate-limited (HTTP 429)

What the Domain Safety Check Does

WebFetch is the built-in tool Claude uses to read a web page. Before it requests any page, it checks the site’s hostname against a safety blocklist that Anthropic maintains. Only the hostname goes out, not the full URL, the path or the page contents.

A hostname that passes is cached for five minutes, so you won’t see a check on every fetch. A failed or blocked check is not cached, so the next fetch to that site runs the check again.

Two details surprise most people. The check runs no matter which model provider you use, and the CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC switch does not turn it off. That is why Bedrock and Foundry users see this error even when everything else works.

Diagram of the WebFetch domain safety check: Claude asks to fetch, hostname goes to api.anthropic.com, check cannot finish, Unable to verify message
Why the page is never requested when the check can’t finish

One more thing about the wording. The message mentions claude.ai, but the official docs say the check itself goes to api.anthropic.com. So when you talk to your IT team, ask about api.anthropic.com first.

Claude Code data usage docs explaining that WebFetch sends only the hostname to api.anthropic.com and caches passing hostnames for five minutes
Anthropic’s data usage page: only the hostname is sent to the check

We Reproduced the Unable to Verify Domain Error

You can’t safely break a real company network to test this, so we built a small copy of one. In a demo folder, we pointed HTTPS_PROXY at a local address where nothing is listening. Every request to api.anthropic.com now fails, just like on a network that blocks it.

We also pointed ANTHROPIC_BASE_URL at a tiny local test server. It plays the model’s part: it asks for one WebFetch call, then reports what came back. Its replies start with “[test server]” so you can tell them apart from real Claude output.

Terminal showing claude --version 2.1.328, a WebFetch allow rule, a proxy that is down and curl failing to reach api.anthropic.com
Test setup: a proxy that is down, so api.anthropic.com can’t be reached

The project’s .claude/settings.local.json already allows WebFetch(domain:example.com). That matters: it proves the permission was fine, and the fetch still failed. Permission rules decide whether Claude may fetch; the safety check runs on top of them.

What You See in the Session

We started Claude Code in manual mode and typed “Fetch https://example.com and tell me its title”. The tool line came back as “Not fetched”, which is the first sign of this error.

Claude Code session where the Fetch tool for example.com shows Not fetched
The short view only says “Not fetched”

Press ctrl+o to open the detailed transcript. Now the red error line shows the real reason, and the tool result carries the full message word for word.

Expanded Claude Code transcript showing Error: Unable to verify if domain example.com is safe to fetch
The detailed view shows the exact “Unable to verify” message

In our session the fetch ran inside a small helper step, which is why you see a nested Fetch line. The error text is the same either way, and it matches Anthropic’s error reference exactly.

Claude Code error reference showing the rate-limited and Unable to verify messages for the WebFetch domain safety check
The official error reference lists both safety check messages

Why Claude Code Can’t Verify the Domain

The docs say this message appears when the check request failed, timed out or got an unexpected status. In practice, that comes down to a short list of causes.

  • A corporate firewall or web filter blocks api.anthropic.com.
  • A proxy is set in HTTPS_PROXY but is down, wrong or needs a login.
  • A TLS-inspecting proxy uses a root certificate that Claude Code doesn’t trust.
  • You run Claude Code through Bedrock, Agent Platform or Foundry, and outbound traffic to Anthropic is closed.
  • A VPN or container network has no route to the internet at all.
  • A short network blip, which a single retry clears.

Don’t confuse it with two close cousins. “Claude Code is unable to fetch from example.com” means the check worked and said that host can’t be fetched. “The safety check for domain example.com is rate-limited” means the check endpoint answered with HTTP 429, so wait a few minutes and try once.

How to Fix “Unable to Verify if Domain Is Safe to Fetch”

Work through these in order. The first fix that applies is usually the last one you need.

Decision ladder for the Claude Code unable to verify domain error: retry once, fix proxy or allowlist, skip the check, then add WebFetch domain rules
Which fix to try, top to bottom

Fix 1: Retry Once

If it happened a single time, ask Claude to fetch the page again. Failed checks aren’t cached, so a second try runs a fresh check. Don’t let Claude loop on it, though; if the second try fails, the problem is your network.

Fix 2: Check That api.anthropic.com Is Reachable

Run a quick curl to the host the check uses, then look at your proxy variables. Any HTTP status code means the host is reachable; a connection error means something is in the way.

env | grep -i -E '^(https?_proxy|no_proxy)='
curl -sS -m 10 -o /dev/null -w 'HTTP %{http_code}\n' https://api.anthropic.com
Terminal checks: no proxy variables, api.anthropic.com answered HTTP 404 directly, failed through a dead proxy, and skipWebFetchPreflight found in settings
Direct access works; the same request through the dead proxy fails

The 404 is fine here, since we only asked for the root page. What matters is that an answer came back.

Fix 3: Allowlist api.anthropic.com

On a managed network, ask your IT team to allow api.anthropic.com through the proxy and firewall. Anthropic’s network page lists it as required for Claude API requests, including the WebFetch domain safety check. Our guide to running Claude Code behind a proxy covers the full host list.

Claude Code network access requirements table with api.anthropic.com required for the WebFetch domain safety check
The network requirements table names the safety check under api.anthropic.com

If you use a proxy, set it as a full URL, such as HTTPS_PROXY=http://proxy.example.com:8080. If the proxy inspects TLS, install its root certificate in your system store or point NODE_EXTRA_CA_CERTS at it, as the network configuration docs explain.

Fix 4: Skip the Check With skipWebFetchPreflight

When Anthropic traffic must stay blocked, turn the check off. The official setting is skipWebFetchPreflight, a true/false value that works in any settings file.

{
  "skipWebFetchPreflight": true
}
Claude Code settings reference entry for skipWebFetchPreflight, which skips the WebFetch domain safety check
The official settings reference entry for skipWebFetchPreflight

We added it to the demo project’s .claude/settings.local.json and ran the same prompt. The proxy still blocked api.anthropic.com; we only let example.com through, like a network where the site works but Anthropic is closed. This time the page came back: “Received 660 bytes”.

Terminal showing skipWebFetchPreflight true in settings.local.json and Claude Code fetching example.com successfully
Same blocked network, check skipped: the page is fetched

Pick the file that fits your case:

FileWho it affectsUse it when
~/.claude/settings.jsonYou, in every projectYour whole network blocks Anthropic
.claude/settings.jsonEveryone on the repoThe team shares the same locked network
.claude/settings.local.jsonYou, in one projectTesting, or one odd setup
Managed settingsThe whole organizationIT rolls it out to all users

Not sure where these files live? See where settings.json is, or copy a working layout from our settings.json examples.

Fix 5: Add WebFetch Domain Rules After Skipping

With the check skipped, WebFetch will try any URL without the blocklist. Anthropic’s docs recommend pairing the setting with WebFetch permission rules, so you decide which sites Claude may read.

{
  "skipWebFetchPreflight": true,
  "permissions": {
    "allow": [
      "WebFetch(domain:docs.python.org)",
      "WebFetch(domain:*.github.com)"
    ],
    "deny": ["WebFetch(domain:pastebin.com)"]
  }
}

A rule like WebFetch(domain:example.com) matches only that host. Add WebFetch(domain:*.example.com) to cover its subdomains. Our permissions guide explains allow, ask and deny in more depth.

Claude Code permissions docs explaining WebFetch domain rules with wildcards
How WebFetch domain rules match hostnames

Fix 6: Turn WebFetch Off Instead

Some teams don’t want web fetching at all. Set CLAUDE_CODE_DISABLE_WEB_FETCH=1 (v2.1.285 or later) to remove the tool, or add a bare WebFetch deny rule. WebSearch stays available with the environment variable.

Unable to Verify vs Related WebFetch Errors

MessageWhat it meansWhat to do
Unable to verify if domain … is safe to fetchThe check failed or timed outAllowlist api.anthropic.com or skip the check
The safety check for domain … is rate-limitedThe check returned HTTP 429Try once later; skip it if it keeps happening
Claude Code is unable to fetch from …The check said this host is blockedUse another source; the host was never contacted
WebFetch cannot fetch localhost …Hostname has no dotUse curl through Bash for local servers

If the whole session fails to reach Anthropic, not just WebFetch, you have a bigger network problem. Start with our fix for the “unable to connect” API error.

Try It Yourself

Want to see whether your network blocks the check? Open Claude Code in an empty test folder and paste this prompt. It only reads one public page.

Use WebFetch to read https://example.com and tell me the page title.
If the fetch fails, show me the exact error text from the tool result.

If you get the “Unable to verify” message, run the curl check from Fix 2. Then add "skipWebFetchPreflight": true to .claude/settings.local.json in that folder, start a new session and try again.

The website is rarely the problem. The safety check in front of it is.

Common Mistakes

  • Allowlisting claude.ai only. The message names it, but the check goes to api.anthropic.com.
  • Expecting CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC to stop the check. It doesn’t; only skipWebFetchPreflight does.
  • Adding a WebFetch allow rule and expecting the error to go away. Rules don’t skip the check.
  • Adding the site to the sandbox allowedDomains list. WebFetch never reads the sandbox allowlist.
  • Skipping the check with no domain rules at all on a shared or sensitive machine.
  • Letting Claude retry in a loop. One retry is enough to rule out a blip.

Pro Tips

  • Put skipWebFetchPreflight in the same file as your provider settings, so the two always travel together. Our cloud provider guide shows those files.
  • For a team, commit the setting and the domain rules to .claude/settings.json, so everyone gets the same behavior.
  • Keep a short allow list of trusted docs sites and use ask for the rest.
  • Remember the ctrl+o view. “Not fetched” alone tells you little; the detailed view shows which message you hit.
  • If you also see slow or failed model calls, check our post on the request timeout error.

Cheat Sheet

Cheat sheet for fixing the Claude Code unable to verify domain error with checks and settings
Checks and settings for the WebFetch domain safety check

Frequently Asked Questions

Is it safe to set skipWebFetchPreflight to true?

It removes one safety net, the blocklist check, so WebFetch will try any URL. Anthropic suggests pairing it with WebFetch domain rules. With a sensible allow and deny list, most teams on locked networks use it.

What data does the domain safety check send?

Only the hostname, such as example.com. The docs say the full URL, path and page contents are not sent.

Why do I get this error with Bedrock or Foundry?

The check runs no matter which provider you use, and it always goes to api.anthropic.com. If your cloud setup blocks Anthropic, set skipWebFetchPreflight to true.

Does a WebFetch allow rule skip the check?

No. Allow rules only remove the permission prompt. Every fetch still passes the safety check first, unless you skip it in settings.

Where can I see other Claude Code error messages?

Our list of common Claude Code errors covers the usual ones, and Anthropic keeps an official error reference. You can also read more about the Claude AI assistant itself.

Conclusion

The Claude Code “unable to verify if domain is safe to fetch” error means WebFetch couldn’t reach its safety check at api.anthropic.com, so it refused to fetch the page, even when your permission rules allowed it. Retry once, then check the host with curl and your proxy settings. If you can, allowlist api.anthropic.com; if Anthropic traffic must stay blocked, add "skipWebFetchPreflight": true to your Claude Code settings and pair it with WebFetch domain rules. In our test on a blocked network, that one setting turned “Not fetched” into a working page in the very next session.

Newsletter

New AI tools in your inbox

The best new tools and the AI news that matters, in one short email. Unsubscribe any time.

Free · No spam · Unsubscribe any time

✓ Looks like you’re subscribed

Loading Google’s sign-up form…

Looks like you’re already subscribed

Thanks for reading! New AI tools and the AI news that matters will land in your inbox.

Not subscribed yet? Refresh the page to load the sign-up form.

The sign-up form couldn’t load. If you use an ad or content blocker, allow news.google.com and reload the page.

Free instant check before you pay. Takes a few seconds.

Scroll to Top