Skip to content

Add external_web_access to WebSearchTool for Responses API web_search #2785

Description

@ymuichiro

Please read this first

Describe the feature

Please add external_web_access: bool | None = None to WebSearchTool and pass it through to the Responses API web_search tool payload.

Background:

  • In the OpenAI Responses API, web_search supports external_web_access: false to disable live internet access and use cached/indexed results only.
  • In the current Agents SDK, WebSearchTool exposes user_location, filters, and search_context_size, but not external_web_access.
  • As a result, SDK users cannot explicitly choose cache-only / offline-like behavior when using the built-in web search tool.

Example API:

from agents import Agent, WebSearchTool

agent = Agent(
    name="Research agent",
    model="gpt-5",
    tools=[
        WebSearchTool(
            search_context_size="medium",
            external_web_access=False,
        )
    ],
)

Expected request payload:

{
    "type": "web_search",
    "search_context_size": "medium",
    "external_web_access": False,
}

This would be useful for:

  • Workflows that prefer reproducibility and want cached/indexed results only.
  • Policy or compliance requirements that do not allow live web access.
  • Keeping the Agents SDK aligned with the existing Responses API capability.

Related:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions