[Bug] Network whitelist is missing 'static.rust-lang.org', causing Rustup failures in sandboxed environments

Resolved 💬 5 comments Opened Jun 27, 2025 by ngirard Closed Aug 12, 2025
💡 Likely answer: A maintainer (seratch, member) responded on this thread — see the highlighted reply below.

(Using https://chatgpt.com/codex)

1. Summary

The current network domain whitelist for the sandboxed agent environment is incomplete for robust Rust project development. It is missing the domain static.rust-lang.org, which is the primary CDN for Rust toolchain artifacts. This causes any rustup command that needs to download toolchains or components (e.g., rustup update, rustup component add) to fail due to network restrictions.

This directly impacts the reliability of bootstrapping scripts and prevents agents from performing standard Rust environment setup tasks, leading to process failures and incorrect error diagnoses by the agent.

2. The problem in detail

During a recent task execution, an agent's bootstrap script failed. The script was designed to be robust and halt on any error (set -e).

The failure occurred at the rustup update step with the following error:

error: failed to download file error=Reqwest(reqwest::Error { kind: Request, url: "https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256", ... })

This error indicates a network block when trying to connect to static.rust-lang.org.

An analysis of the current network whitelist revealed that while rustup.rs (the installer domain) is present, static.rust-lang.org (the artifact domain) is missing.

3. Motivation & impact

This is not a minor issue; it has several negative consequences:

  • Brittle bootstrapping: Standard, well-written bootstrap scripts that ensure a consistent Rust environment will fail, forcing developers to create less-safe workarounds (e.g., ignoring the exit code of rustup update).
  • Agent misdiagnosis: As observed, the agent correctly identified the network error but then incorrectly diagnosed the consequence of that error. It assumed the entire bootstrap process was flawed and proceeded with a risky, incomplete setup. A correctly configured environment would have allowed the bootstrap to succeed, preventing this entire class of agent reasoning failure.
  • Inability to manage toolchains: Agents are unable to install specific Rust toolchains or add components like rust-wasm on the fly, limiting their ability to work on a wider variety of Rust projects.

By fixing the whitelist, we make the environment more robust, which in turn simplifies agent tasks and improves the reliability of their execution and diagnosis.

4. Proposed solution

The solution is simple and has no known negative side effects.

  • Action: Add the domain static.rust-lang.org to the network domain whitelist for the agent execution environment.

This will align the environment's capabilities with the standard operational model of the official Rust toolchain manager, rustup.

View original on GitHub ↗

5 Comments

ngirard · 1 year ago

I have confirmed this via a diagnostic script that attempts curl connections through the environment's proxy.

Before Whitelisting static.rust-lang.org:

  • curl to github.com -> SUCCESS
  • curl to crates.io -> SUCCESS (at the proxy level)
  • curl to static.rust-lang.org -> FAILURE (Proxy returns HTTP 403 Forbidden on CONNECT)

After Manually Whitelisting static.rust-lang.org:

  • curl to static.rust-lang.org -> SUCCESS (Proxy returns HTTP 200 OK on CONNECT)

This definitively proves that the envoy proxy is configured with a domain-based allow-list and that static.rust-lang.org is not on the default list.

Impact
This misconfiguration prevents standard Rust development workflows:

  • rustup update fails.
  • rustup component add fails.
  • Agents cannot reliably bootstrap a Rust environment, leading to process failures.
seratch member · 1 year ago

Let us close this now. If this issue still exists, please let us know.

ngirard · 1 year ago

@seratch, the problem still persists.

Admittedly I didn't write clear steps to reproduce the defect when I filled that issue.

Here they are:

  1. Create and empty GitHub repo and a related Codex environment.
  2. Mandate a Codex agent with Just run rustup update and report back.

Observed output in the agent logs:

cd /workspace/empty-rust-project
rustup update
root@6e69f5585716:/workspace# cd /workspace/empty-rust-project
root@6e69f5585716:/workspace/empty-rust-project# rustup update
info: no updatable toolchains installed
info: checking for self-update
error: failed to download file error=Reqwest(reqwest::Error { kind: Request, url: "https://static.rust-lang.org/rustup/release-s
table.toml", source: hyper_util::client::legacy::Error(Connect, "unsuccessful tunnel") })
error: could not download file from 'https://static.rust-lang.org/rustup/release-stable.toml' to '/tmp/rustup-updatecuDcIi/relea
se-stable.toml': error downloading file: error sending request for url (https://static.rust-lang.org/rustup/release-stable.toml)
: client error (Connect): unsuccessful tunnel
  1. Add the domain static.rust-lang.org to the network domain whitelist for the agent execution environment, and try again.
ngirard · 1 year ago

@seratch , thanks for reopening.

Meanwhile, I realized that my instructions for reproducing are inaccurate.

Here are the correct ones:

  1. Create and empty GitHub repo
  2. Create a related environment with
export RUSTUP_TOOLCHAIN=1.91
rustup update ${RUSTUP_TOOLCHAIN}

as setup script.

  1. Observe output in environment setup logs:
Running setup scripts...
+ set +x
+ export RUSTUP_TOOLCHAIN=1.91
+ RUSTUP_TOOLCHAIN=1.91
+ rustup update 1.91
info: syncing channel updates for '1.91-x86_64-unknown-linux-gnu'
info: downloading component 'rust'
error: could not download nonexistent rust version `1.91-x86_64-unknown-linux-gnu`: could not download file from 'https://static.rust-lang.org/dist/rust-1.91-x86_64-unknown-linux-gnu.tar.gz.sha256' to '/root/.rustup/tmp/jalhnrx5bo7bt6t0_file': http request returned an unsuccessful status code: 404
  1. Add the domain static.rust-lang.org to the network domain whitelist for the agent execution environment, and try again.

Cheers

ngirard · 1 year ago

Okay, I misinterpreted what I saw. rustup update 1.89 works just fine.
Closing.
Sorry for the noise.