Follow Discord
Sweep 20 Nov 2026 · 19:55Z Build v2.1.330 547 read Stable v2.1.323 Latest v2.1.330 Next v2.1.330 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

tools-web-restrictions changedmanaged-agents/tools-web-restrictions

Nearest release: v2.1.323, published 4 hours after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+20added
Lines−18removed
From line 55 where the diff opens
First seen 6 Oct 2026 this site's first read of the page
Recorded edits22to this page, all time

The whole hunk

from line 55, old and new numbered
/
lines
from line 55
5555 
5656## Set domain lists on an agent
5757 
58The following example creates an agent that limits `web_search` to two sites and blocks one host for `web_fetch`. It also sets `user_location` (java, php: `userLocation`; csharp, go: `UserLocation`) and `max_content_tokens` (java, php: `maxContentTokens`; csharp, go: `MaxContentTokens`), which [Settings](https://platform.claude.com/docs/en/managed-agents/tools-web-restrictions#settings) describes. The response echoes the `configs` (csharp, go: `Configs`) array.
58The following example creates an agent that limits `web_search` to two sites and blocks one host for `web_fetch`. It also sets `user_location` (java, php: `userLocation`; csharp, go: `UserLocation`) and `max_content_tokens` (java, php: `maxContentTokens`; csharp, go: `MaxContentTokens`). [Settings](https://platform.claude.com/docs/en/managed-agents/tools-web-restrictions#settings) describes both.
5959 
6060<CodeGroup defaultLanguage="CLI">
6161 ```bash cURL
from line 121
121121 ```
122122 </File>
123123 
124 [`ant apply`](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/apply) creates the agent and prints its ID, not the `configs` array.
124 [`ant apply`](https://platform.claude.com/docs/en/cli-sdks-libraries/cli/apply) creates the agent and prints its ID.
125125 </CodeGroupItem>
126126 
127127 ```python Python
from line 326
326326 ```php PHP
327327 use Anthropic\Beta\Agents\BetaManagedAgentsAgentToolset20260401;
328328 use Anthropic\Beta\Agents\BetaManagedAgentsAgentToolset20260401Params;
329 use Anthropic\Beta\Agents\BetaManagedAgentsModel;
329330 use Anthropic\Beta\Agents\BetaManagedAgentsUserLocation;
330331 use Anthropic\Beta\Agents\BetaManagedAgentsWebFetchToolConfigParams;
331332 use Anthropic\Beta\Agents\BetaManagedAgentsWebSearchToolConfigParams;
from line 336
335336 
336337 $agent = $client->beta->agents->create(
337338 name: 'Research Agent',
338 model: 'claude-opus-5-5',
339 model: BetaManagedAgentsModel::CLAUDE_OPUS_5_5,
339340 tools: [
340341 BetaManagedAgentsAgentToolset20260401Params::with(
341342 configs: [
from line 368
367368 
368369 agent = client.beta.agents.create(
369370 name: "Research Agent",
370 model: "claude-opus-5-5",
371 model: Anthropic::Beta::BetaManagedAgentsModel::CLAUDE_OPUS_5_5,
371372 tools: [
372373 {
373374 type: :agent_toolset_20260401,
from line 388
387388 ]
388389 )
389390 
390 case agent.tools.first
391 in Anthropic::Models::Beta::BetaManagedAgentsAgentToolset20260401 => toolset
392 puts JSON.pretty_generate(toolset.configs.map(&:to_h))
391 agent.tools.each do |tool|
392 if tool.is_a?(Anthropic::Beta::BetaManagedAgentsAgentToolset20260401)
393 puts JSON.pretty_generate(tool.configs.map(&:to_h))
394 end
393395 end
394396 ```
395397</CodeGroup>
from line 419
417419 
418420## Domain list rules
419421 
420These rules apply to `allowed_domains` (java, php: `allowedDomains`; csharp, go: `AllowedDomains`) and `blocked_domains` (java, php: `blockedDomains`; csharp, go: `BlockedDomains`) alike. A request that breaks one is rejected, as [Validation errors](https://platform.claude.com/docs/en/managed-agents/tools-web-restrictions#validation-errors) describes.
422These rules apply to `allowed_domains` (java, php: `allowedDomains`; csharp, go: `AllowedDomains`) and `blocked_domains` (java, php: `blockedDomains`; csharp, go: `BlockedDomains`) alike. The API rejects a request that breaks any of these rules, as [Validation errors](https://platform.claude.com/docs/en/managed-agents/tools-web-restrictions#validation-errors) describes.
421423 
422424* **At most one list on an entry:** Set either `allowed_domains` (java, php: `allowedDomains`; csharp, go: `AllowedDomains`) or `blocked_domains` (java, php: `blockedDomains`; csharp, go: `BlockedDomains`) on an entry, not both.
423425* **List size:** Each list holds 1 to 64 domains, each 1 to 255 characters.
from line 449
447449| A single-label name | `intranet` | A full domain such as `example.co.uk` |
448450| Non-ASCII characters, as in an internationalized domain name | | The `xn--` (Punycode) form |
449451 
450A domain is also rejected if it contains credentials or whitespace, or if one of its labels starts or ends with a hyphen. `localhost` and hosts ending in `.localhost`, `.local`, `.internal`, `.localdomain`, or `.invalid` are rejected too.
452The API also rejects a domain that contains credentials or whitespace, or that has a label starting or ending with a hyphen. It rejects `localhost` and hosts ending in `.localhost`, `.local`, `.internal`, `.localdomain`, or `.invalid` too.
451453 
452454### Path suffixes on web search domains
453455 
from line 461
459461 
460462The API validates these settings when you [create an agent](https://platform.claude.com/docs/en/managed-agents/agent-setup#create-an-agent) or [update an agent](https://platform.claude.com/docs/en/managed-agents/agent-setup#update-an-agent). It also validates them when you create or update a session that supplies `tools` (csharp, go: `Tools`).
461463 
462Format and limit violations are rejected with a 400 `invalid_request_error`:
464The API rejects format and limit violations with a 400 `invalid_request_error`:
463465 
464| Violation | Error message |
465| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
466| An entry sets both lists. | Includes `Only one of allowed_domains or blocked_domains may be set.` |
467| A list is empty. | Includes `allowed_domains: Empty list of domains is ambiguous. Provide at least one domain or null.` |
468| A domain breaks a format rule. | Names the domain’s list and zero-based position. For example, `allowed_domains.0: IP addresses are not supported; provide a plain hostname like "example.com"` |
466| Violation | Error message |
467| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
468| An entry sets both lists. | Includes `Only one of allowed_domains or blocked_domains may be set.` |
469| A list is empty. | Includes `allowed_domains: Empty list of domains is ambiguous. Provide at least one domain or null.` |
470| A domain breaks a format rule. | Names the domain’s list and zero-based position, as in `allowed_domains.0: IP addresses are not supported; provide a plain hostname like "example.com"` |
469471 
470472On the same requests, the API also rejects three settings that depend on the search and fetch providers:
471473 
472474* A domain in `allowed_domains` (java, php: `allowedDomains`; csharp, go: `AllowedDomains`) that Anthropic’s crawler is not allowed to access.
473* A `user_location.country` that the search provider does not support. The message ends in `user_location.country: not a country the search provider supports`.
474* A `user_location.timezone` that is not a valid IANA name.
475* A `user_location.country` (java, php: `userLocation.country`; csharp, go: `UserLocation.Country`) that the search provider does not support. The message ends in `user_location.country: not a country the search provider supports`.
476* A `user_location.timezone` (java, php: `userLocation.timezone`; csharp, go: `UserLocation.Timezone`) that is not a valid IANA time zone name.
475477 
476478In a cloud environment with `limited` [networking](https://platform.claude.com/docs/en/managed-agents/environments#networking), session create and update also check `allowed_domains` (java, php: `allowedDomains`; csharp, go: `AllowedDomains`) against the environment’s `allowed_hosts` (java, php: `allowedHosts`; csharp, go: `AllowedHosts`). See the rule in [Set domain lists on an agent](https://platform.claude.com/docs/en/managed-agents/tools-web-restrictions#set-domain-lists-on-an-agent).
477479 
Feedback