@@ -243,6 +243,37 @@ export const terminalChatAgentToolsConfiguration: IStringDictionary<IConfigurati
243243
244244 // #endregion
245245
246+ // #region Package managers (npm, yarn, pnpm)
247+ //
248+ // Read-only commands that don't modify files or execute arbitrary code.
249+
250+ // npm read-only commands
251+ '/^npm\\s+(ls|list|outdated|view|info|show|explain|why|root|prefix|bin|search|doctor|fund|repo|bugs|docs|home|help(-search)?)\\b/' : true ,
252+ '/^npm\\s+config\\s+(list|get)\\b/' : true ,
253+ '/^npm\\s+pkg\\s+get\\b/' : true ,
254+ '/^npm\\s+audit$/' : true ,
255+ '/^npm\\s+cache\\s+verify\\b/' : true ,
256+
257+ // yarn read-only commands
258+ '/^yarn\\s+(list|outdated|info|why|bin|help|versions)\\b/' : true ,
259+ '/^yarn\\s+licenses\\b/' : true ,
260+ '/^yarn\\s+audit\\b(?!.*\\bfix\\b)/' : true ,
261+ '/^yarn\\s+config\\s+(list|get)\\b/' : true ,
262+ '/^yarn\\s+cache\\s+dir\\b/' : true ,
263+
264+ // pnpm read-only commands
265+ '/^pnpm\\s+(ls|list|outdated|why|root|bin|doctor)\\b/' : true ,
266+ '/^pnpm\\s+licenses\\b/' : true ,
267+ '/^pnpm\\s+audit\\b(?!.*\\bfix\\b)/' : true ,
268+ '/^pnpm\\s+config\\s+(list|get)\\b/' : true ,
269+
270+ // Safe lockfile-only installs since we trust the workspace and lock file is trusted.
271+ 'npm ci' : true ,
272+ '/^yarn\\s+install\\s+--frozen-lockfile\\b/' : true ,
273+ '/^pnpm\\s+install\\s+--frozen-lockfile\\b/' : true ,
274+
275+ // #endregion
276+
246277 // #region Safe + disabled args
247278 //
248279 // Commands that are generally allowed with special cases we block. Note that shell
@@ -352,6 +383,7 @@ export const terminalChatAgentToolsConfiguration: IStringDictionary<IConfigurati
352383 eval : false ,
353384 'Invoke-Expression' : false ,
354385 iex : false ,
386+
355387 // #endregion
356388 } satisfies Record < string , boolean | { approve : boolean ; matchCommandLine ?: boolean } > ,
357389 } ,
0 commit comments