Skip to main content

NETWORK_ENV

Constant NETWORK_ENV 

Source
pub const NETWORK_ENV: &[&str];
Expand description

Environment variables that route an agent’s traffic through a corporate proxy or a custom certificate authority.

None of the three vendors documents proxy support, and none exposes a proxy flag, so this is a convenience list of names a host may want to forward, not a claim that forwarding them works. (The names do appear in all three shipped binaries, but that shows they are referenced, not that provider traffic honours them.) Verify against your own proxy before relying on it.

Not included in EnvPolicy::Minimal: they are situational, and the proxy URLs frequently carry credentials. Offered here so a host can present them as an explicit setting and forward the ones it wants with crate::Request::env, rather than every caller rediscovering the names.

Excluding them from Minimal does not block them. Under the default EnvPolicy::Inherit they flow exactly as they would for the CLI run from a shell; the only thing Minimal changes is that forwarding becomes a decision rather than an accident.

let mut request = Request::new(Agent::Claude, "hi").env_policy(EnvPolicy::Minimal);
// Forward only the proxy settings this host actually has.
for name in NETWORK_ENV {
    if let Ok(value) = std::env::var(name) {
        request = request.env(*name, value);
    }
}