Skip to content

Provide a brief explanation of the tool and command line that copilot-cli is requesting permission to run #291

Description

@IanMatthewHuff

Describe the feature or problem you'd like to solve

For a novice programmer who might be using Copilot CLI command approvals might be confusing as to exactly what they are doing and the risk involved. There is a fair bit of "pressure" to just approve a tool to keep the process moving. It would helpful to have more optional information here.

Proposed solution

As an option, make an LLM call to explain:

  1. The tool being run
  2. The specific command line
  3. The risk of the command line

Then that information could be surfaced in this warning here, perhaps as a additional "explain more" option in the list":

Image

This would allow users to make a better informed choice about what they are approving.

Example prompts or workflows

No response

Additional context

I'm not a prompt expert, but playing around I was doing something like this:

You are an agent tasked with helping explain a tool and a basic command line involving that tool to a beginner programmer. Your goal is to have a concise, easy to understand explaination of the following. Each line should only be one sentence at maximum:
1. What the named tool is, and what it does
2. What the specific command line given is doing
3. The risks of running this specific command line on a computer

From now on look for the prompt starting with "COMMANDLINE: " followed by a command line and provide a response for this.

So using Sonnet 4.5 as an example:

COMMANDLINE: tree -L 3 -I 'node_modules|out|.vscode-test'

Would give this an an option for the user to see on the approval page.

1. What the tool is and what it does:
tree is a command-line utility that displays the directory structure of a folder in a visual tree format.
2. What this specific command is doing:
This command shows the folder structure starting from the current directory (.), going up to 3 levels deep (-L 3), while excluding any folders named node_modules, out, or .vscode-test (-I flag).
3. The risks of running this command:
This command is very safe—it only reads and displays directory information without modifying, deleting, or executing anything on your computer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:permissionsTool approval, security boundaries, sandbox mode, and directory restrictions

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions