Repository navigation
Description
Describe the feature or problem you'd like to solve
In 1.0.118, the launch prompt of a user extension can save its approval for the current directory or, inside a git repository, for that repository, but not for all directories.
The prompt Launch extension "user:probe"? offers three choices: Yes, Yes, and always allow "user:probe" in this directory (<path>), and No (Esc).
The second choice adds {"kind": "extension-permission-access", "extensionName": "user:probe"} to permissions-config.json in the Copilot home (~/.copilot by default), under locations["<path>"].tool_approvals, where <path> is the working directory. Entries in that file apply as follows:
- Outside a git repository, a new session shows the prompt again in each other directory tested: a subdirectory, the parent directory, and a sibling directory.
- Inside a git repository, the second choice ends with
in this repo (<root>)and saves under the repository root<root>. New sessions in other directories with that repository root then start the extension without the prompt. A new session shows the prompt again in each other place tested: a directory outside the repository, another repository, and a repository nested in the approved one. - Entries added by hand for ancestor directories, including
/, did not apply to a subdirectory. Entries with glob patterns such as/**did not apply either, and the CLI removed them from the file.
Proposed solution
Add a way to approve a user extension's launch for all directories. For example, the launch prompt could offer a fourth choice saving a user-level approval.
A user extension is installed once and is available in every directory, so a per-location answer repeats one decision.
The 1.0.118 package has a precedent: Its API schema (schemas/api.schema.json) describes experimental methods for user-scoped approvals of plugin extensions, under permissions.extensionApprovals.
Example prompts or workflows
I keep one directory per task, each outside any git repository. I have three user extensions, and today a new session in a new task directory shows three launch prompts. With a user-level approval, I would answer each prompt only once. Sessions in later task directories would then start without the prompts.
Additional context
Measured with Copilot CLI 1.0.118 on Linux x86-64. COPILOT_HOME was a temporary directory with a config.json trusting the test folders, and each run used --experimental --no-auto-update. The extension was extensions/probe/extension.mjs in that directory:
import { joinSession } from "@microsoft/copilot-sdk/extension";
await joinSession({});In the same setup, passing --allow-tool='extension-permission-access(user:probe)' skips the prompt and starts the extension in a directory without a saved approval. --allow-tool='extension-launch(user:probe)' has the same effect. copilot help permissions does not list either rule kind. It says that --allow-tool rules last for one run.
Related: #5575 reports that an entry for a parent folder does not approve a marketplace plugin's extension in subfolders, and asks for pre-approval by managed policy. #2398 asks for a default permissions file, and #5539 asks for user-level read access.
Activity