Add a CLI flag to temporarily trust a workspace in non-interactive sessions (e.g. --temporarily-trust-workspace)
Personne n'a encore pris cette issue.
- Langage dominant
- Shell
- Étoiles
- 11.2k
- Forks
- 1.9k
- Merge moyen
- 14 h 16 min
- PR mergées (30 j)
- 6
Description
Describe the feature or problem you'd like to solve
Workspace .mcp.json config is only honored once a workspace has been marked "trusted," and the only way to grant that trust today is by starting an interactive session and answering "Yes" to the trust prompt. There is currently no way to trust a workspace from a non-interactive (-p) session, a scripted/CI environment, or any headless context. This was confirmed by a maintainer on #4542: workspace .mcp.json loading was fixed in 1.0.85, but only takes effect if the workspace is already trusted, and there's no CLI-only way to establish that trust. This makes committed, repo-scoped .mcp.json files effectively unusable in automated or headless workflows (CI pipelines, containers, scripted invocations) even though the underlying loading bug is fixed, because there's no non-interactive path to the trust step.
Proposed solution
Add a flag (e.g. --temporarily-trust-workspace, name open to maintainer preference) that grants the current working directory workspace trust for the duration of that single invocation, without requiring the interactive TUI trust prompt.
This would let users and CI systems opt into trusting a specific workspace explicitly and auditably per-invocation, rather than requiring either a persisted trust decision made interactively beforehand, or the --additional-mcp-config workaround that duplicates the already-committed .mcp.json.
Benefits:
- Unblocks CI/automation and headless use of workspace-scoped .mcp.json
- Avoids requiring users to persist trust ahead of time via the interactive flow
- Avoids the --additional-mcp-config duplication workaround
- Keeps trust explicit and scoped to one invocation, rather than silently trusting all workspaces
Example prompts or workflows
-
CI pipeline step:
copilot --temporarily-trust-workspace --allow-all-tools -p "Run the test suite and summarize failures"— using the repo's committed .mcp.json without a prior interactive trust step. -
Docker/headless container: running scripted
copilot -p "..."invocations where no TTY is available to answer the interactive trust prompt. -
One-off automation script that clones a repo, trusts it for a single non-interactive Copilot invocation, and never persists that trust decision to the user's config.
Additional context
#4542
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par retracer comment les sessions non interactives -p gèrent l’invite de confiance du workspace et comment le chargement de workspace .mcp.json dépend de cette confiance ; consultez issue #4542 pour le contexte associé. Le travail est considéré comme terminé lorsqu’un flag documenté accorde la confiance pour une seule invocation, permet de charger la configuration du workspace commitée sans TTY et ne persiste pas la décision de confiance.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- shell
- Domaine
- cli
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Active
- Clarté
- Plutôt claire
- Accessibilité débutants
- 58/100