fix(agent-runtime): forbid workspace mutation via Bash in Plan/Goal prompts - #408
Merged
vastsa merged 2 commits intoSep 15, 2026
Merged
Conversation
…prompts Plan and Goal system prompts previously told the model that Bash "may mutate files" under the active permission policy. Write/Edit are host-denied in contract modes, but Bash is on the allowlist, so after a few turns the model could implement changes while still in Plan mode (vastsa#297). Tighten both mode prompts: Bash is inspection-only in contract modes; if the user asks for implementation, ask them to switch to Agent mode (Plan) or submit the goal for approval (Goal). Host permission policy is unchanged. Fixes vastsa#297
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Plan mode still mutates workspace files after a few turns (#297). Write/Edit are host-denied in contract modes, but Bash stays on the Plan/Goal allowlist.
PLAN_MODE_SYSTEM_PROMPT/GOAL_MODE_SYSTEM_PROMPTpreviously said Bash "may mutate files" under the active permission policy, so the model could implement changes while the session remained in Plan.Solution
Tighten both contract-mode system prompts only (no permission-policy change):
Host-core
plan_mode_allowsstill permits Bash; Write/Edit remain hard-denied. This change is the model-facing contract so the agent does not treat Bash as an implementation channel.Testing
pnpm --filter @pi-desktop/agent-runtime exec vitest run src/mode-prompts.test.ts3 passedIssue alignment
Agent dimension
human-in-the-loop
Core value
Plan/Goal no longer tell the model Bash may mutate the workspace, closing the multi-turn implement-while-planning path.