Skip to content

Disable Codex web search by default unless web-search tool is specified#20460

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/fix-codex-web-search-usage
Closed

Disable Codex web search by default unless web-search tool is specified#20460
Copilot wants to merge 3 commits intomainfrom
copilot/fix-codex-web-search-usage

Conversation

Copy link
Contributor

Copilot AI commented Mar 11, 2026

Codex CLI enables web search by default, allowing agents to perform web searches even when web-search is not listed in the workflow's tools section. This explicitly disables it with --no-search unless opted in.

Changes

  • pkg/workflow/codex_engine.go: Default webSearchParam to --no-search; set --search only when ParsedTools.WebSearch is present
  • pkg/workflow/codex_engine_test.go: Add TestCodexEngineWebSearchDisabledByDefault covering both enabled and disabled cases
  • Lock files: Recompiled all Codex workflow lock files to include --no-search

Before/After

# Before: no flag passed, Codex uses web search by default
codex ${...}exec --dangerously-bypass-approvals-and-sandbox ...

# After: explicitly disabled unless web-search tool is configured
codex ${...}exec --no-search --dangerously-bypass-approvals-and-sandbox ...

# With web-search tool present
codex ${...}exec --search --dangerously-bypass-approvals-and-sandbox ...

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • developers.openai.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (dns block)
  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw /tmp/go-build1740840479/b001/importcfg -pack /tmp/go-build1740840479/b001/_testmain.go (http block)
  • https://api.github.com/repos/actions/download-artifact/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha (http block)
  • https://api.github.com/repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b
    • Triggering command: /usr/bin/gh gh api /repos/astral-sh/setup-uv/git/ref/tags/eac588ad8def6316056a12d4907a9d4d84ff7a3b --jq .object.sha (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/a70c5eada06553e3510ac27f2c3bda9d3705bccb --jq .object.sha (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/# --jq .object.sha (http block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits March 11, 2026 03:15
… tool is specified

Co-authored-by: eaftan <4733401+eaftan@users.noreply.github.com>
Co-authored-by: eaftan <4733401+eaftan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Codex using web search without tool provided Disable Codex web search by default unless web-search tool is specified Mar 11, 2026
@pelikhan
Copy link
Contributor

Refactoring of agentic engine in process. Delay this.

@eaftan
Copy link
Contributor

eaftan commented Mar 11, 2026

OK, will redo this once the refactoring is done. Closing.

@eaftan eaftan closed this Mar 11, 2026
@pelikhan
Copy link
Contributor

Good bug though. Models have started bundling web search...

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Codex is able to use web search even when tool is not provided

3 participants