Skip to content

Commit 065f528

Browse files
authored
Merge pull request microsoft#259669 from microsoft/copilot/fix-259668
Add safe readonly commands to terminal auto approve defaults
2 parents 9224064 + 53294d2 commit 065f528

File tree

1 file changed

+38
-5
lines changed

1 file changed

+38
-5
lines changed

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

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,45 @@ 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
9489
default: {
90+
// Safe and common readonly commands (automatically approved)
91+
echo: true,
92+
'Write-Host': true,
93+
'Write-Output': true,
94+
ls: true,
95+
find: true,
96+
'Get-ChildItem': true,
97+
pwd: true,
98+
'Get-Location': true,
99+
cat: true,
100+
head: true,
101+
tail: true,
102+
'Get-Content': true,
103+
grep: true,
104+
wc: true,
105+
'Select-Object': true,
106+
'Select-String': true,
107+
'Where-Obejct': true,
108+
'Measure-Object': true,
109+
sort: true,
110+
uniq: true,
111+
'Sort-Object': true,
112+
which: true,
113+
'Get-Command': true,
114+
date: true,
115+
'Get-Date': true,
116+
hostname: true,
117+
'Get-Host': true,
118+
ps: true,
119+
'Get-Process': true,
120+
whoami: true,
121+
122+
// There are countless dangerous commands available on the command line, the defaults here
123+
// include common ones that the user is likely to want to explicitly approve first. This is
124+
// not intended to be a catch all as the user needs to opt-in to auto-approve commands, it
125+
// provides additional safety when the commands get approved by broad rules or via LLM-based
126+
// approval
127+
95128
// Deleting files
96129
rm: false,
97130
rmdir: false,

0 commit comments

Comments
 (0)