fix(terminal-security): honor Automatic mode for run_terminal_command - #13103
Open
santhiprakash wants to merge 1 commit into
Open
fix(terminal-security): honor Automatic mode for run_terminal_command#13103santhiprakash wants to merge 1 commit into
santhiprakash wants to merge 1 commit into
Conversation
- Problem: setting run_terminal_command to Automatic still prompted for nearly every command because security evaluation demoted Automatic to Ask First for non-allowlisted commands. - Fix: when the base policy is Automatic, only hard-disable critical commands; do not re-prompt for other commands. Ask First behavior is unchanged. - Verification: npm test in packages/terminal-security (230 passed); added GUI thunk regression for Automatic auto-execute.
Author
|
I have read the CLA Document and I hereby sign the CLA |
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.
Description
Fixes #13035 (also addresses #10512).
Setting
run_terminal_commandto Automatic previously had little effect: terminal security evaluation demoted Automatic (allowedWithoutPermission) back to Ask First for any command outside a small allowlist (e.g.npm install,msbuild,curl …). Other tools honor Automatic as expected, so this felt like a broken setting.Maintainer direction on #10512: keep hard failures for critical commands (e.g.
rm -rf), and stop re-prompting for everything else when the user chose Automatic.Problem
run_terminal_command= Automatic; agent runs a normal command (npm test,msbuild, etc.)Triage / Root cause
evaluateTerminalCommandSecurityin@continuedev/terminal-securitystarts from the user's base policy, thengetMostRestrictivewith per-command risk checks. For non-allowlisted commands that evaluation returnsallowedWithPermission, which overrode Automatic. Ask First was effectively forced for most agent terminal use.Fix
disabled(critical commands)Checklist
Screen recording or screenshot
N/A — non-visual policy evaluation change; covered by unit/thunk tests.
Tests
packages/terminal-security: updated High/Medium risk coverage to assert Ask First still prompts; added Automatic mode honors base policy cases (auto-approve high-risk/unknown; still disablerm -rf/sudo)guithunk: regression that Automaticrun_terminal_commandauto-callstools/callwhen policy evaluation returns Automaticcd packages/terminal-security && npm test→ 230 passedNotes / Risks
allowedUnrestrictedmode (skips even critical disables). This PR is narrower: make existing Automatic work as labeled, per run_terminal_command still need Accept even if I set it to automatic #10512 maintainer note, without a new policy enum.rm -rf /,sudo, etc.) remain enforced under Automatic.