{"record":{"id":"f18d1611f45bac56","repo":"openai/codex","slug":"unsupported-permission-path-0","errorCode":null,"errorMessage":"unsupported permission path: {0}","messagePattern":"unsupported permission path: (.+?)","errorType":"exception","errorClass":"PermissionIntersectionError","httpStatus":null,"severity":"error","filePath":"codex-rs/protocol/src/permission_profile_intersection.rs","lineNumber":27,"sourceCode":"use crate::permissions::FileSystemPath;\nuse crate::permissions::FileSystemSandboxEntry;\nuse crate::permissions::FileSystemSandboxKind;\nuse crate::permissions::FileSystemSandboxPolicy;\nuse crate::permissions::FileSystemSpecialPath;\nuse crate::permissions::NetworkSandboxPolicy;\nuse crate::permissions::PROTECTED_METADATA_PATH_NAMES;\nuse crate::permissions::ReadDenyMatcher;\nuse crate::permissions::default_read_only_subpaths_for_writable_root;\nuse crate::permissions::project_roots_glob_pattern;\n\n/// A policy cannot be intersected without weakening either input.\n#[derive(Clone, Debug, Eq, Error, PartialEq)]\npub enum PermissionIntersectionError {\n    #[error(\"externally enforced filesystem permissions cannot be intersected safely\")]\n    ExternalSandbox,\n    #[error(\"platform-default filesystem permissions cannot be intersected safely\")]\n    PlatformDefaults,\n    #[error(\"unsupported permission path: {0}\")]\n    UnsupportedPath(String),\n}\n\n/// Intersects already-effective filesystem permissions and network access.\n///\n/// Both profiles must already be materialized for the same local executor and\n/// cwd. Concrete grant paths are canonicalized before comparison and in the\n/// result, so symlinks cannot acquire authority beyond either input.\n/// Unsupported policy shapes fail closed.\npub fn intersect_effective_permission_profiles(\n    authority: &PermissionProfile,\n    requested: &PermissionProfile,\n    cwd: &Path,\n) -> Result<PermissionProfile, PermissionIntersectionError> {\n    if matches!(authority, PermissionProfile::External { .. })\n        || matches!(requested, PermissionProfile::External { .. })\n    {\n        return Err(PermissionIntersectionError::ExternalSandbox);","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/protocol/src/permission_profile_intersection.rs#L9-L45","documentation":"PermissionIntersectionError::UnsupportedPath(String) (codex-rs/protocol/src/permission_profile_intersection.rs:27-28) is the fail-closed catch-all of intersect_effective_permission_profiles for shapes it cannot merge safely; the payload names the offending path or shape. Grounded raise sites: a non-absolute cwd (line 47); unmaterialized workspace permissions - ProjectRoots (57-63) or a project-roots glob (64-68); tmpdir restrictions lacking executor-local bindings (136-140); non-metadata optional permissions (189-192); symlinked read restrictions (308-313); non-Deny or skip-missing glob permissions (316-322); paths that fail to_abs_path/canonicalize because they are missing on disk (283-297); other unsupported Special values (342-346).","triggerScenarios":"Intersecting profiles that contain any of: a relative cwd, an unmaterialized workspace/ProjectRoots entry or project-roots glob, a skip-missing entry that is not read-only metadata, a read restriction placed through a symlink, a non-deny glob grant, or a concrete path that does not exist so canonicalize fails.","commonSituations":"Forgetting to materialize workspace permissions before merging; config-driven glob grants; optional permissions for not-yet-created directories; symlinked project layouts; accidentally passing a relative cwd.","solutions":["Read the payload - it names the exact shape ('workspace permissions must already be materialized', 'symlinked restriction: ...', 'glob permissions: ...', or a path that failed canonicalization).","Pass an absolute cwd and make sure concrete entry paths exist on disk.","Materialize ProjectRoots/workspace permissions and expand project-roots globs into concrete entries before intersecting.","Remove or convert unsupported shapes: non-deny globs, optional non-metadata entries, symlinked restrictions, and tmpdir restrictions without executor-local bindings."],"exampleFix":"// before:\nlet merged = intersect_effective_permission_profiles(&a, &b, Path::new(\"repo\"))?;\n// relative cwd -> UnsupportedPath error\n\n// after:\nlet cwd = std::env::current_dir()?; // absolute\nlet merged = intersect_effective_permission_profiles(&a, &b, &cwd)?;","handlingStrategy":"validation","validationCode":"let cwd = std::env::current_dir()?; // must be absolute, not relative\nfor p in [authority, requested] {\n    for entry in &p.file_system_sandbox_policy().entries {\n        if let FileSystemPath::Path { path } = &entry.path {\n            std::fs::canonicalize(path.to_abs_path()?)?; // must exist on disk\n        }\n    }\n}","typeGuard":"fn is_unsupported_path(err: &PermissionIntersectionError) -> bool {\n    matches!(err, PermissionIntersectionError::UnsupportedPath(_))\n}","tryCatchPattern":"Err(PermissionIntersectionError::UnsupportedPath(what)) => {\n    // `what` names the path or shape; fix the profile or cwd and retry\n}","preventionTips":["Always pass an absolute cwd.","Materialize workspace permissions and expand globs before merging.","Keep intersectable profiles free of symlinks, optional non-metadata entries, and missing paths."],"tags":["rust","codex","sandbox","permissions","path","canonicalization"],"backgroundTag":"invalid-permission-path","analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}