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

environment network policy requires managed network…

Error message

environment network policy requires managed network enforcement

What it means

NetworkProxySpec::for_environment requires that environment-level network policy be enforced through the managed proxy, but the requested setup lacks managed network enforcement. This guard prevents an environment from running with a network policy that cannot actually be enforced.

Solutions

  1. Enable managed network enforcement for the environment before applying this network policy.
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

            self.base_config.clone(),
            self.requirements.clone(),
            permission_profile,
        )
    }

    /// 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,

View on GitHub (pinned to 339751715c)