openai/codex · error · SetupFailure

HelperFirewallPolicyIneffective

HelperFirewallPolicyIneffective

Error message

local firewall policy modifications do not apply to every current profile: LocalPolicyModifyState result={result:?}

What it means

Sentinel error stating that firewall rules just written would not take effect on every currently active profile. After adding rules, INetFwPolicy2::LocalPolicyModifyState returned S_FALSE, meaning the modification only applies to a subset of active firewall profiles (domain/private/public), so the proxy allowlist could be missing on some profiles and sandboxed networking would break.

Solutions

  1. Check which firewall profiles (domain, private, public) are active and ensure they are not in a partially-disabled or transitional state, then re-run setup
  2. Enable all firewall profiles or ensure a consistent profile configuration on the machine
  3. If the machine intentionally runs with a disabled profile configuration not supported by the sandbox, adjust the profile configuration before running sandbox setup
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/windows-sandbox-rs/src/bin/setup_main/win/firewall.rs:251 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/07134b1c2f8a98e0. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/windows-sandbox-rs/src/bin/setup_main/win/firewall.rs:251

    };
    validate_local_policy_modify_result(result, modify_state)
}

fn validate_local_policy_modify_result(
    result: windows::core::HRESULT,
    modify_state: NET_FW_MODIFY_STATE,
) -> Result<()> {
    if result.is_err() {
        // The COM query itself failed, so Windows never gave us a policy answer.
        return Err(anyhow::Error::new(SetupFailure::new(
            SetupErrorCode::HelperFirewallPolicyAccessFailed,
            format!("INetFwPolicy2::LocalPolicyModifyState failed: {result:?}"),
        )));
    }

    if result != S_OK {
        // S_FALSE means the answer only holds for some active profiles, not all of them.
        return Err(anyhow::Error::new(SetupFailure::new(
            SetupErrorCode::HelperFirewallPolicyIneffective,
            format!(
                "local firewall policy modifications do not apply to every current profile: LocalPolicyModifyState result={result:?}"
            ),
        )));
    }

    if modify_state == NET_FW_MODIFY_STATE_OK {
        return Ok(());
    }

    // Windows answered uniformly, and that answer says local rule edits are ineffective.
    Err(anyhow::Error::new(SetupFailure::new(
        SetupErrorCode::HelperFirewallPolicyIneffective,
        format!(
            "local firewall policy modifications will not take effect: LocalPolicyModifyState={modify_state:?}"
        ),
    )))

View on GitHub (pinned to 339751715c)