Skip to content

fix(core): require confirmation for bash in plan mode - #54119

Closed
potoior wants to merge 1 commit into
anomalyco:devfrom
potoior:plan-shell-ask
Closed

potoior wants to merge 1 commit into
anomalyco:devfrom
potoior:plan-shell-ask

Conversation

@potoior

@potoior potoior commented Oct 9, 2026

Copy link
Copy Markdown

Plan mode has no rule for the bash tool, so shell commands fall through to the * -> allow default and run without confirmation, letting the model make destructive changes (issue #53955).

Add a bash -> ask rule so read-only exploration still works while destructive shell commands require approval. Fixes #53955.

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Please provide a description of the issue, the changes you made to fix it, and why they work. It is expected that you understand why your changes work and if you do not understand why at least say as much so a maintainer knows how much to value the PR.

If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!

How did you verify your code works?

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

Plan mode has no rule for the bash tool, so shell commands fall through to the * -> allow default and run without confirmation, letting the model make destructive changes (issue anomalyco#53955).

Add a bash -> ask rule so read-only exploration still works while destructive shell commands require approval. Fixes anomalyco#53955.
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Oct 9, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • No "Type of change" checkbox is checked. Please select at least one.
  • No issue referenced. Please add Closes #<number> linking to the relevant issue.
  • "How did you verify your code works?" section is empty. Please explain how you tested.
  • Not all checklist items are checked. Please confirm you have tested locally and have not included unrelated changes.

Please edit this PR description to address the above within 72 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot closed this Oct 9, 2026
@opencode-agent

opencode-agent Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for picking this up, @potoior!

The dev branch (v1) only takes critical fixes. Plan mode running shell commands without asking is a real problem, but it has a simple workaround ("agent": { "plan": { "permission": { "bash": "ask" } } } in your config), so it doesn't meet that bar for v1.

#53955 was reproduced on v2, which is where this is most useful. If you'd like to pursue it, please open a pull request against the v2 branch. v2 is a separate implementation: the Plan agent's rules are in packages/core/src/plugin/plan.ts, and the tool there is shell, so the change will need to be redone there rather than ported over. #53530 is related.

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

Labels

needs:compliance This means the issue will auto-close after 2 hours.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent is making edits when on plan mode

1 participant