{"record":{"id":"161eee7fcb4aecab","repo":"openai/codex","slug":"sandboxed-filesystem-operations-require-readonly-o","errorCode":null,"errorMessage":"sandboxed filesystem operations require ReadOnly or WorkspaceWrite sandbox policy","messagePattern":"sandboxed filesystem operations require ReadOnly or WorkspaceWrite sandbox policy","errorType":"validation","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/exec-server/src/sandboxed_file_system.rs","lineNumber":431,"sourceCode":"            source_path,\n            destination_path,\n            options,\n            sandbox,\n        ))\n    }\n}\n\nfn validate_native_path(path: &PathUri) -> FileSystemResult<()> {\n    path.to_abs_path().map(drop)\n}\n\nfn require_platform_sandbox(\n    sandbox: Option<&FileSystemSandboxContext>,\n) -> FileSystemResult<&FileSystemSandboxContext> {\n    sandbox\n        .filter(|sandbox| sandbox.should_run_in_sandbox())\n        .ok_or_else(|| {\n            io::Error::new(\n                io::ErrorKind::InvalidInput,\n                \"sandboxed filesystem operations require ReadOnly or WorkspaceWrite sandbox policy\",\n            )\n        })\n}\n\nfn map_sandbox_error(error: JSONRPCErrorError) -> io::Error {\n    match error.code {\n        -32004 => io::Error::new(io::ErrorKind::NotFound, error.message),\n        -32600 => io::Error::new(io::ErrorKind::InvalidInput, error.message),\n        _ => io::Error::other(error.message),\n    }\n}\n\n#[cfg(all(test, any(unix, windows)))]\n#[path = \"sandboxed_file_system_path_uri_tests.rs\"]\nmod path_uri_tests;\n","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/exec-server/src/sandboxed_file_system.rs#L413-L449","documentation":"Error \"sandboxed filesystem operations require ReadOnly or WorkspaceWrite sandbox policy\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/exec-server/src/sandboxed_file_system.rs:431 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}