Skip to content

fix(cli): require user confirmation for bash in plan mode (fixes #13290) - #13497

Open
Adeolu5678 wants to merge 1 commit into
continuedev:mainfrom
Adeolu5678:fix/plan-mode-bash-permission
Open

Adeolu5678 wants to merge 1 commit into
continuedev:mainfrom
Adeolu5678:fix/plan-mode-bash-permission

Conversation

@Adeolu5678

Copy link
Copy Markdown

Summary & Security Rationale

Fixes #13290.

Problem

In Continue CLI, Plan Mode (--readonly / cn -p) is designed as a safe, read-only exploration and planning environment that excludes file-modifying tools (Edit, Write, MultiEdit). However, PLAN_MODE_POLICIES previously configured { tool: "Bash", permission: "allow" }.

Because Bash had an unconditional "allow" policy, an LLM operating in Plan Mode could execute arbitrary destructive shell commands (e.g.
m, file overwrites, build side effects, network requests) silently without user approval or confirmation, violating the core security guarantees and user expectations of Plan Mode.

Solution

  1. Changed Bash tool permission in PLAN_MODE_POLICIES from "allow" to "ask", adhering to the principle of least privilege.
  2. Users operating in Plan Mode are now prompted for explicit confirmation before any shell command is dispatched.
  3. Updated unit tests in �xtensions/cli/src/services/ToolPermissionService.modes.test.ts to assert that Plan Mode requires confirmation ("ask") for Bash.
  4. Added dedicated unit tests in �xtensions/cli/src/permissions/defaultPolicies.test.ts covering PLAN_MODE_POLICIES enforcement (Bash confirmation, write tool exclusion, read tool allowance, MCP wildcard handling).

Verification

  • �un test src/permissions/defaultPolicies.test.ts (10 passed, 0 failed)
  • �un test src/services/ToolPermissionService.modes.test.ts (16 passed, 0 failed)
  • AST Code Scrutinizer review: 100/100 APPROVED CLEAN (0 Critical, 0 High defects)

@Adeolu5678
Adeolu5678 requested a review from a team as a code owner November 20, 2026 20:45
@Adeolu5678
Adeolu5678 requested review from sestinj and a balanced review from Copilot and removed request for a team November 20, 2026 20:45
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@Adeolu5678

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@Adeolu5678

Copy link
Copy Markdown
Author

recheck

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plan mode grants unrestricted Bash execution — read-only planning allows arbitrary shell commands

2 participants