openai/codex · error · anyhow::Error

environment network policy requires an enabled executor…

Error message

environment network policy requires an enabled executor proxy

What it means

Guard when starting the network proxy: an execution-scope environment network policy was supplied, but the resulting proxy configuration is not an enabled executor proxy (enabled ended up false). The environment policy can only be enforced by a running proxy, so launching is refused instead of running unenforced.

Solutions

  1. Enable the network proxy (network.enabled = true) so the environment policy can be applied
  2. Remove the execution_scope environment_policy if no proxy is desired
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/network-proxy/src/proxy.rs:897 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/276e704002e1df28. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/network-proxy/src/proxy.rs:897

        broker_only_config.set_allowed_domains(vec!["*".to_string()]);
        let broker_only = brokerage_created_default_allowlist && config == broker_only_config;

        let environment_policy = self
            .execution_scope
            .as_ref()
            .and_then(|scope| scope.environment_policy.as_ref());
        if let Some(policy) = environment_policy {
            policy.apply_to(&mut config);
        }
        if config.credential_broker {
            config.enabled &= !broker_only;
            config.credential_broker = false;
            config.dangerously_allow_plaintext_credential_injection = false;
            if config.mitm && config.mitm_hooks.is_empty() {
                config.mitm = false;
            }
        }
        anyhow::ensure!(
            environment_policy.is_none() || config.enabled,
            "environment network policy requires an enabled executor proxy"
        );
        let proxy = crate::RemoteNetworkProxyConfig::from_effective_config(&config)?;
        let (environment_id, execution_id) = self
            .execution_scope
            .as_ref()
            .map(|scope| {
                (
                    Some(scope.environment_id.clone()),
                    Some(scope.execution_id.clone()),
                )
            })
            .unwrap_or_default();
        Ok(crate::RemoteNetworkProxyLaunchConfig {
            proxy,
            audit_metadata: self.state.audit_metadata().clone(),
            environment_id,

View on GitHub (pinned to 339751715c)