---
type: email
from: jay-dhamale <notifications@github.com>
subject: [openai/openai-agents-python] Add domain filtering options to

 WebSearchTool (Issue #1542)
received: 2026-03-05 10:12:36
date_header: Wed, 20 Aug 2025 10:37:49 -0700
priority: normal
status: awaiting_approval
uid: 28198
---

## Email Content

**From:** jay-dhamale <notifications@github.com>
**Subject:** [openai/openai-agents-python] Add domain filtering options to

 WebSearchTool (Issue #1542)
**Date:** Wed, 20 Aug 2025 10:37:49 -0700

### Body (preview)

jay-dhamale created an issue (openai/openai-agents-python#1542)



## Feature Request



Add domain filtering options to the WebSearchTool in the OpenAI Agents SDK.



## Problem Statement



Currently, the WebSearchTool in the OpenAI Agents SDK provides basic web search functionality without domain filtering capabilities:



```python

from agents import Agent, WebSearchTool



agent = Agent(

    name="Research Assistant",

    tools=[WebSearchTool()],

    instructions="You help with research tasks"

)

```



This limitation prevents developers from:

- Focusing searches on specific trusted sources

- Excluding known unreliable or irrelevant domains

- Building agents that require domain-specific information (e.g., academic research, official documentation)



## Proposed Solution



Add optional domain filtering parameters to the WebSearchTool constructor:



1. `include_domains`: List of domains to limit search results to

2. `exclude_domains`: List of domains to exclude from search results



## Example Implementation



### Current Implementation:

```python

from agents import Agent, WebSearchTool, Runner



agent = Agent(

    name="Research Assistant",

    tools=[WebSearchTool()],

    instructions="Help users find reliable research papers"

)



# All web results are included, including potentially unreliable sources

result = await Runner.run(agent, "Find recent AI research papers")

```



### Proposed Enhancement:

```python

from agents import Agent, WebSearchTool, Runner



# Academic research agent with domain filtering

academic_agent = Agent(

    name="Academic Research Assistant",

    tools=[

        WebSearchTool(

            include_domains=["arxiv.org", "nature.com", "science.org", "ieee.org"],

            exclude_domains=["medium.com", "reddit.com", "quora.com"]

        )

    ],

    instructions="Find peer-reviewed research papers from academic sources"

)



# Official documentation agent

docs_agent = Agent(

    name="Documentati

---

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Escalate
