github / github/copilot-cli

Directories listed in allowed_directories in ~/.copilot/permissions-config.json do not suppress the "path outside your allowed directory list" prompt for shell commands.

Open
#4,482 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:configuration area:permissions
Dominant language
Shell
Stars
11.2k
Forks
1.9k
Avg merge
14h 16m
Merged PRs (30d)
6

Description

Describe the bug

Directories listed in allowed_directories in ~/.copilot/permissions-config.json do not suppress the "path outside your allowed directory list" prompt for shell commands. /add-dir with the identical path fixes it for the session.

Startup log says it loaded:
[INFO] permissions::api_orchestrator] Applied persisted allowed directories {"count":2,"location_key":"..."} 
Probable cause: in app.js, addAdditionalDirectory() is only called inside the paths.add handler. hydrate_location_permission_directories applies persisted dirs to the native permission service but never performs that sync, so the path gate used for shell commands doesn't see them.
Secondary: the prompt's "Yes, and add these directories to the allowed list" option maps to {kind:"approve-for-session"} — the wording implies persistence it doesn't have.

Affected version

GitHub Copilot CLI 1.0.79.

Steps to reproduce the behavior

Repro: add an absolute dir to allowed_directories under a location key; start a session whose git root is that key; run a shell command reading a file under that dir → prompt appears. Run /add-dir  → no more prompts.

Expected behavior

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in app.js, comparing addAdditionalDirectory() in the paths.add handler with hydrate_location_permission_directories and the persisted-directory startup path. Reproduce with an absolute allowed_directories entry, then run a shell command reading a file under it. Done means persisted directories suppress the path prompt like /add-dir, and the prompt wording accurately reflects session-only approval.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, shell
Domain
cli, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.