Repository navigation
Change default permissions for bash, edit, and webfetch from allow → ask - #2148
Closed
GregorLohaus wants to merge 55 commits into
Closed
GregorLohaus wants to merge 55 commits into
GregorLohaus wants to merge 55 commits into
Conversation
|
Why rather than ? https://opencode.ai/docs/permissions/#bash I don't understand why this PR is not default, I don't want the agent all over my hard drive by default! |
Author
|
rebased |
github-actions
Bot
force-pushed
the
dev
branch
from
September 29, 2025 05:53
f16de3d to
cc0d460
Compare
github-actions
Bot
force-pushed
the
dev
branch
from
November 10, 2025 05:43
772b621 to
eb855e1
Compare
github-actions
Bot
force-pushed
the
dev
branch
3 times, most recently
from
November 22, 2025 18:07
f1dc981 to
3e15a39
Compare
github-actions
Bot
force-pushed
the
dev
branch
2 times, most recently
from
November 22, 2025 18:21
df8bdf9 to
0dd5039
Compare
github-actions
Bot
force-pushed
the
dev
branch
from
November 27, 2025 01:29
f8ee907 to
6a9856d
Compare
2 tasks done
BackSlasher
added a commit
to BackSlasher/opencode
that referenced
this pull request
Jan 16, 2026
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 anomalyco#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. 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
|
Did fresh in #8939 |
Author
|
Closed since default permissions have changed alot and look okay |
simonklee
added a commit
that referenced
this pull request
Nov 16, 2026
…hod) c3a007e0d..cee1698ad is #2148 and #2149, which fix record 692: when the terminal's replies (DECRPM 2027, XTVERSION) change the width method after startup, the scene's text follows it, and so do Code, Input, Textarea and TextTable, whose buffers keep their cursors, selections, marks, styled runs and undo points on their text. opentui.h changes (FNV-1a 64 0x99dd2d0018a6caa3, which generated.rs names at cee1698ad): ot_edit_buffer_options's zero `reserved` word is now `flags`, with OT_EDIT_BUFFER_FOLLOW_SESSION_WIDTH; a scene op OT_SCENE_TEXT_SELECTION_COLORS; and ot_text_buffer_set_width_method. No client code uses opentui-sys directly, so nothing names `reserved`, and the opentui API the client calls is unchanged. The native library is in ~/.cache/opentui-native/cee1698ad/x86_64-linux, which .cargo/config.toml names.
simonklee
added a commit
that referenced
this pull request
Nov 16, 2026
…nges late OT/late-width (P-PTY) opens the home screen, then sends the DECRPM 2027 reply a terminal without grapheme clustering gives (mode 0), after startup's wait, and types a thumb with a skin tone into the prompt that already exists. With #2148 the prompt measures it as 4 cells and puts its cursor there; @opentui/core 0.8.4, which TS runs, keeps the prompt's startup width and puts the cursor 2 cells on. The screens are equal; the cursor line differs, which OT2148-live-width-method records (O-89). On the earlier pin the Rust prompt drew the thumb without its skin tone.
simonklee
added a commit
that referenced
this pull request
Nov 17, 2026
…hod) c3a007e0d..cee1698ad is #2148 and #2149, which fix record 692: when the terminal's replies (DECRPM 2027, XTVERSION) change the width method after startup, the scene's text follows it, and so do Code, Input, Textarea and TextTable, whose buffers keep their cursors, selections, marks, styled runs and undo points on their text. opentui.h changes (FNV-1a 64 0x99dd2d0018a6caa3, which generated.rs names at cee1698ad): ot_edit_buffer_options's zero `reserved` word is now `flags`, with OT_EDIT_BUFFER_FOLLOW_SESSION_WIDTH; a scene op OT_SCENE_TEXT_SELECTION_COLORS; and ot_text_buffer_set_width_method. No client code uses opentui-sys directly, so nothing names `reserved`, and the opentui API the client calls is unchanged. The native library is in ~/.cache/opentui-native/cee1698ad/x86_64-linux, which .cargo/config.toml names.
simonklee
added a commit
that referenced
this pull request
Nov 17, 2026
…nges late OT/late-width (P-PTY) opens the home screen, then sends the DECRPM 2027 reply a terminal without grapheme clustering gives (mode 0), after startup's wait, and types a thumb with a skin tone into the prompt that already exists. With #2148 the prompt measures it as 4 cells and puts its cursor there; @opentui/core 0.8.4, which TS runs, keeps the prompt's startup width and puts the cursor 2 cells on. The screens are equal; the cursor line differs, which OT2148-live-width-method records (O-89). On the earlier pin the Rust prompt drew the thumb without its skin tone.
simonklee
added a commit
that referenced
this pull request
Nov 17, 2026
…hod) c3a007e0d..cee1698ad is #2148 and #2149, which fix record 692: when the terminal's replies (DECRPM 2027, XTVERSION) change the width method after startup, the scene's text follows it, and so do Code, Input, Textarea and TextTable, whose buffers keep their cursors, selections, marks, styled runs and undo points on their text. opentui.h changes (FNV-1a 64 0x99dd2d0018a6caa3, which generated.rs names at cee1698ad): ot_edit_buffer_options's zero `reserved` word is now `flags`, with OT_EDIT_BUFFER_FOLLOW_SESSION_WIDTH; a scene op OT_SCENE_TEXT_SELECTION_COLORS; and ot_text_buffer_set_width_method. No client code uses opentui-sys directly, so nothing names `reserved`, and the opentui API the client calls is unchanged. The native library is in ~/.cache/opentui-native/cee1698ad/x86_64-linux, which .cargo/config.toml names.
simonklee
added a commit
that referenced
this pull request
Nov 17, 2026
…nges late OT/late-width (P-PTY) opens the home screen, then sends the DECRPM 2027 reply a terminal without grapheme clustering gives (mode 0), after startup's wait, and types a thumb with a skin tone into the prompt that already exists. With #2148 the prompt measures it as 4 cells and puts its cursor there; @opentui/core 0.8.4, which TS runs, keeps the prompt's startup width and puts the cursor 2 cells on. The screens are equal; the cursor line differs, which OT2148-live-width-method records (O-89). On the earlier pin the Rust prompt drew the thumb without its skin tone.
simonklee
added a commit
that referenced
this pull request
Nov 18, 2026
…hod) c3a007e0d..cee1698ad is #2148 and #2149, which fix record 692: when the terminal's replies (DECRPM 2027, XTVERSION) change the width method after startup, the scene's text follows it, and so do Code, Input, Textarea and TextTable, whose buffers keep their cursors, selections, marks, styled runs and undo points on their text. opentui.h changes (FNV-1a 64 0x99dd2d0018a6caa3, which generated.rs names at cee1698ad): ot_edit_buffer_options's zero `reserved` word is now `flags`, with OT_EDIT_BUFFER_FOLLOW_SESSION_WIDTH; a scene op OT_SCENE_TEXT_SELECTION_COLORS; and ot_text_buffer_set_width_method. No client code uses opentui-sys directly, so nothing names `reserved`, and the opentui API the client calls is unchanged. The native library is in ~/.cache/opentui-native/cee1698ad/x86_64-linux, which .cargo/config.toml names.
simonklee
added a commit
that referenced
this pull request
Nov 18, 2026
…nges late OT/late-width (P-PTY) opens the home screen, then sends the DECRPM 2027 reply a terminal without grapheme clustering gives (mode 0), after startup's wait, and types a thumb with a skin tone into the prompt that already exists. With #2148 the prompt measures it as 4 cells and puts its cursor there; @opentui/core 0.8.4, which TS runs, keeps the prompt's startup width and puts the cursor 2 cells on. The screens are equal; the cursor line differs, which OT2148-live-width-method records (O-89). On the earlier pin the Rust prompt drew the thumb without its skin tone.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes the defaults for bash, edit, and webfetch tools to ask instead of allow.
Why:
Safety: Prevents accidental shell commands, file edits, or network requests that could be destructive or surprising for new users.
Trust & onboarding: New users expect potentially risky actions to require confirmation. Default-allow can feel unsafe and discourage adoption.
I was personally burned by these defaults when trying out opencode for the first time and qwen 3 coder just edited files with shell commands when it could not use the edit tool because it was in Planning mode.
The gemini-cli defaults to ask which felt much saner when trying it out i don't expect an ai-cli tool to just let an agent run arbitrary shell commands on my system by default.