github / github/copilot-cli

allowed_directories in permissions.config is never loaded

Open
#4,398 0 comments 0 reactions 0 assignees View on GitHub
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

I have several directories listed in my permissions-config for various workspaces. They are never loaded. I can run `/list-dirs` and never see them.

```
{
"locations": {
"/workspaces/cbreymdev": {
"allowed_directories": [
"/opt/test",
"/tmp"
]
},
...
```
still results in:

```
Allowed directories for file access:

1. /workspaces/cbreymdev
2. /tmp
3. /home/vscode/.copilot/installed-plugins
```

### Affected version

1.0.79-6

### Steps to reproduce the behavior

1. `sudo mkdir /opt/test`
2. `sudo chmod a+rwx /opt/test`
3. `mkdir /opt/test/workspace`
4. `mkdir /opt/test/subject`
5. `echo "Can you read me?" > /opt/test/subject/file.txt`
6. `jq '.locations += {"/opt/test/workspace": { "allowed_directories": [ "/opt/test/subject"] }}' ~/.copilot/permissions-config.json > /tmp/permissions-config.json`
7. `cp /tmp/permissions-config.json ~/.copilot/permissions-config.json`
9. `cd /opt/test/workspace`
10. run `copilot` interactively
11. prompt `/list-dirs`. Observe that "/opt/test/subject" is not present.
12. prompt "What does /opt/test/subject/file.txt" contain?. Observe a permission prompt.

### Expected behavior

In step 10, the listing should container /opt/test/subject.
In step 11, it should report the contents of /opt/test/subject/file.txt

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing how ~/.copilot/permissions-config.json is loaded when the CLI starts, then follow the data used by /list-dirs. Reproduce the issue with the provided jq configuration and workspace steps. Done means allowed_directories from the active location appear in /list-dirs and permit reading the listed file without an extra permission prompt.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.