Skip to content

Sandbox won't let copilot use git anymore #4524

Description

@logar16

Describe the bug

Just got the latest version of enforced-sandbox copilot and it turns out it's super broken and overly restrictive. I enabled my entire working directory and ~/.copilot because agents no longer had a way to share information across sessions. Then I found that even though it could now read the files it couldn't even run git status. I checked and the /cwd is the git repo but when it runs git status it gets a "fatal: not a git repository (or any of the parent directories): .git" error.

Image

I can't even do it by ! git status in shell mode as I get the same. If it uses git -C <repo> status it does a slightly different error of "fatal: Unable to read current working directory: Permission denied".

I ran ! pwd and see that it's C:\ which of course is not a great place to add to your policy if you want to keep the pc safe. So can we not have powershell run in the allowed directory? This seems like the logical thing to do instead of starting at root and failing all git commands.

Affected version

1.0.81-1

Steps to reproduce the behavior

  1. Get forced into sandboxing via enterprise managed systems
  2. Ask the agent to do a git command like git status (fails)
  3. Run Shell Get-Item 'path/to/.git' where path is on not C:/ and it fails saying "Get-Item: Cannot find drive. A drive with the name 'E' does not exist."

Expected behavior

I was expecting it wouldn't fail to do such a simple command. It doesn't if I do the exact same command outside of copilot. It worked before the update.

Additional context

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:permissionsTool approval, security boundaries, sandbox mode, and directory restrictionsarea:platform-windowsWindows-specific: PowerShell, cmd, Git Bash, WSL, Windows Terminal

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions