github / github/copilot-cli

Allow copilot-cli to write via tool to only specific files

Open
#285 0 comments 7 reactions 0 assignees View on GitHub
area:permissions area:tools
Dominant language
Shell
Stars
11.2k
Forks
1.9k
Avg merge
14h 16m
Merged PRs (30d)
6

Description

### Describe the feature or problem you'd like to solve

When the copilot write tool option is allowed it gives access to all files

### Proposed solution

Allow to restrict the scope the model is allowed to write to, for example with directories or files
```bash
copilot --allow-tool 'write(foo.txt)' --allow-tool 'write(bar/)'
```

This is similar to the shell tool option that is already supported https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli#using-the-approval-options
```
copilot --deny-tool 'shell(git push)'
```

### Example prompts or workflows

```bash
copilot --allow-tool 'write(foo.txt)' --allow-tool 'write(bar/)'
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.