Skip to content

allowed_directories in permissions.config is never loaded #4398

Description

@clarkbreyman-yammer

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
  8. cd /opt/test/workspace
  9. run copilot interactively
  10. prompt /list-dirs. Observe that "/opt/test/subject" is not present.
  11. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:configurationConfig files, instruction files, settings, and environment variablesarea: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