Skip to content

Tool calls with slash-prefixed strings (e.g., /azp, /cc) misinterpreted as filesystem paths #1175

Description

@PureWeen

Describe the bug

When using the PowerShell tool to run gh commands that contain strings starting with /, the CLI appears to misinterpret them as filesystem paths and prompts for directory permission.

Steps to reproduce

  1. Try to run a gh pr comment command with a body starting with /:
gh pr comment 33727 --body "/azp run"
  1. The tool call gets rejected with a message suggesting permission was requested for a directory

  2. Similarly happens with /cc @username at the end of an issue body

Expected behavior

The CLI should recognize that /azp run is a string argument to --body, not a filesystem path, and execute the command without permission prompts.

Actual behavior

The tool call is rejected. The user sees a permission prompt that appears to be asking about accessing a /azp or /cc directory.

Environment

  • OS: Windows 11
  • Copilot CLI version: 0.0.397

Additional context

This occurred while trying to:

  1. Create a GitHub issue with /cc @jonathanpeppers at the end of the body
  2. Comment /azp run on a PR to trigger Azure Pipelines

Both cases were rejected, likely because the / prefix was being parsed as a path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:permissionsTool approval, security boundaries, sandbox mode, and directory restrictionsarea:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions