{"record":{"id":"eaafbf4377c51bf3","repo":"zed-industries/zed","slug":"permission-to-run-tool-denied-by-user","errorCode":null,"errorMessage":"Permission to run tool denied by user","messagePattern":"Permission to run tool denied by user","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent/src/thread.rs","lineNumber":6191,"sourceCode":"                    crate::sandboxing::NetworkRequest::None => {}\n                    crate::sandboxing::NetworkRequest::AnyHost => {\n                        agent.allow_sandbox_all_hosts();\n                    }\n                    crate::sandboxing::NetworkRequest::Hosts(hosts) => {\n                        // Rebuild the persisted list with subsumption pruning\n                        // so granting `*.github.com` retires a previously\n                        // persisted `api.github.com` instead of accumulating\n                        // redundant entries. Unparsable hand-edited entries\n                        // are preserved untouched.\n                        let mut patterns = Vec::new();\n                        let mut unparsable = Vec::new();\n                        for raw in agent.sandbox_network_hosts() {\n                            match http_proxy::HostPattern::parse(raw) {\n                                Ok(pattern) => {\n                                    crate::sandboxing::insert_host_pattern(&mut patterns, pattern)\n                                }\n                                Err(_) => unparsable.push(raw.clone()),\n                            }\n                        }\n                        for host in hosts {\n                            crate::sandboxing::insert_host_pattern(&mut patterns, host.clone());\n                        }\n                        let mut host_strings = unparsable;\n                        host_strings.extend(patterns.iter().map(|pattern| pattern.to_string()));\n                        agent.set_sandbox_network_hosts(host_strings);\n                    }\n                }\n\n                if request.allow_fs_write_all {\n                    agent.allow_sandbox_fs_write_all();\n                }\n                if request.unsandboxed {\n                    agent.allow_sandbox_unsandboxed();\n                }\n                for granted in request.write_paths {\n                    // Persist the full (requested, resolved-canonical) pair so a","sourceCodeStart":6173,"sourceCodeEnd":6209,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/agent/src/thread.rs#L6173-L6209","documentation":"Returned from the sandbox permission outcome handler when the user's decision maps to a denial (anything other than AllowOnce/AllowThread/AllowAlways). It is the standard refusal sentinel propagated back to the ACP client indicating the tool run was rejected by the user.","triggerScenarios":"Thrown at crates/agent/src/thread.rs:6058 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The user denied permission for the tool call in the authorization prompt; the tool must not run","Re-prompt only if the user later changes their mind or the context changes significantly","Continue the turn without that tool, letting the model adapt to the denial"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}