{"record":{"id":"2b4043b02de1ca62","repo":"zed-industries/zed","slug":"cannot-capture-writable-sandbox-path","errorCode":null,"errorMessage":"cannot capture writable sandbox path `{}`","messagePattern":"cannot capture writable sandbox path `(.+?)`","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/acp_thread/src/terminal.rs","lineNumber":279,"sourceCode":"    /// synthesized `settings.json/.git` routes through a file — without closing\n    /// the hole. So we drop and move on.\n    fn to_policy(&self) -> Result<sandbox::SandboxPolicy> {\n        let protected_paths = self\n            .protected_paths\n            .iter()\n            .filter_map(|path| sandbox::HostFilesystemLocation::capture(path).ok())\n            .collect::<Vec<_>>();\n        let fs = if self.allow_fs_write {\n            sandbox::SandboxFsPolicy::Unrestricted { protected_paths }\n        } else {\n            // Project worktree paths are captured fresh; user-approved grants are\n            // rebuilt via the verifying reopen (or captured when legacy bare\n            // strings) through `granted_write_path_to_location`. A path that\n            // can't be captured fails the whole construction (never created).\n            let mut locations = Vec::new();\n            for path in &self.writable_paths {\n                let location = sandbox::HostFilesystemLocation::capture(path).map_err(|error| {\n                    anyhow::anyhow!(error).context(format!(\n                        \"cannot capture writable sandbox path `{}`\",\n                        path.display()\n                    ))\n                })?;\n                locations.push(location);\n            }\n            for granted in &self.extra_write_paths {\n                let location = granted_write_path_to_location(granted).map_err(|error| {\n                    anyhow::anyhow!(error).context(format!(\n                        \"cannot re-verify approved sandbox write grant `{}` (if the \\\n                         directory was removed, remove the grant or recreate the \\\n                         directory)\",\n                        granted.requested.display()\n                    ))\n                })?;\n                locations.push(location);\n            }\n            // Dedupe to a minimal cover on the captured canonical paths, so a","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/acp_thread/src/terminal.rs#L261-L297","documentation":"to_policy failed because a writable sandbox path could not be captured as a HostFilesystemLocation (typically it no longer exists or is invalid), so the sandbox policy cannot be constructed for the terminal command.","triggerScenarios":"Thrown at crates/acp_thread/src/terminal.rs:279 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["A protected path could not be captured as a sandbox HostFilesystemLocation (e.g. it doesn't exist or isn't representable); correct or remove the protected path entry","Verify the path exists and is absolute; protected paths that can't be captured normally fail the whole policy construction","Update sandbox configuration so protected paths point at real directories"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}