openai / openai/codex

Codex Cloud: built-in web open and search return 401 Unauthorized while shell HTTPS works

Open
#43,646 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auth bug codex-web tool-calls
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Codex Cloud’s built-in web tool returns 401 Unauthorized for both page opening and search, while shell HTTPS works in the same environment.

Observed September 7, 2026 (Pacific time). Agent internet access is On, with unrestricted domains and all HTTP methods allowed.

Exact reproduction

The cloud agent ran these two fresh calls separately through functions.exec and reported their exact source and raw responses.

Open:

const r = await tools.web__run({"open":[{"ref_id":"https://learn.chatgpt.com/docs/overview"}],"response_length":"long"}); text(r);

Search:

const r = await tools.web__run({"search_query":[{"q":"site:openai.com ChatGPT Work"}],"response_length":"long"}); text(r);

Complete response for each call:

Script failed
Wall time: 0.3 seconds
Process exited with code 1
Final output:
Script error:
Fatal error: http 401 Unauthorized: Some("{\"detail\":\"Unauthorized\"}")

Neither call returns content. In contrast, this shell request returns 200 OK with readable HTML:

curl --location --silent --show-error --max-time 30 --connect-timeout 10 https://learn.chatgpt.com/docs/overview
Expected behavior

The exposed web tool should retrieve public pages and search results, or explain why access is unavailable.

Diagnostics
  • A newly created environment also reproduces the issue. Its first task, with unrestricted internet and all HTTP methods enabled, returned 401 for both exact web calls. Shell HTTPS returned 200 (exit code 0), and HTMLParser confirmed readable main-page text. Tested at 2026-09-08T02:28:52Z.
  • Persists after saving environment settings, resetting the container cache, resuming the original task, and creating a fresh task.
  • The browser-side Codex assistant can retrieve the target pages with its own web tool.
  • Shell access to openai.com/chatgpt-work/ separately returns a Cloudflare challenge (403, cf-mitigated: challenge); this differs from the web-tool 401.
  • Related: #20928 reports shell proxy CONNECT 403; #15945 reports desktop/CLI search 503. Neither establishes a duplicate.
  • OpenAI Support escalated the report to a specialist; no repair is confirmed.

Signed-off-by: Codex (OpenAI AI assistant), reporting at the user’s request.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two tools.web__run calls through functions.exec, then compare their 401 responses with the successful curl request to the same page. Use the fresh-environment diagnostics to determine whether the failure is in the exposed web tool rather than shell HTTPS. Done means public page opening and search work, or the tool clearly explains why access is unavailable.

Written by the indexing model from the issue text.

Assessment

Domain
api, cloud
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.