@@ -143,6 +143,7 @@ type Options struct {
143143 DebugLSP bool `json:"debug_lsp,omitempty" jsonschema:"description=Enable debug logging for LSP servers,default=false"`
144144 DisableAutoSummarize bool `json:"disable_auto_summarize,omitempty" jsonschema:"description=Disable automatic conversation summarization,default=false"`
145145 DataDirectory string `json:"data_directory,omitempty" jsonschema:"description=Directory for storing application data (relative to working directory),default=.crush,example=.crush"` // Relative to the cwd
146+ DisabledTools []string `json:"disabled_tools" jsonschema:"description=Tools to disable"`
146147}
147148
148149type MCPs map[string]MCPConfig
@@ -415,7 +416,51 @@ func (c *Config) SetProviderAPIKey(providerID, apiKey string) error {
415416 return nil
416417}
417418
419+func allToolNames() []string {
420+ return []string{
421+ "bash",
422+ "download",
423+ "edit",
424+ "multiedit",
425+ "fetch",
426+ "glob",
427+ "grep",
428+ "ls",
429+ "sourcegraph",
430+ "view",
431+ "write",
432+ }
433+}
434+
435+func resolveAllowedTools(allTools []string, disabledTools []string) []string {
436+ if disabledTools == nil {
437+ return allTools
438+ }
439+ // filter out disabled tools (exclude mode)
440+ return filterSlice(allTools, disabledTools, false)
441+}
442+
443+func resolveReadOnlyTools(tools []string) []string {
444+ readOnlyTools := []string{"glob", "grep", "ls", "sourcegraph", "view"}
445+ // filter to only include tools that are in allowedtools (include mode)
446+ return filterSlice(tools, readOnlyTools, true)
447+}
448+
449+func filterSlice(data []string, mask []string, include bool) []string {
450+ filtered := []string{}
451+ for _, s := range data {
452+ // if include is true, we include items that ARE in the mask
453+ // if include is false, we include items that are NOT in the mask
454+ if include == slices.Contains(mask, s) {
455+ filtered = append(filtered, s)
456+ }
457+ }
458+ return filtered
459+}
460+
418461func (c *Config) SetupAgents() {
462+ allowedTools := resolveAllowedTools(allToolNames(), c.Options.DisabledTools)
463+
419464 agents := map[string]Agent{
420465 "coder": {
421466 ID: "coder",
@@ -423,7 +468,7 @@ func (c *Config) SetupAgents() {
423468 Description: "An agent that helps with executing coding tasks.",
424469 Model: SelectedModelTypeLarge,
425470 ContextPaths: c.Options.ContextPaths,
426− // All tools allowed
471+ AllowedTools: allowedTools,
427472 },
428473 "task": {
429474 ID: "task",
@@ -431,13 +476,7 @@ func (c *Config) SetupAgents() {
431476 Description: "An agent that helps with searching for context and finding implementation details.",
432477 Model: SelectedModelTypeLarge,
433478 ContextPaths: c.Options.ContextPaths,
434− AllowedTools: []string{
435− "glob",
436− "grep",
437− "ls",
438− "sourcegraph",
439− "view",
440− },
479+ AllowedTools: resolveReadOnlyTools(allowedTools),
441480 // NO MCPs or LSPs by default
442481 AllowedMCP: map[string][]string{},
443482 AllowedLSP: []string{},