Skip to content

fix(core): require confirmation before plan runs shell commands - #54253

Closed
potoior wants to merge 1 commit into
anomalyco:v2from
potoior:plan-shell-confirm
Closed

potoior wants to merge 1 commit into
anomalyco:v2from
potoior:plan-shell-confirm

Conversation

@potoior

@potoior potoior commented Oct 10, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #53955

Type of change

  • Bug fix

What does this PR do?

On v2 the plan agent runs shell commands without confirmation, so opencode plan can execute shell commands the user never approved.

  • packages/core/src/plugin/plan.ts: the plan tool's item now carries a { action: "shell", resource: "*", effect: "ask" } permission so the plan agent asks before running shell commands.
  • packages/core/test/plugin/plan.test.ts: adds requires confirmation before the plan agent runs shell commands.

How did you verify your code works?

  • bun typecheck clean in packages/core.
  • packages/core/test/plugin/plan.test.ts: 13/13 pass (including the new confirmation test).

Screenshots / recordings

N/A (core logic + test).

Checklist

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

The Plan agent could run shell commands (e.g. a script written around the edit deny) that make destructive changes without being prompted (issue anomalyco#53955).

Pin the Plan agent's shell permission to ask, mirroring how read-only is enforced everywhere else (issue anomalyco#53955).
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

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 10, 2026
@opencode-agent

Copy link
Copy Markdown
Contributor

Thanks for the fix, @potoior! I think this duplicates #54165, which also fixes #53955 by adding the same shell ask rule to the plan agent in packages/core/src/plugin/plan.ts, with a similar test. If you think something is missing there, reviewing or testing #54165 and commenting on it would be the best way to help.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant