Codex unable to access my localhost rest endpoint
Resolved 💬 2 comments Opened Feb 4, 2026 by jianfengzhang-maersk Closed Feb 4, 2026
I'd like to develop an agent skill which needs to call some rest api in some my localhost. But when I run this skill in codex, codex is unable to access my localhost rest endpoint due that it is in its own sandbox. Here's code'x reply:
Short answer: I can’t “sense” or directly access services on your machine. My execution environment is an isolated sandbox that can only access the shared workspace files and its own network. To let me access your MLflow, there are two options:
You run the commands locally and paste the output (safest and fastest).
Expose MLflow on an address I can reach (has security risk, you must confirm).
If you want to try option 2, I suggest these steps (you run them locally):
Bind MLflow to an accessible address: mlflow server --host 0.0.0.0 --port 5001
Expose the port via a temporary tunnel (e.g., ngrok http 5001 or SSH reverse proxy) and share the generated URL
If you suspect container networking issues, try whether [host.docker.internal (line 5001)](https://file+.vscode-resource.vscode-cdn.net/Users/jianfeng.zhang/.vscode/extensions/openai.chatgpt-0.4.69-darwin-arm64/webview/#) is reachable
Note: even if you provide a reachable URL, this environment’s network may still be restricted. If it can’t connect, I’ll fall back to you running the command locally and pasting the results. Which approach do you want to use?
Is there any way to allow codex to access rest endpoint of my localhost? BTW, this skill works in claude code.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