vscode-copilot-release icon indicating copy to clipboard operation
vscode-copilot-release copied to clipboard

🔧 Feature Request: “Always allow Copilot Agent to run commands without asking”

Open rezwanahmedsami opened this issue 7 months ago • 15 comments

Add a user setting (e.g. copilot.agent.autoApproveCommands) in VS Code’s Copilot extension that lets users skip the confirmation prompt when Copilot’s Agent mode wants to execute terminal commands. This would function similarly to Cursor’s approach—where AI helpers can dispatch commands seamlessly once permission is granted—so that repetitive confirmation dialogs are no longer needed during a workflow.


đź§­ Motivation

  1. Streamlined Workflow
    When running multi-step tasks (e.g. scaffolding, migrations, build/test sequences), Copilot Agent often requests confirmation before executing each command. Chaining many steps becomes tedious. Allowing users to "approve once" would mimic Cursor’s smoother experience and reduce interruption.

  2. Consistency with Other IDE Agents
    Tools like Cursor already offer a toggle for pre-approval, preventing repetitive prompts. Enabling a similar mode for Copilot would align user workflows and expectationsforum.cursor.com+5forum.cursor.com+5docs.github.com+5.

  3. User-Controlled Trust
    This optional setting lets users decide their own risk level—some prefer security controls, others prefer a frictionless DevOps-style workflow. Either way, Copilot Agent can meet both needs.


🎯 Proposed Implementation

  • New Setting:

    json
    "copilot.agent.autoApproveCommands": true | false
    • true: Copilot Agent skips confirmation dialogs and executes commands directly.

    • false (default): retains current behavior—prompt before running terminal commands.

  • Scope:
    Applies only to commands executed by Copilot Agent from its VS Code session, not to user-initiated shell commands.


âś… Expected Benefits

Benefit | Description -- | -- Less friction | Avoid repeated interruptions during multi-step AI-driven tasks. Faster feedback loop | Commands execute immediately, leading to quicker iteration. Customizable | Users control whether they want manual approval or an automated flow.

⚠️ Security Considerations

  • Clear labeling in settings UI about the risk of auto-approving commands.

  • Evoke attention the first time users enable the setting ("enabling this may allow Copilot to run commands without prompting").

  • Only terminal commands initiated via Copilot Agent should be affected—not generic shell access.

rezwanahmedsami avatar Jun 29 '25 08:06 rezwanahmedsami

I would second this. The agent mode for Claude is especially eager to run 10s of commands to check it hasn't made mistakes (simple compilation steps or linting steps). These get boring to approve every time. I feel like agent mode UI should not be chat driven if agents are actually going to be more independent. But that's a different story.

amanpatel avatar Jun 30 '25 11:06 amanpatel

As a middle ground, a whitelist can allow pre-approved command without risking injection attacks or other hallucinations

mbrevda avatar Jul 06 '25 18:07 mbrevda

Requesting this as well. Cursor Editor has this feature however it is a fork of VSCode's open source, meaning it lacks critical features I need such as remote-ssh to access my development environment

Merith-TK avatar Jul 09 '25 19:07 Merith-TK

I upvote this

bondansebastian avatar Jul 11 '25 03:07 bondansebastian

This is much needed

AbdwGTK avatar Jul 11 '25 08:07 AbdwGTK

This should be implemented with the same kind of whitelist as claude code (settings.json with permissions "allow" and "dissalow")

belgac avatar Jul 11 '25 10:07 belgac

bump.

workaround is using using a macro automate python script with opencv that check the position of the screen for the continue here button, and scroll to bottom of the panel. if the button is present then click it.

p3nGu1nZz avatar Jul 12 '25 19:07 p3nGu1nZz

In the meantime, I found this older issue https://github.com/microsoft/vscode-copilot-release/issues/8106 , the "Auto Approve" experimental setting works for me.

Currently it's missing the whitelist feature, but Github > Copilot > Chat > Agent > Terminal: Deny List is experimental and is already populated with sensible defaults (e.g. rm, rmdir, kill, ....)

