Skip to content

Commit 64576c7

Browse files
committed
Add pwsh equivalents to default auto approve list
Fixes microsoft#259763
1 parent 2c804a6 commit 64576c7

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,39 @@ export const terminalChatAgentToolsConfiguration: IStringDictionary<IConfigurati
8686
},
8787
]
8888
},
89+
// There are countless dangerous commands available on the command line, the defaults here
90+
// include common ones that the user is likely to want to explicitly approve first. This is
91+
// not intended to be a catch all as the user needs to opt-in to auto-approve commands, it
92+
// provides additional safety when the commands get approved by broad rules or via LLM-based
93+
// approval
8994
default: {
95+
// Deleting files
9096
rm: false,
9197
rmdir: false,
9298
del: false,
99+
'/^Remove-Item\\b/i': false,
100+
ri: false,
101+
rd: false,
102+
erase: false,
103+
// Killing processes, dangerous thing to do generally
93104
kill: false,
105+
'/^Stop-Process\\b/i': false,
106+
spps: false,
107+
'/^taskkill(\\.exe)?\\b/i': false,
108+
// Web requests, prompt injection concerns
94109
curl: false,
95110
wget: false,
96-
eval: false,
111+
'/^(Invoke-(RestMethod|WebRequest)|irm|iwr)\\b/i': false,
112+
// File permissions and ownership, messing with these can cause hard to diagnose issues
97113
chmod: false,
98114
chown: false,
99-
'/^Remove-Item\\b/i': false,
115+
'/^Set-ItemProperty\\b/i': false,
116+
'sp': false,
117+
'/^Set-Acl\\b/i': false,
118+
// Eval string, can lead to anything else running
119+
eval: false,
120+
'/^Invoke-Expression\\b/i': false,
121+
iex: false,
100122
},
101123
}
102124
};

0 commit comments

Comments
 (0)