Question

Copilot agent mode wants me to click Continue on every terminal command, is auto approve safe?

Solved · 351 viewsasked by dan_the_intern

My company gives us Copilot in VS Code. In agent mode it asks for approval on every command (npm test, git status, ls...). Clicking Continue 40 times per task is killing me. I found a setting that turns on auto approve for everything, but I'm an intern and I don't want to be the one who wipes something. Is there a middle ground?

What I’ve tried

Found the global 'auto approve' checkbox but didn't turn it on. Tried asking the agent to batch commands.

Comment
Following, same dilemma at my job. jae_park

3 answers

Marked as helpful by the asker
cloudkat

Don't turn on the global one (chat.tools.autoApprove). That approves every tool, including commands you never saw.

Use the terminal allow/deny list instead. In settings.json:

"chat.tools.terminal.autoApprove": {
  "npm test": true,
  "npx vitest": true,
  "/^git (status|diff|log)\\b/": true,
  "rm": false,
  "git push": false,
  "curl": false
}

Read-only and test commands run by themselves, everything else still asks. false entries always ask, even if an earlier rule matched.

Setting names have moved around between VS Code versions, so if that key does nothing, search "autoApprove" in the Settings UI and use whatever your version calls it.

Comment
Did this, went from ~40 clicks to maybe 5 per task. And I still see anything that deletes or pushes. dan_the_intern
Also check whether your company pushes org-wide policies for this. Some orgs block the setting altogether. rune_a
lena_ops

Middle ground number two: run the agent inside a dev container. Then even an approved rm -rf only hits a disposable container and the mounted project folder, not your home directory or the SSH keys on your laptop. Still commit before each agent task so the project folder is recoverable.

Comment
ollie_dev

Put a deny entry for anything with --force or reset --hard in it (regex), those are the git commands that actually lose work.

Comment