[PR #8939] fix: change default permissions from allow to ask for better security #12914

Open
opened 2026-02-16 18:17:48 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8939

State: open
Merged: No


What does this PR do?

Changes the default "": "allow" to "": "ask" in agent defaults to prevent auto-execution of potentially dangerous operations like bash commands, file edits, and web fetches without user approval.

This addresses security concerns raised in #2148 where users were surprised that OpenCode allowed arbitrary shell commands and file modifications by default without prompting.

The build agent and other agents still function correctly as they explicitly override permissions where needed.

Closes #8938

How did you verify your code works?

Testing:

  • bun test test/tool/bash.test.ts: 12 pass, 0 fail
  • bun test test/tool/ test/agent/ test/permission/: 106 pass, 28 fail
  • Agent test failures are due to unrelated import issues, not this change
  • Verified bash permission tests work correctly with new default
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8939 **State:** open **Merged:** No --- ### What does this PR do? Changes the default "*": "allow" to "*": "ask" in agent defaults to prevent auto-execution of potentially dangerous operations like bash commands, file edits, and web fetches without user approval. This addresses security concerns raised in #2148 where users were surprised that OpenCode allowed arbitrary shell commands and file modifications by default without prompting. The build agent and other agents still function correctly as they explicitly override permissions where needed. Closes #8938 ### How did you verify your code works? Testing: - `bun test test/tool/bash.test.ts`: 12 pass, 0 fail - `bun test test/tool/ test/agent/ test/permission/`: 106 pass, 28 fail - Agent test failures are due to unrelated import issues, not this change - Verified bash permission tests work correctly with new default
yindo added the pull-request label 2026-02-16 18:17:48 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12914