Directories listed in allowed_directories in ~/.copilot/permissions-config.json do not suppress the "path outside your allowed directory list" prompt for shell commands.
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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