claude-code - 💡(How to fix) Fix [BUG] [Cowork] settings.json deny rules for WebFetch and WebSearch not enforced in Cowork desktop app [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54087Fetched 2026-04-28 06:39:33
View on GitHub
Comments
2
Participants
3
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2

Error Message

Error Messages/Logs

None — no error is shown. Claude proceeds to use the tools as if no deny rules exist.

Fix Action

Fix / Workaround

Workaround in place: CLAUDE.md directives prohibiting web access + Bash(curl *) / Bash(wget *) deny rules (which do work). But WebFetch and WebSearch remain technically unblocked.

Code Example

None — no error is shown. Claude proceeds to use the tools as if no deny rules exist.
RAW_BUFFERClick to expand / collapse

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?

The deny permission rules in settings.json for WebFetch and WebSearch tools have no effect in the Cowork desktop app. Claude successfully searches the web and fetches URLs even when explicit deny rules are present in both the global ~/.claude/settings.json and project-level .claude/settings.json. Restarting the app does not help.

Notably, Bash deny rules (e.g. Bash(curl *), Bash(wget *)) do work correctly — the problem is specific to the built-in WebFetch and WebSearch tools.

What Should Happen?

Claude should be unable to use WebFetch or WebSearch when those tools are listed in the deny array, consistent with how Bash deny rules are enforced.

Error Messages/Logs

None — no error is shown. Claude proceeds to use the tools as if no deny rules exist.

Steps to Reproduce

  1. Add deny rules to ~/.claude/settings.json:

{ "permissions": { "deny": ["WebFetch", "WebSearch"] } }

  1. Restart the Cowork desktop app
  2. Open any project
  3. Ask Claude to search the web (e.g. "Can you search the web for X?")
  4. Observe: Claude successfully searches the web despite the deny rules

Also tested: project-level .claude/settings.json with the same deny rules — also has no effect.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

Claude 1.4758.0 (fb266c) 2026-04-24T20:22:30.000Z

Platform

Other

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

Use case: users managing sensitive personal data (financial records, health documents) in Cowork want to hard-restrict web access in specific projects to mitigate prompt injection risks, while keeping web access enabled in other projects (e.g. a daily news briefing project). Without working deny rules, no technical enforcement layer is available — only CLAUDE.md soft controls, which a crafted injection attack could theoretically override.

Workaround in place: CLAUDE.md directives prohibiting web access + Bash(curl *) / Bash(wget *) deny rules (which do work). But WebFetch and WebSearch remain technically unblocked.

extent analysis

TL;DR

The issue can be mitigated by using Bash deny rules as a workaround until the WebFetch and WebSearch deny rules are fixed.

Guidance

  • Verify that the deny rules are correctly formatted in both the global and project-level settings.json files.
  • Test the deny rules with other tools to ensure the issue is specific to WebFetch and WebSearch.
  • Use Bash deny rules (e.g., Bash(curl *), Bash(wget *)) as a temporary workaround to block web access.
  • Consider reporting this issue to the Claude Code developers to request a fix for the WebFetch and WebSearch deny rules.

Example

No code snippet is provided as the issue is related to configuration files and tool behavior.

Notes

The issue seems to be specific to the WebFetch and WebSearch tools, and the cause is unknown. The workaround using Bash deny rules may not be a permanent solution but can help mitigate the issue until a fix is available.

Recommendation

Apply the workaround using Bash deny rules until the WebFetch and WebSearch deny rules are fixed, as it provides some level of protection against unwanted web access.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] [Cowork] settings.json deny rules for WebFetch and WebSearch not enforced in Cowork desktop app [2 comments, 3 participants]