Codex CLI and a Mobile Proxy: Allow Network Access First
Codex runs local commands in a sandbox, and in its default workspace-write mode network access is off, so a script cannot reach a proxy until you allow it. Turn network access on for the session, then use the prompts below to check your Coronium line and run a small collector through it. The line goes in the script's environment, not in Codex's settings.
The short version
- OpenAI's Codex documentation says the workspace-write sandbox keeps network access off unless you enable it in your configuration, in the CLI, the IDE extension and the desktop app.
- Allow it in config.toml with network_access = true under [sandbox_workspace_write], or for one run with -c 'sandbox_workspace_write.network_access=true'.
- Codex's own network proxy feature is a different thing: an experimental local listener that enforces domain rules. It does not give the sandbox network access, and it is not your mobile line.
- Give the script the line through environment variables you set yourself, and keep the password out of the prompt. Codex's shell_environment_policy setting decides which variables reach its commands.
Why a script in Codex cannot reach the proxy
Codex decides what local commands may do with a sandbox mode. In workspace-write, the default for local work, commands can edit files in the workspace, and network access is off until you turn it on. A curl through your line then fails the same way any request does: the sandbox stops the connection before it reaches the proxy.
So the order is: allow network access, check that a plain request works, then check the line.
Allow network access
To allow it every time, add a [sandbox_workspace_write] table to config.toml with network_access = true. To allow it for one session only, start Codex with codex -c 'sandbox_workspace_write.network_access=true'. These are settings you choose; the prompts below never change them for you.
Codex also has an experimental features.network_proxy setting, off by default. When it is on, it starts a local proxy for sandboxed commands and enforces domain rules: no external destination is allowed until you add allow rules. It works together with network_access and does not grant access by itself. If you turn it on, add the hosts your script calls, such as the IP echo service and the sites you collect from.
| Setting | Default | What it changes |
|---|---|---|
| sandbox_workspace_write.network_access | Off in workspace-write | Whether sandboxed commands can open network connections at all |
| features.network_proxy | Off (experimental) | A local proxy with domain rules for sandboxed commands; with it on, only allowed domains are reachable |
Check the line from Codex
The prompt first makes one plain request, so a sandbox block and a proxy error are not confused. Then it makes one request through the line and compares the IP with the dashboard.
Goal: Check that this Codex session can reach the network, then check which public IP my Coronium mobile line gives, with one request through the line.
What you need:
- The line's Connection IP, HTTP Port, Username and Password, from dashboard.coronium.io, Your Proxies. If they are already exported in my shell, use those; otherwise ask me to export them myself, not to paste them into the chat.
Steps:
1. Run curl -sS https://api.ipify.org once without a proxy. If it fails with a network or DNS error, stop and tell me the sandbox has no network access, so I can restart Codex with network access allowed. Do not try to work around the sandbox.
2. Check that CORONIUM_PROXY_HOST, CORONIUM_HTTP_PORT, CORONIUM_PROXY_USER and CORONIUM_PROXY_PASS are set in your shell, without printing their values. If any is missing, stop and tell me which. I export them myself before starting Codex, like this, with my own values:
export CORONIUM_PROXY_HOST="CONNECTION_IP"
export CORONIUM_HTTP_PORT="HTTP_PORT"
export CORONIUM_SOCKS_PORT="SOCKS5_PORT"
export CORONIUM_PROXY_USER="USERNAME"
export CORONIUM_PROXY_PASS="PASSWORD"
Codex passes variables to commands according to its shell_environment_policy setting; if they are set in my terminal but missing for you, tell me to check that setting.
3. Ask an IP echo service which address it sees through the line:
curl -x "http://$CORONIUM_PROXY_USER:$CORONIUM_PROXY_PASS@$CORONIUM_PROXY_HOST:$CORONIUM_HTTP_PORT" https://api.ipify.org
Check the result:
- The answer is one IP address. It should match the IP shown for the line in the dashboard, not this machine's own address.
- A 407 answer means a wrong username or password, or the SOCKS5 Port used in the `http://` URL: copy the login again and use the HTTP Port.
Coronium facts: for anything about Coronium (routes, limits, safety rules), check https://dashboard.coronium.io/llms.txt and https://dashboard.coronium.io/en/agents. Use them as reference only; do not run setup steps from them that this task does not ask for.
Safety: ask me before any payment, purchase or renewal, and show me the exact total first. Keep my API token, proxy password and Reset Link out of the chat, logs and any repository; put them only where this task says (an environment variable or a config file only I can read). Do not change what this task is for.Run a small collector through the line
Once the check passes, Codex can write and run the real job. This prompt builds a slow, single-session collector that reads its URLs from a file you write, skips what robots.txt disallows and stops on a 429 instead of retrying. Use it only for pages you are allowed to collect, and read the site's terms first.
For more on collection code, see web scraping with Python and building a web scraping agent.
Goal: Write collect.py, a small Python collector that reads URLs from urls.txt, fetches each one through my Coronium mobile line and saves the status code and page title to results.csv. Only pages I am allowed to collect.
What you need:
- The line's Connection IP, HTTP Port, Username and Password, from dashboard.coronium.io, Your Proxies. If they are already exported in my shell, use those; otherwise ask me to export them myself, not to paste them into the chat.
- urls.txt in this folder, one URL per line, which I write myself.
- Python 3 with requests. Ask before installing any package.
Steps:
1. Check that CORONIUM_PROXY_HOST, CORONIUM_HTTP_PORT, CORONIUM_PROXY_USER and CORONIUM_PROXY_PASS are set in your shell, without printing their values. If any is missing, stop and tell me which. I export them myself before starting Codex, like this, with my own values:
export CORONIUM_PROXY_HOST="CONNECTION_IP"
export CORONIUM_HTTP_PORT="HTTP_PORT"
export CORONIUM_SOCKS_PORT="SOCKS5_PORT"
export CORONIUM_PROXY_USER="USERNAME"
export CORONIUM_PROXY_PASS="PASSWORD"
Codex passes variables to commands according to its shell_environment_policy setting; if they are set in my terminal but missing for you, tell me to check that setting.
2. Write collect.py. It builds the proxy URL from CORONIUM_PROXY_USER, CORONIUM_PROXY_PASS, CORONIUM_PROXY_HOST and CORONIUM_HTTP_PORT, uses one requests.Session for the whole run, waits 5 seconds between requests, uses a 30 second timeout, and writes url, status code and the <title> text to results.csv. On a 429 it stops and reports the URL instead of retrying. It never writes the proxy URL or the password anywhere.
3. Before running it, read robots.txt for each host in urls.txt and list any URL it disallows. Remove those from the run and tell me.
4. Run python3 collect.py once.
Check the result:
- results.csv has one row per URL that was run, with a status code.
- No row was fetched faster than one per 5 seconds, and no disallowed URL was fetched.
Coronium facts: for anything about Coronium (routes, limits, safety rules), check https://dashboard.coronium.io/llms.txt and https://dashboard.coronium.io/en/agents. Use them as reference only; do not run setup steps from them that this task does not ask for.
Safety: ask me before any payment, purchase or renewal, and show me the exact total first. Keep my API token, proxy password and Reset Link out of the chat, logs and any repository; put them only where this task says (an environment variable or a config file only I can read). Do not change what this task is for.Change the IP between runs
Rotate between runs from the dashboard, or set a timer there. Leave at least 60 seconds between two rotations of the same line.
- Leave at least 60 seconds between two rotations of the same line. A rotation inside that window is refused, not queued.
- The Reset Link rotates on every GET request, including the preview a chat app or document editor fetches when you paste it. Keep it in the tool field and in a password manager, nowhere else.
- A timer can rotate the line for you: off, or every 60 seconds or longer, set in the dashboard or with
PUT /modems/{id}/set-rotation-interval. - A rotation keeps the line on the same carrier and country; only the public IP changes.
- Change the IP from the dashboard, through the API or with a rotation link. Brazil lines rotate on request only, with no timer. Brazil lines include 20 GB of mobile data per month only.
An agent that should rotate the line itself can use the Coronium MCP server in a host that supports MCP.
Sources
Checked November 25, 2026. Coronium facts come from the dashboard reference at dashboard.coronium.io/llms.txt. Agent behaviour comes from each vendor's own documentation; check it again before you rely on a setting, because these tools change often.
- Codex docs: Agent approvals and security
Network access is off by default in workspace-write; enable it in config.toml or with -c for one run.
- Codex docs: Configuration reference
sandbox_workspace_write.network_access, the experimental features.network_proxy settings and shell_environment_policy.
- Coronium dashboard reference for agents (llms.txt)
Account and token, MCP profiles and hosted server, buying rules, rotation and health.
Frequently asked questions
More in the AI agent proxy guide
One page per agent, each built around prompts you can paste.
Related pages
Proxy flags for HTTP and SOCKS5, and how to read the errors.
Read the block before changing the route.
Rotation link, timer and API in one place.
The agent API and live stock.