Skip to content

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

Closed

Description

@avinashpancham

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

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

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

Additional context

No response

Activity

  1. added
    area:permissionsTool approval, security boundaries, sandbox mode, and directory restrictions
    area:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior
    and removed on Apr 16, 2026
  2. copilot-cli-bot commented on Oct 13, 2026

    @copilot-cli-bot

    This appears to be resolved as of GitHub Copilot CLI v1.0.96. Please update to that release or a newer stable version. We're closing this as completed. If it still happens, please comment with your version and reproduction steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:permissionsTool approval, security boundaries, sandbox mode, and directory restrictionsarea:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions