From 039bcaa66d29ede5f1c1ea758f610fdef98a84b0 Mon Sep 17 00:00:00 2001 From: quazgar Date: Wed, 9 Sep 2026 12:48:46 +0200 Subject: [PATCH 1/2] Refactor: Rename ReadOnly mode to EditInternal with clarified strings Renames the existing ReadOnly mode to EditInternal to better reflect its actual permissions and clarify the mode's behavior in the UI. Changes: - Rename AgentMode.ReadOnly to AgentMode.EditInternal - Change mode ID from "read-only" to "edit-internal" - Update display name to "Ask for approval" - Update description to "Edit workspace files, ask for approval to edit external files or use the internet" - Update AgentMode.all() to use EditInternal This is a refactoring of the existing mode with no functional changes - it still uses the same workspace-write sandbox policy and permissions. The name and description are now clearer about what the mode actually does. Addresses part of #450 --- src/AgentMode.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AgentMode.ts b/src/AgentMode.ts index c8c1ad03..0a61e30d 100644 --- a/src/AgentMode.ts +++ b/src/AgentMode.ts @@ -35,10 +35,10 @@ export class AgentMode { this.sandboxMode = sandboxMode; // same as sandboxPolicy, need to look for } - static readonly ReadOnly = new AgentMode( - "read-only", + static readonly EditInternal = new AgentMode( + "edit-internal", "Ask for approval", - "Always ask to edit external files and use the internet", + "Edit workspace files, ask for approval to edit external files or use the internet", "standard", "on-request", "user", @@ -114,7 +114,7 @@ export class AgentMode { } static all(): AgentMode[] { - return [AgentMode.ReadOnly, AgentMode.Agent, AgentMode.AgentFullAccess]; + return [AgentMode.EditInternal, AgentMode.Agent, AgentMode.AgentFullAccess]; } static find(modeId: string): AgentMode | null { From 2e084ca165df40727d40c2af3e5aaf531a44acb6 Mon Sep 17 00:00:00 2001 From: quazgar Date: Wed, 9 Sep 2026 12:51:01 +0200 Subject: [PATCH 2/2] Add: True read-only mode with read-only sandbox policy Adds a new read-only mode that provides true read-only access, preventing any file modifications without explicit user approval. Changes: - Add AgentMode.ReadOnly: read-only sandbox (type: "readOnly", networkAccess: false) - Change name to "Read-only" - Change description to "Inspect only, ask for approval to modify any files" - Update AgentMode.all() to include ReadOnly first This provides users with a true inspection mode as requested in #450. The three approval-based modes are now: 1. Read-only: inspect only, ask for approval on any modification 2. Ask for approval: edit workspace files, ask for approval on external changes 3. Approve for me: auto-approve safe operations 4. Full access: no restrictions Fixes #450 --- src/AgentMode.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/AgentMode.ts b/src/AgentMode.ts index 0a61e30d..c31c7d82 100644 --- a/src/AgentMode.ts +++ b/src/AgentMode.ts @@ -35,6 +35,19 @@ export class AgentMode { this.sandboxMode = sandboxMode; // same as sandboxPolicy, need to look for } + static readonly ReadOnly = new AgentMode( + "read-only", + "Read-only", + "Inspect only, ask for approval to modify any files", + "standard", + "on-request", + "user", + { + type: "readOnly", + networkAccess: false, + }, + "read-only", + ); static readonly EditInternal = new AgentMode( "edit-internal", "Ask for approval", @@ -114,7 +127,7 @@ export class AgentMode { } static all(): AgentMode[] { - return [AgentMode.EditInternal, AgentMode.Agent, AgentMode.AgentFullAccess]; + return [AgentMode.ReadOnly, AgentMode.EditInternal, AgentMode.Agent, AgentMode.AgentFullAccess]; } static find(modeId: string): AgentMode | null {