openai/codex · error · anyhow::Error

failed to update runtime allowlist

Error message

failed to update runtime allowlist: {err}

What it means

Applying a network policy amendment to the running managed proxy's runtime allowlist failed (the proxy apply call returned an error wrapped here). The amendment may not be in effect even though it was validated and possibly persisted, so network grants could silently not apply.

Solutions

  1. Check the network proxy state and retry the allowlist update per the reported error.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at codex-rs/core/src/session/mod.rs:2298 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/6069898c42ae3186. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/core/src/session/mod.rs:2298

            Self::validated_network_policy_amendment_host(amendment, network_approval_context)?;
        let codex_home = self
            .state
            .lock()
            .await
            .session_configuration
            .codex_home()
            .clone();
        let execpolicy_amendment =
            execpolicy_network_rule_amendment(amendment, network_approval_context, &host);
        let mut on_policy_applied = Some(on_policy_applied);

        if let Some(started_network_proxy) = self.services.network_proxy.load_full() {
            let proxy = started_network_proxy.proxy();
            match amendment.action {
                NetworkPolicyRuleAction::Allow => proxy
                    .add_allowed_domain(&host)
                    .await
                    .map_err(|err| anyhow::anyhow!("failed to update runtime allowlist: {err}"))?,
                NetworkPolicyRuleAction::Deny => proxy
                    .add_denied_domain(&host)
                    .await
                    .map_err(|err| anyhow::anyhow!("failed to update runtime denylist: {err}"))?,
            }
            // Active enforcement changed successfully. Notify the owner before
            // the next fallible await so cancellation cannot contradict it.
            if let Some(on_policy_applied) = on_policy_applied.take() {
                on_policy_applied();
            }
        }

        self.services
            .exec_policy
            .append_network_rule_and_update(
                &codex_home,
                &host,
                execpolicy_amendment.protocol,

View on GitHub (pinned to 339751715c)