[Bug] Network whitelist is missing 'static.rust-lang.org', causing Rustup failures in sandboxed environments
(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-wasmon 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.orgto 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.
5 Comments
I have confirmed this via a diagnostic script that attempts
curlconnections through the environment's proxy.Before Whitelisting
static.rust-lang.org:curltogithub.com-> SUCCESScurltocrates.io-> SUCCESS (at the proxy level)curltostatic.rust-lang.org-> FAILURE (Proxy returnsHTTP 403 ForbiddenonCONNECT)After Manually Whitelisting
static.rust-lang.org:curltostatic.rust-lang.org-> SUCCESS (Proxy returnsHTTP 200 OKonCONNECT)This definitively proves that the
envoyproxy is configured with a domain-based allow-list and thatstatic.rust-lang.orgis not on the default list.Impact
This misconfiguration prevents standard Rust development workflows:
rustup updatefails.rustup component addfails.Let us close this now. If this issue still exists, please let us know.
@seratch, the problem still persists.
Admittedly I didn't write clear steps to reproduce the defect when I filled that issue.
Here they are:
Just run rustup update and report back.Observed output in the agent logs:
static.rust-lang.orgto the network domain whitelist for the agent execution environment, and try again.@seratch , thanks for reopening.
Meanwhile, I realized that my instructions for reproducing are inaccurate.
Here are the correct ones:
as setup script.
static.rust-lang.orgto the network domain whitelist for the agent execution environment, and try again.Cheers
Okay, I misinterpreted what I saw.
rustup update 1.89works just fine.Closing.
Sorry for the noise.