openai/codex · error · std::io::Error

environment network policy cannot override a disabled…

Error message

environment network policy cannot override a disabled controller proxy

What it means

In for_environment, an environment supplied a network policy while the permission profile is Disabled (network fully off). An environment policy cannot re-enable networking that the profile has disabled, so this is rejected with InvalidInput.

Solutions

  1. Enable the controller proxy, or remove the environment network policy that tries to override it.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/core/src/config/network_proxy_spec.rs:195 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/888184b7d10fbc2b. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/core/src/config/network_proxy_spec.rs:195

    /// Returns the effective traffic policy without exposing controller-owned proxy settings.
    pub fn environment_policy(&self) -> EnvironmentNetworkPolicy {
        EnvironmentNetworkPolicy::from_config(&self.config, self.hard_deny_allowlist_misses)
    }

    pub(crate) fn for_environment(
        controller: Option<&Self>,
        policy: &EnvironmentNetworkPolicy,
        permission_profile: &PermissionProfile,
        exec_policy: &Policy,
    ) -> std::io::Result<Self> {
        if matches!(permission_profile, PermissionProfile::Disabled) {
            return Err(std::io::Error::new(
                std::io::ErrorKind::InvalidInput,
                "environment network policy requires managed network enforcement",
            ));
        }
        if controller.is_some_and(|controller| !controller.enabled()) {
            return Err(std::io::Error::new(
                std::io::ErrorKind::InvalidInput,
                "environment network policy cannot override a disabled controller proxy",
            ));
        }
        let mut spec = match controller {
            Some(controller) => controller.recompute_for_permission_profile(permission_profile)?,
            None => Self::from_config_and_constraints(
                NetworkProxyConfig {
                    enabled: true,
                    // Without a controller, the owner supplies the entire permission ceiling.
                    dangerously_allow_all_unix_sockets: true,
                    allow_local_binding: true,
                    ..NetworkProxyConfig::default()
                },
                /*requirements*/ None,
                permission_profile,
            )?,
        };

View on GitHub (pinned to 339751715c)