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.

Activity

  1. anthonykim1 commented on Jul 2, 2026

    @anthonykim1
    Contributor
    Image

    Roman Fetisov (@roma-fl) Can you please share the view of your agents picker? And if you are able to reproduce on the latest insiders Insiders build

  2. added
    terminal-auto-approve
    bug
    info-needed
    on Jul 2, 2026
  3. roma-fl commented on Jul 3, 2026

    @roma-fl
    Author

    Tested on Insider Build: 1.128.0-insider (system setup). Same result:
    Image

  4. roma-fl commented on Jul 10, 2026

    @roma-fl
    Author

    "Allow all commands in this session" also doesn't help, it still asks for confirmation for some "pwsh" commands.

  5. Troyx21 commented on Jul 13, 2026

    @Troyx21

    I think I have the same issue. No combination of plain command prefix, regex, or object-style matchCommandLine syntax helps with following commands:

    npm exec -- tsc --noEmit --pretty false
    npm exec -- eslint src/some-file-name.ts
    

    The prompt about pwsh is always shown. It worked for the simple "npx eslint": true though. I think it is a parsing issue with npm exec having double dashes. But strangely, matchCommandLine variant did not work either. Please investigate these npm exec -- somecommand variants as well. #325635

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

Metadata

Metadata

Labels

buginfo-neededterminal-auto-approve

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions