feat: Add Permission Control for Path Restrictions in Bash Tool #1801

Closed
opened 2026-02-16 17:32:41 -05:00 by yindo · 2 comments
Owner

Originally created by @thuanpham582002 on GitHub (Sep 23, 2025).

Originally assigned to: @thdxr on GitHub.

Summary: Allow users to approve bash commands that reference external paths via permission system.

Problem: Bash tool hard-rejects external paths without user control.

mkdir -p ~/.config/opencode  # ❌ Fails immediately

Solution: Add external_paths permission type:

{
  "permission": {
    "external_paths": "ask"   "ask" | "allow" | "deny"
  }
}

Implementation: Modify bash.ts to use Permission.ask() for external paths instead of hard rejection.

Benefits:

  • User control over external path access
  • Consistent with other tool permissions
  • Enables legitimate operations (config migration, etc.)

Files: packages/opencode/src/tool/bash.ts

Originally created by @thuanpham582002 on GitHub (Sep 23, 2025). Originally assigned to: @thdxr on GitHub. **Summary:** Allow users to approve bash commands that reference external paths via permission system. **Problem**: Bash tool hard-rejects external paths without user control. ``` bash mkdir -p ~/.config/opencode # ❌ Fails immediately ``` Solution: Add external_paths permission type: ``` json { "permission": { "external_paths": "ask" "ask" | "allow" | "deny" } } ``` Implementation: Modify bash.ts to use Permission.ask() for external paths instead of hard rejection. Benefits: - User control over external path access - Consistent with other tool permissions - Enables legitimate operations (config migration, etc.) Files: packages/opencode/src/tool/bash.ts
yindo closed this issue 2026-02-16 17:32:41 -05:00
Author
Owner

@rekram1-node commented on GitHub (Sep 23, 2025):

note: we probably want some functionality to allow access for other tools to work outside cwd too, like read for instance.

@rekram1-node commented on GitHub (Sep 23, 2025): note: we probably want some functionality to allow access for other tools to work outside cwd too, like read for instance.
Author
Owner

@rekram1-node commented on GitHub (Sep 23, 2025):

This will be done as part of: #1961

@rekram1-node commented on GitHub (Sep 23, 2025): This will be done as part of: #1961
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1801