Skip to content

Asking copilot to run dotnet build /t:Target results in a prompt for access to directory outside the allowed location #1015

Closed as duplicate

Description

@vitek-karas

Describe the bug

When copilot wants to run dotnet build /t:TestTarget command, the Copilot CLI will prompt the user like this:

 ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
 │ Allow directory access                                                                                             │
 │                                                                                                                    │
 │ Copilot is attempting to read the following path outside your allowed directory list.                              │
 │                                                                                                                    │
 │ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │
 │ │ /t:TestTarget                                                                                                  │ │
 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
 │                                                                                                                    │
 │ Do you want to add these directories to the allowed list?                                                          │
 │                                                                                                                    │
 │ ❯ 1. Yes                                                                                                           │
 │   2. No (Esc)                                                                                                      │
 │                                                                                                                    │
 │ Confirm with number keys or ↑↓ keys and Enter, Cancel with Esc                                                     │
 ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

This is on Windows where such path is non-sense, but even on Linux such path is basically impossible. It also means that the user can't tell the copilot CLI to allow this execution for future executions, requiring prompt every time.

Affected version

0.0.384 Commit: 0b21260

Steps to reproduce the behavior

I prepared a gist https://gist.github.com/vitek-karas/54ffafdc2f0221a22d250974092b84b6 with a simple repro - just move copilot-instructions.md to the .github directory and then prompt copilot "Test the target".

Expected behavior

This is not a path and CLI should treat it as a normal "dotnet build" invocation.

Additional context

Windows, x64, Windows Terminal, powershell
I can provide logs directly (since they contain PII I won't share them in public) - I'm an FTE.

Activity

  1. added theissue type on Jan 17, 2026
  2. dogmatic69 commented on Jan 17, 2026

    @dogmatic69

    duplicate of #884 #884 (comment)

  3. RyanHecht commented on Jan 21, 2026

    @RyanHecht
    Collaborator

    Going to close this as a duplicate of #884 -- this is on the team's radar and we want to improve the path detection heuristics!

  4. RyanHecht commented on Jan 21, 2026

    @RyanHecht
    Collaborator
  5. RyanHecht commented on Jan 21, 2026

    @RyanHecht
    Collaborator

    Sorry, wrong issue: #159 and #67 are more appropriate

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

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions