visual-studio-codegithub-copilotvscode-copilot

How to automatically approve/continue GitHub Copilot terminal commands in VSCode?


I'm using GitHub Copilot in VSCode through the CHAT tab, it frequently suggests running terminal commands and asks for iteration permissions. However, each time it wants to execute a command or continue working on a problem, I get confirmation dialogs requiring manual approval.

Example:

  1. Terminal command execution: When Copilot suggests running node server.js, I see a dialog:

enter image description here

  1. Iteration continuation: After Copilot works on a problem for a while, I get prompted:

enter image description here

Expected behavior

I would like to configure GitHub Copilot to:

  1. Automatically execute suggested terminal commands without requiring manual approval
  2. Automatically continue iterations when working on complex problems

Safety concerns

I understand these confirmation dialogs might be security features by design to:

However, for trusted development environments and experienced developers, having the option to enable "auto-approve" mode would significantly improve productivity and workflow efficiency.


Solution

  • The first one can be fixed by adding this to your settings:

    "chat.tools.autoApprove": true
    

    The second option deals with the number of requests the agent performs before continuing. The default is 25. If you change it to a higher number, it will continue for a longer period of time.

    "chat.agent.maxRequests": 250
    

    See reference below:

    https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode