You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(fetch): add allowed_domains and blocked_domains filters
Lets operators restrict the fetch tool to a curated set of hosts (or
deny a few sensitive ones), mirroring Anthropic's web-fetch tool and
Claude Code's WebFetch permission model. Patterns match the host and
any subdomain by default; a leading dot restricts to strict subdomains.
The check runs before any network call (including robots.txt) so blocked
URLs never leak DNS or TCP traffic.
Assisted-By: docker-agent
Copy file name to clipboardExpand all lines: agent-schema.json
+22Lines changed: 22 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1319,6 +1319,28 @@
1319
1319
"description": "Timeout in seconds for the fetch tool",
1320
1320
"minimum": 1
1321
1321
},
1322
+
"allowed_domains": {
1323
+
"type": "array",
1324
+
"description": "Allow-list of domains the fetch tool is permitted to fetch (only valid for type 'fetch'). A pattern matches the host exactly (case-insensitive) and any of its subdomains; e.g. 'example.com' matches 'example.com' and 'docs.example.com' but not 'badexample.com'. A leading dot ('.example.com') restricts the match to strict subdomains. Mutually exclusive with 'blocked_domains'.",
1325
+
"items": {
1326
+
"type": "string"
1327
+
},
1328
+
"examples": [
1329
+
["docker.com", "docs.docker.com"],
1330
+
["github.com", "raw.githubusercontent.com"]
1331
+
]
1332
+
},
1333
+
"blocked_domains": {
1334
+
"type": "array",
1335
+
"description": "Deny-list of domains the fetch tool is forbidden to fetch (only valid for type 'fetch'). Uses the same matching rules as 'allowed_domains'. Mutually exclusive with 'allowed_domains'.",
| `timeout` | int | `30` | Default request timeout in seconds (overridable per tool call). |
34
+
| `allowed_domains` | array[string] | _none_ | Allow-list of hosts the tool may fetch. When set, every URL whose host is **not** in the list is rejected before any network call is made. Mutually exclusive with `blocked_domains`. |
35
+
| `blocked_domains` | array[string] | _none_ | Deny-list of hosts the tool must not fetch. URLs whose host matches one of these patterns are rejected before any network call (including `robots.txt`) is made. Mutually exclusive with `allowed_domains`. |
36
+
37
+
### Domain matching
38
+
39
+
Domain patterns in `allowed_domains` and `blocked_domains` use the following rules (case-insensitive):
40
+
41
+
- **Bare domain** — `example.com` matches the host `example.com` _and_ any subdomain such as `docs.example.com`. It does **not** match unrelated hosts that share a suffix (e.g. `badexample.com`).
42
+
- **Leading dot** — `.example.com` matches **only** strict subdomains (`docs.example.com`, `a.b.example.com`), not the apex `example.com`.
43
+
- **IP literal** — IP addresses are matched exactly (`169.254.169.254`).
44
+
45
+
The lists are mutually exclusive: a single fetch toolset may set either `allowed_domains` or `blocked_domains`, but not both.
34
46
35
47
### Custom Timeout
36
48
@@ -40,6 +52,27 @@ toolsets:
40
52
timeout: 60
41
53
```
42
54
55
+
### Restrict to specific domains
56
+
57
+
```yaml
58
+
toolsets:
59
+
- type: fetch
60
+
allowed_domains:
61
+
- docker.com # docker.com and *.docker.com
62
+
- github.com # github.com and *.github.com
63
+
- .githubusercontent.com # only subdomains, e.g. raw.githubusercontent.com
0 commit comments