{"record":{"id":"5dacd00aa89852cf","repo":"openai/codex","slug":"failed-to-persist-network-policy-amendment-to-exec","errorCode":null,"errorMessage":"failed to persist network policy amendment to execpolicy: {err}","messagePattern":"failed to persist network policy amendment to execpolicy: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/core/src/session/mod.rs","lineNumber":2322,"sourceCode":"            // Active enforcement changed successfully. Notify the owner before\n            // the next fallible await so cancellation cannot contradict it.\n            if let Some(on_policy_applied) = on_policy_applied.take() {\n                on_policy_applied();\n            }\n        }\n\n        self.services\n            .exec_policy\n            .append_network_rule_and_update(\n                &codex_home,\n                &host,\n                execpolicy_amendment.protocol,\n                execpolicy_amendment.decision,\n                Some(execpolicy_amendment.justification),\n            )\n            .await\n            .map_err(|err| {\n                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!(","sourceCodeStart":2304,"sourceCodeEnd":2340,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/core/src/session/mod.rs#L2304-L2340","documentation":"Error \"failed to persist network policy amendment to execpolicy: {err}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/core/src/session/mod.rs:2322 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the execpolicy file is writable and retry the policy amendment."],"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"}