Skip to content

Copilot constantly nags about "parent directory" access when it's clearly in a subfolder of the project directory #4601

Description

@jovere

Describe the bug

When using Claude Opus, it will occasionally cd into a lower directory and then access a sibling directory using the relative parent directory shortcut (..). This will inevitably be flagged by Copilot CLI as going outside of the project directory, which is clearly incorrect. Rather than assuming .. is going out of the project directory, Copilot CLI should be getting the absolute directory and checking that.

Affected version

Copilot v1.0.80

Steps to reproduce the behavior

Example issue:

  1. Start Copilot CLI in /work.
  2. Ask Claude to review code with a deep directory structure.
  3. Claude will use something like the following command: cd subfolder/subfolder3/subfolder5 && grep -rn "searching for text" ../subfolder4
  4. The CLI incorrectly "warns" me that it's accessing a directory outside my workspace. And then wants me to add ../subfolder4 to my "allowed" directories, which is not secure. If it was added to the "allowed" directories, it actually could do it at the top level.

Expected behavior

The CLI should be converting relative addressing to absolute addressing and checking the full path.

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions