Skip to content

Feature Request: Add "include_domains" and "exclude_domains" parameters to "WebSearchTool" #1018

Open
@Mubeen-Fatima

Description

@Mubeen-Fatima

Hi OpenAI team,

I’d like to request an enhancement for the WebSearchTool in the openai-agents-python SDK. Currently, the tool performs unrestricted web searches, but it would be very helpful to have more control over the search scope.


Proposed Feature

Add optional parameters to WebSearchTool to:

  • Restrict search results to specific domains (include_domains list).
  • Exclude specific domains (exclude_domains list).

This would enable use cases such as:

  • Searching only within trusted sources (e.g., nytimes.com, wikipedia.org).
  • Excluding low-quality or irrelevant sites.
  • Focusing on a specific website or a group of websites when building specialized agents.

Possible API Design

WebSearchTool(
    include_domains=["example.com", "anotherdomain.org"],
    exclude_domains=["spam.com"]
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions