Skip to content

Commit 4fda7c3

Browse files
authored
Merge pull request #260859 from microsoft/tyriar/safe_top
Allow safe top commands
2 parents e130cac + 00a3a64 commit 4fda7c3

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,
@@ -139,15 +138,18 @@ export const terminalChatAgentToolsConfiguration: IStringDictionary<IConfigurati
139138
'Split-Path': true,
140139
'Join-Path': true,
141140

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

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

0 commit comments

Comments
 (0)