Skip to content

Commit 00a3a64

Browse files
committed
Allow safe top commands
Part of #259668
1 parent dafc6c5 commit 00a3a64

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export const terminalChatAgentToolsConfiguration: IStringDictionary<IConfigurati
9090
// Safe and common readonly commands (automatically approved)
9191
echo: true,
9292
ls: true,
93-
find: true,
9493
pwd: true,
9594
cat: true,
9695
head: true,
@@ -138,15 +137,18 @@ export const terminalChatAgentToolsConfiguration: IStringDictionary<IConfigurati
138137
'Split-Path': true,
139138
'Join-Path': true,
140139

140+
// Commands that are generally allowed with special cases we block
141+
find: true,
142+
'/find\\b.*-exec(dir)?\\b/': false, // Execute on results
143+
top: true,
144+
'/top\\b.*-(k|r)\\b/': false, // Kill or renice processes
145+
141146
// There are countless dangerous commands available on the command line, the defaults here
142147
// include common ones that the user is likely to want to explicitly approve first. This is
143148
// not intended to be a catch all as the user needs to opt-in to auto-approve commands, it
144149
// provides additional safety when the commands get approved by broad rules or via LLM-based
145150
// approval
146151

147-
// Overwriting allowed by default commands with special cases
148-
'/find\\b.*-exec(dir)?\\b/': false,
149-
150152
// Deleting files
151153
rm: false,
152154
rmdir: false,

0 commit comments

Comments
 (0)