Codex Network Proxy: What features.network_proxy Does
The Codex "network proxy" is not a way to choose an exit country. This page explains what it is, which keys control it and what to check when a command cannot reach a site.
Two different things share the word proxy
The first is the Codex network proxy: a listener on your own machine (by default http://127.0.0.1:3128, with a SOCKS5 listener on 8081) that sits between sandboxed commands and the internet and checks each destination against your domain rules.
The second is an outside proxy server, such as a static ISP IP, that your traffic is sent through so that it leaves from another address. That is set with environment variables like HTTPS_PROXY, not with features.network_proxy. The rest of this page is about the first one.
Set network_access = true under [sandbox_workspace_write], or enable network in the permissions profile you use.
Step 2: Enable the proxy and list hosts
Add [features.network_proxy] with enabled = true and a domains map. Use exact hosts, *.example.com for subdomains only, **.example.com for the domain and its subdomains. If a host matches both allow and deny, deny wins.
Step 3: Restart Codex and test
Start a new session, then run the three checks below inside it and compare the answers with your rules.
Step 4: Keep rules narrow
The reference allows a global * rule but the approvals page recommends scoped rules. Add hosts as you meet a real need.
config.toml example
# ~/.codex/config.toml
# 1) Let commands in the workspace-write sandbox use the network at all
[sandbox_workspace_write]
network_access = true
# 2) Start the network proxy so domain rules are enforced (experimental)
[features.network_proxy]
enabled = true
domains = { "api.openai.com" = "allow", "*.github.com" = "allow", "example.com" = "deny" }
Example only. The keys follow the Codex configuration reference; the hosts are placeholders for yours.
Check from inside a session
# Inside a Codex session, ask it to run these and read the answers:
curl -sS -o /dev/null -w "%{http_code}\n" https://api.openai.com/v1/models # 401 = reachable (no key sent)
curl -sS -o /dev/null -w "%{http_code}\n" https://example.org/ # blocked if not on the allow list
curl -sS https://ipinfo.io/json # which exit IP do commands use?
Example only. A 401 from api.openai.com without a key means the host was reachable; the third line shows the exit IP that commands use.
When a command cannot reach a site
Every request fails and the proxy is on
Check Network access may be off: the proxy does not grant it. Check network_access or the profile's network.enabled.
Fix Turn network access on, restart Codex and test again.
Stop when If it still fails with access on and the host allowed, test the same host without the proxy to rule out your own network.
One host is refused
Check The domains map has no allow rule for it, or a deny rule matches and deny wins.
Fix Add an exact allow rule, or narrow the deny pattern.
Stop when Do not add a global * allow just to make one host work.
localhost or a private address is refused
Check allow_local_binding is false by default, which blocks loopback and private destinations.
Fix Add an exact allow rule for the local address you need, or set allow_local_binding only if you understand what it opens.
Stop when Keep it off on shared machines.
Web search or an MCP tool ignores the rules
Check Domain rules do not cover web search, apps, MCP or other hosted tools.
Fix Control those tools with their own settings.
Stop when Do not rely on domain rules to restrict them.
Where an outside proxy fits
If you sign in to Codex with a ChatGPT account from a place where you want a stable, clean exit, that is done with an outside proxy, not with this setting. A static ISP IP stays the same for the whole lease and does not rotate, so one account keeps one address. A proxy does not change OpenAI's terms: use Codex only where OpenAI supports it, because OpenAI warns that using its services from other places may get an account blocked or suspended. If verification appears, complete it honestly.
A static ISP IP costs US$0.50 for one day and US$7.99 for 30 days, the same in every country, and is issued with HTTP or SOCKS5 chosen at purchase. Codex CLI itself is documented in our guide with HTTP proxies. There is no free trial, and the smallest purchase is one IP for one day.
What a proxy MCP server is, how local and remote MCP servers differ, how to install one in Claude Code, Codex CLI and Cursor, and how to route the server's own traffic through a proxy.
Product facts file of the site (values checked against the console, the backend and the price table on 18-19 October 2026): prices in US$ (1 PTC = US$1), lease terms, protocols, no free trial.
Read on 15 November 2026: features.network_proxy is "experimental; off by default"; enabled, domains (allow or deny, deny wins, exact hosts, *.example.com, **.example.com, *), proxy_url default http://127.0.0.1:3128, socks_url default http://127.0.0.1:8081, allow_local_binding default false, allow_upstream_proxy default true; permissions.<name>.network.enabled "does not start the network proxy"; domain rules do not cover web search, apps, MCP or other hosted tools.
Read on 15 November 2026: network access in the workspace-write sandbox is off unless network_access = true; features.network_proxy "does not grant network access by itself"; network on and proxy off means unrestricted; network on and proxy on means traffic follows the domain policy.
Read on 15 November 2026: using the services in countries or territories not on the supported list "may result in your account being blocked or suspended."
Ready to try it?
Create an account, top up once, then pick rotating residential, static ISP or datacenter IPs and have one running in your browser within minutes.