{"record":{"id":"6596344c372e259f","repo":"openai/codex","slug":"failed-to-read-rules-files-from-dir-source","errorCode":null,"errorMessage":"failed to read rules files from {dir}: {source}","messagePattern":"failed to read rules files from (.+?): (.+?)","errorType":"exception","errorClass":"ExecPolicyError","httpStatus":null,"severity":"error","filePath":"codex-rs/core/src/exec_policy.rs","lineNumber":240,"sourceCode":"        AskForApproval::Granular(granular_config) => {\n            if prompt_is_rule {\n                if !granular_config.allows_rules_approval() {\n                    Some(REJECT_RULES_APPROVAL_REASON)\n                } else {\n                    None\n                }\n            } else if !granular_config.allows_sandbox_approval() {\n                Some(REJECT_SANDBOX_APPROVAL_REASON)\n            } else {\n                None\n            }\n        }\n    }\n}\n\n#[derive(Debug, Error)]\npub enum ExecPolicyError {\n    #[error(\"failed to read rules files from {dir}: {source}\")]\n    ReadDir {\n        dir: PathBuf,\n        source: std::io::Error,\n    },\n\n    #[error(\"failed to read rules file {path}: {source}\")]\n    ReadFile {\n        path: PathBuf,\n        source: std::io::Error,\n    },\n\n    #[error(\"failed to parse rules file {path}: {source}\")]\n    ParsePolicy {\n        path: String,\n        source: codex_execpolicy::Error,\n    },\n}\n","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/core/src/exec_policy.rs#L222-L258","documentation":"ExecPolicyError::ReadDir — loading exec policy rules failed because the rules directory could not be listed (permission, missing dir, or IO failure). The directory path and the source IO error are carried in the error for diagnosis.","triggerScenarios":"Thrown at codex-rs/core/src/exec_policy.rs:240 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the rules directory {dir} exists and is readable."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}