AWS bedrock: Documented Web Search domain filtering and user location options
Summary
Adds documentation for the web_search tool's filters parameter (up to 100 allowed_domains and 100 blocked_domains, with subdomain matching) and the optional user_location parameter (country/region/city/timezone, ISO 3166-1 alpha-2 validation, default US), including code samples.
Security assessment
Domain allow/block lists are a security-relevant control that limits which external sites a model's web search can reach, reducing exposure to untrusted or malicious content; the user_location parameter also involves sharing location data. This is feature/hardening documentation, not a fix for a specific vulnerability.
Evidence
+Domain filtering restricts Web Search results to a set of domains you specify. On the `web_search` tool, use the `filters` parameter to set up to 100 `allowed_domains` and up to 100 `blocked_domains`.
Diff
diff --git a/bedrock/latest/userguide/web-search.md b/bedrock/latest/userguide/web-search.md index 236e6d6..ef3e3fb 100644 --- a//bedrock/latest/userguide/web-search.md +++ b//bedrock/latest/userguide/web-search.md @@ -290,0 +291,46 @@ Over the wire, the annotation event looks like this: +### Domain filtering + +Domain filtering restricts Web Search results to a set of domains you specify. On the `web_search` tool, use the `filters` parameter to set up to 100 `allowed_domains` and up to 100 `blocked_domains`. + +Omit the `http://` or `https://` prefix when you list a domain, and note that each entry also matches its subdomains — for example, `aws.amazon.com` also covers `docs.aws.amazon.com`. + + + tools=[{ + "type": "web_search", + "external_web_access": False, + "filters": { + "allowed_domains": [ + "aws.amazon.com", + "docs.aws.amazon.com" + ] + } + }] + +### User location + +`user_location` is an optional parameter that is used to share location information with the Web Search tool. Depending on the model, location information will be used by a combination of the model and/or search services to localize the response. When this parameter is not configured or empty, location defaults to United States. + +Values for `country` are not case sensitive, so `de` is accepted as `DE`. The value is checked against assigned ISO 3166-1 alpha-2 codes. Unassigned and user-assigned codes such as `UK` and `XK` are rejected. Values for `region` and `city` are accepted as free-form strings. `timezone` is accepted as an IANA time zone identifier. + +#### Customizing user location + + + from openai import OpenAI + + client = OpenAI() + + response = client.responses.create( + model="openai.gpt-5.6-terra", + input="What are the best restaurants near me?", + tools=[{ + "type": "web_search", + "external_web_access": False, + "user_location": { + "type": "approximate", + "country": "US", + }, + }], + ) + + print(response.output_text) +