I am using the Responses API with web_search tool and filters.blocked_domains.
Environment:
openai-python==2.38.0
model=gpt-5.4-mini
Request shape:
response = client.responses.create(
model="gpt-5.4-mini",
tools=[{
"type": "web_search",
"filters": {
"blocked_domains": [
"blocked-domain-1.com",
"blocked-domain-2.com"
]
}
}],
tool_choice="required",
include=["web_search_call.action.sources"],
input="Give me some basic information about the company with this website: www.test.com",
)
Expected behavior: blocked domains should not appear in web_search_call.action.sources.
Actual behavior: across 213 test cases, blocked domains appeared in sources in 13 cases.
I confirmed:
using web_search, not web_search_preview
using Responses API, not Chat Completions
domains are normalized, without https:// or paths
fewer than 100 blocked domains
One related observation: in openai-python==2.38.0, the generated SDK type file appears to include allowed_domains but not blocked_domains:
Interesting report. The intermittent leakage rate (13/213) makes this seem less like outright unsupported behavior and more like either:
backend-side enforcement inconsistency
hostname normalization mismatch
or filtering occurring post-retrieval rather than pre-retrieval.
And one thing that may help isolate it further:
so compare SDK vs raw REST requests
and test redirect/canonical URL handling
and try testing subdomains separately (example.com vs www.example.com)
or inspect whether leaked domains only appear in sources or also influence generated output
If raw REST reproduces the same behavior, that would probably rule out SDK serialization and point more toward backend enforcement logic… maybe.. hmm… try
I have followed the proper rules by using domains such as example.com. However, the leakage of blocked domains seems to vary between test runs. Sometimes it is 5, sometimes 13, and sometimes 65. At this point, I am no longer sure what exactly web_search_call.action.sources contains, or whether it includes blocked domains.
I was unable to reproduce this. Are you still experiencing these issues?
However, I can confirm a Python SDK typing/schema gap where blocked_domains is valid and accepted by the API but missing from the generated WebSearchToolParam type.
Hey, No, I haven’t encountered the issue again. However, I’ve only run the same workflow 2–3 times since I posted here. I’ll update this thread if I experience the issue again.