fsvm88 avatar Jul 13 '25 15:07 fsvm88

There's this: https://github.com/microsoft/vscode-copilot-release/issues/8106 It allows everything tho

NasvekL avatar Jul 24 '25 16:07 NasvekL

You can auto-approve commands from a list under chat.tools.terminal.autoApprove in the settings.json as follows:

{
    ...
    "chat.tools.autoApprove": false,
    "chat.tools.terminal.autoApprove": {
        "rm": false,
        "rmdir": false,
        "del": false,
        "kill": false,
        "curl": false,
        "wget": false,
        "eval": false,
        "chmod": false,
        "chown": false,
        "/^Remove-Item\\b/i": false,
        "/^dotnet build .*/": true,
        "/^npm .*/": true
    }
}

The last two commands will be run without requiring an approval. Please note that this is not 100% safe as the .* might contain some nefarious command.

Image

magamig avatar Aug 15 '25 09:08 magamig

You can auto-approve commands from a list under chat.tools.terminal.autoApprove in the settings.json as follows:

{
    ...
    "chat.tools.autoApprove": false,
    "chat.tools.terminal.autoApprove": {
        "rm": false,
        "rmdir": false,
        "del": false,
        "kill": false,
        "curl": false,
        "wget": false,
        "eval": false,
        "chmod": false,
        "chown": false,
        "/^Remove-Item\\b/i": false,
        "/^dotnet build .*/": true,
        "/^npm .*/": true
    }
}

The last two commands will be run without requiring an approval. Please note that this is not 100% safe as the .* might contain some nefarious command.

Image

I followed and the auto approve suggestion and it worked.. but the whitelist is not been follow strictly.. I just saw an rm command.. which scares me a little! :D

igormcsouza avatar Sep 05 '25 18:09 igormcsouza

Why not letting the agent list all next commands it will use and validate at once so it never asks again for a whole set of actions ? This way the user knows the steps it will follow and approve or not some of the tasks in the list/reorder and so on.

alibnzcegedim avatar Oct 11 '25 12:10 alibnzcegedim

Auto approve has been working well for me on the WSL Ubuntu for the last few weeks, however not so much on native Windows 11. VS Code always messes up the command structure and arguments with PowerShell, so to avoid these issues, I've migrated most of my current workflows entirely to Linux. You can easily switch between WSL and Windows mode in your vs code via the command palette. I like the current auto approve workflow and settings file that is currently implemented.

p3nGu1nZz avatar Oct 15 '25 20:10 p3nGu1nZz

Why is this changing so often? Every week I have an agent checking for how to get the auto approve working. Some days good, but constantly breaks. I now have a whole list of settings, most greyed out. Right now my windows repo works as I want but WSL not at all.... I am also seeing the agent constantly scroll back to the top of its window whn an approval is required. I am starting to regret going with VSCode Copilot rather than something else. Its a second job to maintain right now.

JSunRae avatar Oct 26 '25 17:10 JSunRae

Why is this changing so often? Every week I have an agent checking for how to get the auto approve working. Some days good, but constantly breaks. I now have a whole list of settings, most greyed out. Right now my windows repo works as I want but WSL not at all.... I am also seeing the agent constantly scroll back to the top of its window whn an approval is required. I am starting to regret going with VSCode Copilot rather than something else. Its a second job to maintain right now.

I’ve noticed this too. I don’t like having all my auto-approve commands stored in plaintext for my settings either. It’s a security risk, and developers could easily and inadvertently commit very sensitive commands, which might include sensitive export values like API keys.

I would prefer a toggle switch to turn it off more easily in the chat title bar or something.

If I am monitoring the process, I need auto-approve, but if it's silent (i am not in office), then I would like it to ask if something required sensitive data or a task that requires me to unlock something with my dongle. etc..

p3nGu1nZz avatar Oct 27 '25 17:10 p3nGu1nZz