{"record":{"id":"8e11a89215d13e66","repo":"astral-sh/ruff","slug":"external-commands-are-disabled-in-an-untrusted-wor","errorCode":null,"errorMessage":"external commands are disabled in an untrusted workspace","messagePattern":"external commands are disabled in an untrusted workspace","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/ty_server/src/system.rs","lineNumber":326,"sourceCode":"impl<'de> Deserialize<'de> for WorkspaceTrust {\n    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>\n    where\n        D: Deserializer<'de>,\n    {\n        // The LSP option is `untrustedWorkspace`, so `true` means untrusted.\n        Ok(match Option::<bool>::deserialize(deserializer)? {\n            Some(true) => Self::Untrusted,\n            Some(false) | None => Self::Trusted,\n        })\n    }\n}\n\n/// Rejects commands without retaining the LSP document index.\nstruct UntrustedWorkspaceExecutor;\n\nimpl CommandExecutor for UntrustedWorkspaceExecutor {\n    fn execute(&self, _command: Command) -> Result<Output> {\n        Err(std::io::Error::new(\n            std::io::ErrorKind::PermissionDenied,\n            \"external commands are disabled in an untrusted workspace\",\n        ))\n    }\n\n    fn dyn_clone(&self) -> Box<dyn CommandExecutor> {\n        Box::new(Self)\n    }\n}\n\nfn not_a_text_document(path: impl Display) -> std::io::Error {\n    std::io::Error::new(\n        std::io::ErrorKind::InvalidInput,\n        format!(\"Input is not a text document: {path}\"),\n    )\n}\n\nfn virtual_path_not_found(path: impl Display) -> std::io::Error {","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/astral-sh/ruff/blob/26f38c119cac42e4d320ba08f09224fdec74af2c/crates/ty_server/src/system.rs#L308-L344","documentation":"A std::io::Error (PermissionDenied) returned by UntrustedWorkspaceExecutor::execute when the workspace is untrusted: ty deliberately blocks all external command execution so untrusted projects cannot run arbitrary processes during checking.","triggerScenarios":"Thrown at crates/ty_server/src/system.rs:326 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Mark the workspace as trusted to allow command execution","Remove configuration that depends on running external commands when untrusted"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"26f38c119cac42e4d320ba08f09224fdec74af2c","analyzedAt":"2026-09-05T10:32:37.492Z","contentChangedAt":"2026-09-05T10:32:37.492Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}