Skip to content

AutoApprove rules are not honored under Default Approvals for terminal commands #324059

Description

@roma-fl

chat.tools.terminal.autoApprove rules are not honored under "Default Approvals" for terminal commands like git diff

Summary

When Copilot Chat is in "Default Approvals" mode, terminal commands that are explicitly allowed by chat.tools.terminal.autoApprove still show the "Run pwsh command?" confirmation dialog instead of auto-running.

This makes chat.tools.terminal.autoApprove ineffective for the expected user scenario: allowing safe terminal commands without repeated prompts.

Environment

  • VS Code: 1.127.0
  • GitHub Copilot Chat / Copilot: 0.55.0
  • OS: Windows 10 Pro
  • Shell: PowerShell
  • Chat permission mode: "Default Approvals"

Steps to Reproduce

Step 1. Configure chat.tools.terminal.autoApprove with an allow rule for git diff, for example:

"chat.tools.terminal.autoApprove": {
  "/^git(\\s+(-C\\s+\\S+|--no-pager))*\\s+diff\\b/": true
}

Step 2. In Copilot Chat, keep the permission mode set to "Default Approvals".

Step 3. Ask Copilot Chat to run this command:

git diff --unified=40 -- src/file1.go src/file2.go src/file3.go

Actual Result

A confirmation dialog appears:

  • "Run pwsh command?"
  • User must click "Allow" manually

Expected Result

Because the command matches an explicit allow rule in chat.tools.terminal.autoApprove, it should auto-run without showing the confirmation dialog while in "Default Approvals".

Additional Notes

  • The command is safe/read-only and is exactly the kind of command users expect to whitelist via chat.tools.terminal.autoApprove.
  • The command runs successfully after manual approval, so the problem is not command validity.
  • From a user perspective, "Default Approvals" appears not to actually "use configured rules" for terminal commands in the expected way.
  • This seems like either a regression or a behavior change that makes chat.tools.terminal.autoApprove much less useful than before.
  • Bypass Approvals is not an acceptable workaround, because it auto-approves all tool calls, not only the commands explicitly allowed in chat.tools.terminal.autoApprove.

Why this is a problem

Users configure chat.tools.terminal.autoApprove specifically to avoid repeated prompts for safe commands such as git diff, git status, etc. If those commands still trigger the top-level approval dialog in "Default Approvals", the setting no longer provides the expected value.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from posterterminal-auto-approveRelated to the terminal's auto approve logic

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions