codex - 💡(How to fix) Fix codex cli interactive mode doesn't honor config for domain filtering [4 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19146Fetched 2026-04-24 05:59:54
View on GitHub
Comments
4
Participants
3
Timeline
11
Reactions
0
Author
Timeline (top)
commented ×4labeled ×4closed ×1mentioned ×1

Fix Action

Fix / Workaround

Tip: Update Required - This version will no longer be supported starting May 8th. Please upgrade to the latest version (https://github.com/openai/codex/releases/latest) using your preferred package manager.

Code Example

model = "gpt-5.4"
model_reasoning_effort = "medium"
approvals_reviewer = "user"

default_permissions = "workspace"

[shell]
program = "/bin/bash"
args = ["--noprofile", "--norc"]

[permissions.workspace.filesystem]
":root" = "read"
":tmpdir" = "write"

[permissions.workspace.filesystem.":project_roots"]
"." = "write"

[permissions.workspace.network]
enabled = true
# full is still filtered by domain but allows POST etc (c.f. limited)
mode = "full"
# needed to resolve local 10.* IPs
allow_local_binding = true

[permissions.workspace.network.domains]
"example.com" = "allow"

[projects."/spare/local/ahornby/local/codex"]
trust_level = "trusted"

---

codex $ ~/bin/codex-x86_64-unknown-linux-musl.0.123
╭──────────────────────────────────────────────────────╮
>_ OpenAI Codex (v0.123.0)│                                                      │
│ model:     gpt-5.4 medium   /model to change         │
│ directory: /spare/local/ahornby/local/codex/codex-rs │
╰──────────────────────────────────────────────────────╯

  Tip: New Build faster with Codex.

 run curl -q --connect-timeout 5 --max-time 10 https://example.com

Running the exact curl command in the repo environment first. If sandboxed network blocks it, I’ll retry with an escalation request.

 Ran curl -q --connect-timeout 5 --max-time 10 https://example.com
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: example.com

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

The sandbox blocked DNS resolution. Retrying the same command outside the sandbox so you get the real result.

---

$ ./target/debug/codex
╭──────────────────────────────────────────────────────╮
>_ OpenAI Codex (v0.0.0)│                                                      │
│ model:     gpt-5.4 medium   /model to change         │
│ directory: /spare/local/ahornby/local/codex/codex-rs │
╰──────────────────────────────────────────────────────╯

  Tip: Update Required - This version will no longer be supported starting May 8th. Please upgrade to the latest version (https://github.com/openai/codex/releases/latest) using your
  preferred package manager.

 run curl -q --connect-timeout 5 --max-time 10 https://example.com

Running the exact curl command in the repo shell so I can report the result directly.

 Ran curl -q --connect-timeout 5 --max-time 10 https://example.com
100   528    0   528    0     0   2934      0 --:--:-- --:--:-- --:--:--  2949
    <!doctype html><html lang="en"><head><title>Example Domain</title><meta name="viewport" content="width=device-width,
    initial-scale=1"><style>body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}</
    style></head><body><div><h1>Example Domain</h1><p>This domain is for use in documentation examples without needing permission. Avoid use in operations.</p><p><a href="https://
    iana.org/domains/example">Learn more</a></p></div></body></html>

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

The command succeeded with exit code 0.

  It returned the example.com HTML page, beginning with:

  <!doctype html><html lang="en"><head><title>Example Domain</title>...

  It downloaded 528 bytes within the timeout.

 run curl -q --connect-timeout 5 --max-time 10 https://google.com

Running the exact curl command against google.com and I’ll report the response.

 Ran curl -q --connect-timeout 5 --max-time 10 https://google.com
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    curl: (56) CONNECT tunnel failed, response 403

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

The command failed with exit code 56.

  curl reported:

  curl: (56) CONNECT tunnel failed, response 403

  So the request to https://google.com was blocked by the current network/proxy path, unlike https://example.com.
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.123.0

What subscription do you have?

enterprise GPT and API KEY - repro was via API KEY

Which model were you using?

gpt-5.4

What platform is your computer?

Ubuntu 24.04 Linux 6.14.0-37-generic x86_64 x86_64

What terminal emulator and version are you using (if applicable)?

iTerm2 -> ssh-> tmux codex is running inside the remote linux tmux session

What issue are you seeing?

granular workspace permissions are not being honored in the codex tui, so I can't let it run automatically against an allowlist of domains but block everything else

example repro below. I've also prepared a local fix if you are interested in a PR

What steps can reproduce the bug?

With the config snippet below codex 0.123 blocks a curl of example.com despite it being in the allowlist. e.g.

~/.codex/config.toml

model = "gpt-5.4"
model_reasoning_effort = "medium"
approvals_reviewer = "user"

default_permissions = "workspace"

[shell]
program = "/bin/bash"
args = ["--noprofile", "--norc"]

[permissions.workspace.filesystem]
":root" = "read"
":tmpdir" = "write"

[permissions.workspace.filesystem.":project_roots"]
"." = "write"

[permissions.workspace.network]
enabled = true
# full is still filtered by domain but allows POST etc (c.f. limited)
mode = "full"
# needed to resolve local 10.* IPs
allow_local_binding = true

[permissions.workspace.network.domains]
"example.com" = "allow"

[projects."/spare/local/ahornby/local/codex"]
trust_level = "trusted"
codex $ ~/bin/codex-x86_64-unknown-linux-musl.0.123
╭──────────────────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.123.0)                           │
│                                                      │
│ model:     gpt-5.4 medium   /model to change         │
│ directory: /spare/local/ahornby/local/codex/codex-rs │
╰──────────────────────────────────────────────────────╯

  Tip: New Build faster with Codex.

› run curl -q --connect-timeout 5 --max-time 10 https://example.com

• Running the exact curl command in the repo environment first. If sandboxed network blocks it, I’ll retry with an escalation request.

• Ran curl -q --connect-timeout 5 --max-time 10 https://example.com
  └   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: example.com

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

• The sandbox blocked DNS resolution. Retrying the same command outside the sandbox so you get the real result.

What is the expected behavior?

expected behaviour is that with the given config example.com is allowed but other domains like google.com are blocked. Here is an example of expected behaviour from my local fix where example.com is resolved but google.com blocked:

$ ./target/debug/codex
╭──────────────────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.0.0)                             │
│                                                      │
│ model:     gpt-5.4 medium   /model to change         │
│ directory: /spare/local/ahornby/local/codex/codex-rs │
╰──────────────────────────────────────────────────────╯

  Tip: Update Required - This version will no longer be supported starting May 8th. Please upgrade to the latest version (https://github.com/openai/codex/releases/latest) using your
  preferred package manager.

› run curl -q --connect-timeout 5 --max-time 10 https://example.com

• Running the exact curl command in the repo shell so I can report the result directly.

• Ran curl -q --connect-timeout 5 --max-time 10 https://example.com
100   528    0   528    0     0   2934      0 --:--:-- --:--:-- --:--:--  2949
    <!doctype html><html lang="en"><head><title>Example Domain</title><meta name="viewport" content="width=device-width,
    initial-scale=1"><style>body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}</
    style></head><body><div><h1>Example Domain</h1><p>This domain is for use in documentation examples without needing permission. Avoid use in operations.</p><p><a href="https://
    iana.org/domains/example">Learn more</a></p></div></body></html>

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

• The command succeeded with exit code 0.

  It returned the example.com HTML page, beginning with:

  <!doctype html><html lang="en"><head><title>Example Domain</title>...

  It downloaded 528 bytes within the timeout.

› run curl -q --connect-timeout 5 --max-time 10 https://google.com

• Running the exact curl command against google.com and I’ll report the response.

• Ran curl -q --connect-timeout 5 --max-time 10 https://google.com
  └   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
    curl: (56) CONNECT tunnel failed, response 403

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

• The command failed with exit code 56.

  curl reported:

  curl: (56) CONNECT tunnel failed, response 403

  So the request to https://google.com was blocked by the current network/proxy path, unlike https://example.com.

Additional information

No response

extent analysis

TL;DR

The issue can be resolved by adjusting the network permissions configuration in the config.toml file to correctly implement domain allowlisting.

Guidance

  1. Review network permissions configuration: Ensure that the permissions.workspace.network.domains section in config.toml is correctly set up to allow specific domains.
  2. Verify domain allowlisting: Confirm that the allow_local_binding option is set to true to resolve local IPs and that the mode is set to "full" to allow POST requests.
  3. Check for typos and formatting: Verify that the domain names in the permissions.workspace.network.domains section are correctly spelled and formatted.
  4. Test with a minimal configuration: Try simplifying the config.toml file to only include the necessary permissions settings to isolate the issue.

Example

No code snippet is provided as the issue seems to be related to configuration rather than code.

Notes

The provided local fix suggests that the issue may be related to the implementation of domain allowlisting in the Codex CLI. However, without more information about the local fix, it's difficult to provide a more specific solution.

Recommendation

Apply a workaround by adjusting the network permissions configuration in the config.toml file, as the issue seems to be related to the configuration rather than a version-specific bug.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING