Skip to content

Add launch flag to bypass trust folder prompt #2866

Closed

Description

@DamianEdwards

When automating copilot CLI from scripts it would be very helpful to have a way to opt-in to trusting the folder via a launch flag so that the folder doesn't first have to be trusted via an interactive session and answering the prompt manually, or by directly editing the ~\.copilot\config.json file.

I'm imagining something like:

$ copilot --trust-folder --allow-all-tools

Related #1121

Activity

  1. added
    area:permissionsTool approval, security boundaries, sandbox mode, and directory restrictions
    area:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automation
    on Apr 21, 2026
  2. added theissue type on Apr 21, 2026
  3. danmoseley commented on Apr 22, 2026

    @danmoseley

    @DamianEdwards to be clear then if this flag just edited copilot config.json (and also applied to the session you're starting) that would work for you? ie., you want persistent.

  4. DamianEdwards commented on Apr 22, 2026

    @DamianEdwards
    Author

    I wouldn't expect it to be persistent honestly. I expect flags to only apply to the current session I think? But not sure how strongly I feel about that.

  5. danmoseley commented on Apr 22, 2026

    @danmoseley

    Ah gotcha. Yes, seems like a clear omission of a flag matching the user prompt. I agree with not persistent.

    There is no concept of per-path trust I see, so --trust-path meaning cwd makes sense. Also I think --trust-path rather than --trust-folder even though it's "trustedFolders" in the config file, as that's consistent with --allow-all-paths and paths is more the non Windows term.

    Unrelated to trust, but I notice that for some reason we are missing --allow-path. And there are no --always-allow-* variants currently.

  6. danmoseley commented on Apr 22, 2026

    @danmoseley

    In normal interactive mode if you later /cwd it will pop the question again. I think it's OK for --trust-path to just handle the initial cwd, can always be made laxer later.

  7. danmoseley commented on Apr 22, 2026

    @danmoseley

    I put up a PR

  8. patniko commented on Oct 26, 2026

    @patniko
    Collaborator

    Thanks for the suggestion. Copilot CLI v1.0.100 adds --trust-folder, which trusts the current folder for a single prompt-mode run (-p or piped stdin) without showing the trust prompt and without saving the folder to your trusted folders, matching the non-persistent behavior discussed above (for example, copilot --trust-folder --allow-all-tools -p "..."). If it doesn't cover your automation scenario on the latest version, feel free to reopen.

    Triaged as part of a Copilot SDK backlog review, with help from GitHub Copilot.

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:non-interactiveNon-interactive mode (-p), CI/CD, ACP protocol, and headless automationarea:permissionsTool approval, security boundaries, sandbox mode, and directory restrictions

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions