openai/codex · error · anyhow::Error
network.credential_broker requires network.mitm = true
Error message
network.credential_broker requires network.mitm = true
What it means
The network proxy config enables the credential broker without enabling the MITM proxy it depends on. This guard in build_config_state fires when config.credential_broker is true while network.mitm is false — credential brokering works by virtualizing credentials through the MITM proxy, so enabling one without the other is an invalid combination that must be rejected at config-build time rather than silently misbehaving.
Solutions
- Set network.mitm = true in config.toml when enabling network.credential_broker
- Disable network.credential_broker if credential virtualization is not wanted
- Validate proxy configuration before applying it to catch the mismatch earlier
When it happens
Trigger: Thrown at codex-rs/network-proxy/src/state.rs:78 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/369fe3dd17e18234.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/network-proxy/src/state.rs:78
pub fn build_config_state(
mut config: NetworkProxyConfig,
constraints: NetworkProxyConstraints,
) -> anyhow::Result<ConfigState> {
if constraints.enabled == Some(false) {
config.credential_broker = false;
}
let brokerage_created_proxy = config.credential_broker && !config.enabled;
let brokerage_created_default_allowlist = brokerage_created_proxy
&& config.allowed_domains().is_none()
&& constraints.allowed_domains.is_none();
if brokerage_created_proxy {
config.enabled = true;
}
if brokerage_created_default_allowlist {
config.set_allowed_domains(vec!["*".to_string()]);
}
crate::config::validate_unix_socket_allowlist_paths(&config)?;
anyhow::ensure!(
!config.credential_broker || config.mitm,
"network.credential_broker requires network.mitm = true"
);
let allowed_domains = config.allowed_domains().unwrap_or_default();
let denied_domains = config.denied_domains().unwrap_or_default();
validate_non_global_wildcard_domain_patterns("network.denied_domains", &denied_domains)
.map_err(NetworkProxyConstraintError::into_anyhow)?;
let deny_set = compile_denylist_globset(&denied_domains)?;
let allow_set = compile_allowlist_globset(&allowed_domains)?;
let mitm_hooks = compile_mitm_hooks(&config)?;
let mitm = if config.mitm {
Some(Arc::new(MitmState::new(MitmUpstreamConfig {
allow_upstream_proxy: config.allow_upstream_proxy,
})?))
} else {
None
};
Ok(ConfigState {View on GitHub (pinned to 339751715c)