openai/codex · error
Logon SID not present on token
Error message
Logon SID not present on token
What it means
Neither the process token's groups nor its linked (elevated) token's groups contain a Logon SID after scanning both, so the sandbox cannot derive the logon session identity needed for restricted-token ACLs.
Solutions
- Investigate why the token lacks a logon SID (unusual session/service token configurations)
- Run from a normal interactive logon session rather than a synthetic token context
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at codex-rs/windows-sandbox-rs/src/token.rs:276 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/e2b0de931096f292.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/windows-sandbox-rs/src/token.rs:276
TOKEN_LINKED_TOKEN_CLASS,
ln_buf.as_mut_ptr() as *mut c_void,
ln_needed,
&mut ln_needed,
);
if ok != 0 {
let lt: TOKEN_LINKED_TOKEN =
std::ptr::read_unaligned(ln_buf.as_ptr() as *const TOKEN_LINKED_TOKEN);
if lt.linked_token != 0 {
let res = scan_token_groups_for_logon(lt.linked_token);
CloseHandle(lt.linked_token);
if let Some(v) = res {
return Ok(v);
}
}
}
}
Err(anyhow!("Logon SID not present on token"))
}
unsafe fn get_user_sid_bytes(h_token: HANDLE) -> Result<Vec<u8>> {
let mut needed: u32 = 0;
GetTokenInformation(h_token, TokenUser, std::ptr::null_mut(), 0, &mut needed);
if needed == 0 {
return Err(anyhow!("TokenUser size query returned 0"));
}
let mut user_buf: Vec<u8> = vec![0u8; needed as usize];
let ok = GetTokenInformation(
h_token,
TokenUser,
user_buf.as_mut_ptr() as *mut c_void,
needed,
&mut needed,
);
if ok == 0 || (needed as usize) < std::mem::size_of::<TOKEN_USER>() {
return Err(anyhow!(View on GitHub (pinned to 339751715c)