# WebFetch Permission Rule

> A rule that says which web sites Claude may fetch.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** WebFetch(domain:example.com), domain rule

## Think of it like

It is like a list of the shops a child may walk to alone.

## Definition

A WebFetch permission rule matches the web sites Claude may fetch. It is written as WebFetch(domain:) and a host name, such as WebFetch(domain:github.com). That host alone matches, so add *.github.com for its sub-sites. A bare WebFetch rule covers every site. It does not stop curl in the shell, so deny that too if it matters.

## Example

Jack lets Claude read the Python docs without asking. Every other site still asks first.

## Example code

```json
{
  "permissions": {
    "allow": ["WebFetch(domain:docs.python.org)", "WebFetch(domain:*.github.com)"]
  }
}
```

Fetch docs and GitHub pages without a prompt.

## Why it matters

A fetched page can carry hidden orders. Choosing the sites keeps that risk small.

## Common mistake

Allowing only WebFetch and thinking the web is fenced. If Bash may run curl, Claude can still reach any site.

## Three principles

- **domain: and a host.** One host each.
- ***. for sub-sites.** Not the host itself.
- **curl is separate.** Deny it too.

## Related terms

- [WebFetch Tool](https://learn.benibix.com/term/ai/web-fetch-tool)
- [Bash Permission Rule](https://learn.benibix.com/term/ai/bash-permission-rule)
- [Indirect Prompt Injection](https://learn.benibix.com/term/ai/indirect-prompt-injection)

## Told apart from

- [allowedDomains vs WebFetch Permission Rule](https://learn.benibix.com/compare/sandbox-allowed-domains-setting-vs-webfetch-permission-rule): People think allowedDomains decides which pages Claude can fetch. It does not. It only covers shell commands in the sandbox, such as curl or npm. Claude's own fetch tool follows WebFetch rules instead. The link runs one way: a WebFetch domain allow rule is also added to the sandbox list, but the sandbox list never opens a fetch.

---

Source: https://learn.benibix.com/term/ai/webfetch-permission-rule
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
