Skip to content

[BUG] WebFetch fails silently without permission prompt when using custom ANTHROPIC_BASE_URL #24921

Description

@Moskize91

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When using a custom API endpoint via ANTHROPIC_BASE_URL in settings.json, WebFetch operations fail with the error "Unable to verify if domain X is safe to fetch. This may be due to network restrictions or enterprise security policies blocking claude.ai."

The issues are:

  1. No permission prompt appears to allow the user to authorize the WebFetch request
  2. Claude Code automatically writes WebFetch permissions to .claude/settings.local.json, but the request still fails
  3. The error message is misleading - it's not a network/security policy issue, but a preflight check failure
  4. The workaround requires manually adding "skipWebFetchPreflight": true to settings, which is not documented or discoverable

What Should Happen?

Expected behavior:

  1. A permission prompt should appear asking the user to allow/deny the WebFetch request, regardless of the API endpoint being used
  2. OR, when using a custom ANTHROPIC_BASE_URL, Claude Code should automatically enable skipWebFetchPreflight since the preflight check may not work with proxy servers
  3. OR, at minimum, provide a clearer error message that suggests checking the skipWebFetchPreflight setting

The current behavior creates a confusing user experience where WebFetch appears broken with no clear path to resolution.

Error Messages/Logs

Steps to Reproduce

  1. Create .claude/settings.json with a custom API endpoint:
    {
    "env": {
    "ANTHROPIC_AUTH_TOKEN": "your-token",
    "ANTHROPIC_BASE_URL": "https://custom-proxy.example.com"
    }
    }

  2. Attempt to use WebFetch in a conversation (e.g., ask Claude to fetch a webpage)

  3. Observe the error: "Unable to verify if domain is safe to fetch..."

  4. Note that no permission prompt appears

  5. Check .claude/settings.local.json and observe that WebFetch permissions were written automatically but the request still fails

  6. Add "skipWebFetchPreflight": true to settings.json and restart VSCode

  7. WebFetch now works correctly

Environment:

  • Claude Code version: 2.1.39
  • VSCode version: [your version]
  • OS: macOS
  • Custom API endpoint: Yes (third-party proxy)

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.39

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:autharea:toolsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSstaleIssue is inactive

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions