You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add launch flag to bypass trust folder prompt #2866
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.
@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.
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.
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.
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.
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.
Activity
danmoseley commentedon Apr 22, 2026
@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.
DamianEdwards commentedon Apr 22, 2026
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.
danmoseley commentedon Apr 22, 2026
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-pathmeaning cwd makes sense. Also I think--trust-pathrather than--trust-foldereven though it's"trustedFolders"in the config file, as that's consistent with--allow-all-pathsand 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.danmoseley commentedon Apr 22, 2026
In normal interactive mode if you later
/cwdit will pop the question again. I think it's OK for--trust-pathto just handle the initial cwd, can always be made laxer later.danmoseley commentedon Apr 22, 2026
I put up a PR
patniko commentedon Oct 26, 2026
Thanks for the suggestion. Copilot CLI v1.0.100 adds
--trust-folder, which trusts the current folder for a single prompt-mode run (-por 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.