openai/codex · error · SetupFailure

HelperFirewallRuleVerifyFailed

HelperFirewallRuleVerifyFailed

Error message

LocalUserAuthorizedList (read-back) failed: {err:?}

What it means

After setting a firewall rule's LocalUserAuthorizedList, the code reads the value back to verify the OS accepted the per-user restriction and the read-back COM getter returned an error. This means Windows refused or mangled the local-user ACL string (SDDL O:LSD:(A;;CC;;;SID) format) on the rule, so the rule cannot be trusted to limit traffic to the offline sandbox user.

Solutions

  1. Check the HRESULT in the message to see whether the rule object rejected the SDDL user list or the getter failed for another reason
  2. Confirm the offline user SID in the local_user_spec is a valid, resolvable SID string
  3. Verify the Windows version supports per-user firewall rules (LocalUserAuthorizedList requires Windows 8+/Vista+ firewall stack)
  4. Delete the stale codex firewall rules and re-run setup so the rule is recreated cleanly
Defensive patterns

Strategy: try-catch

When it happens

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

Appendix: source

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

        rule.SetProfiles(NET_FW_PROFILE2_ALL.0).map_err(|err| {
            anyhow::Error::new(SetupFailure::new(
                SetupErrorCode::HelperFirewallRuleCreateOrAddFailed,
                format!("SetProfiles failed: {err:?}"),
            ))
        })?;
        configure_rule_network_scope(rule, spec)?;
        rule.SetLocalUserAuthorizedList(&BSTR::from(spec.local_user_spec))
            .map_err(|err| {
                anyhow::Error::new(SetupFailure::new(
                    SetupErrorCode::HelperFirewallRuleCreateOrAddFailed,
                    format!("SetLocalUserAuthorizedList failed: {err:?}"),
                ))
            })?;
    }

    // Read-back verification: ensure we actually wrote the expected SID scope.
    let actual = unsafe { rule.LocalUserAuthorizedList() }.map_err(|err| {
        anyhow::Error::new(SetupFailure::new(
            SetupErrorCode::HelperFirewallRuleVerifyFailed,
            format!("LocalUserAuthorizedList (read-back) failed: {err:?}"),
        ))
    })?;
    let actual_str = actual.to_string();
    if !actual_str.contains(spec.offline_sid) {
        return Err(anyhow::Error::new(SetupFailure::new(
            SetupErrorCode::HelperFirewallRuleVerifyFailed,
            format!(
                "offline firewall rule user scope mismatch: expected SID {}, got {actual_str}",
                spec.offline_sid
            ),
        )));
    }
    Ok(())
}

fn configure_rule_network_scope(rule: &INetFwRule3, spec: &BlockRuleSpec<'_>) -> Result<()> {

View on GitHub (pinned to 339751715c)