{"record":{"id":"bc4b8ac158d209dd","repo":"openai/codex","slug":"network-policy-amendment-host-does-not-match","errorCode":null,"errorMessage":"network policy amendment host '{}' does not match approved host '{}'","messagePattern":"network policy amendment host '(.+?)' does not match approved host '(.+?)'","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/core/src/session/mod.rs","lineNumber":2340,"sourceCode":"                anyhow::anyhow!(\"failed to persist network policy amendment to execpolicy: {err}\")\n            })?;\n\n        // Without a running proxy, persistence is the first effective policy change.\n        if let Some(on_policy_applied) = on_policy_applied {\n            on_policy_applied();\n        }\n\n        Ok(())\n    }\n\n    fn validated_network_policy_amendment_host(\n        amendment: &NetworkPolicyAmendment,\n        network_approval_context: &NetworkApprovalContext,\n    ) -> anyhow::Result<String> {\n        let approved_host = normalize_host(&network_approval_context.host);\n        let amendment_host = normalize_host(&amendment.host);\n        if amendment_host != approved_host {\n            return Err(anyhow::anyhow!(\n                \"network policy amendment host '{}' does not match approved host '{}'\",\n                amendment.host,\n                network_approval_context.host\n            ));\n        }\n        Ok(approved_host)\n    }\n\n    pub(crate) async fn record_network_policy_amendment_message(\n        &self,\n        sub_id: &str,\n        amendment: &NetworkPolicyAmendment,\n    ) {\n        let message: ResponseItem = ContextualUserFragment::into(NetworkRuleSaved::new(amendment));\n        let turn_context = self.turn_context_for_sub_id(sub_id).await;\n        self.inject_no_new_turn(vec![message], turn_context.as_deref())\n            .await;\n    }","sourceCodeStart":2322,"sourceCodeEnd":2358,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/core/src/session/mod.rs#L2322-L2358","documentation":"Error \"network policy amendment host '{}' does not match approved host '{}'\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/core/src/session/mod.rs:2340 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Request approval for the correct host, or fix the amendment to use the approved host."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}