microsoft / microsoft/vscode

Terminal Auto-Approve ignores wildcard/regex rules in settings.json (Forces manual approval)

Open
#333,280 1 comment 0 reactions 1 assignee Claimed by @anthonykim1 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Does this issue occur when all extensions are disabled?: No (It is related to the Agent/Chat API terminal behavior)

- VS Code Version: 1.135.0
- OS Version: Windows 11

**Description:**
When using the agent/chat features that execute terminal commands, the editor repeatedly asks for permission via a dialog, even when a global wildcard or regex auto-approve rule is explicitly defined in `settings.json`. The system seems to ignore the `chat.tools.terminal.autoApprove` (or similar global setting) and relies strictly on its internal state DB. This severely breaks autonomous workflows and developer experience.

Steps to Reproduce:

1. Add a global wildcard approval rule to the VS Code `settings.json` file:
```json
"chat.tools.terminal.autoApprove": {
"*": {
"approve": true
}
}
```
2. Ask the agent to run a terminal command (e.g., `git add . && git commit -m "test"`).
3. Observe that the grey approval popup still appears, completely ignoring the global setting.
4. Pressing the "Yes, and always allow..." option works for that *exact* command string, but any slight parameter variation (e.g., `git grep -A 10` vs `git grep -A 20`) triggers a brand new approval popup because it's writing strictly to the local State DB instead of respecting the global `settings.json` wildcard.

**Expected Behavior:**
Setting a wildcard `*` or a regex like `/.*/` in `chat.tools.terminal.autoApprove` should permanently bypass the terminal approval dialog for all matching commands, allowing true autonomous agent execution without requiring manual clicks for every parameter variation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.