Repository navigation
Description
- Copilot Chat Extension Version:
0.59.0 - VS Code Version: latest
main, commitdd862885ff5fbd279747c793e18105e6b7ddc805 - OS Version: Windows 11
10.0.26200build26200 - Feature: Agent mode, workspace skills, ReadFile tool
- Selected model: No live model is required for the deterministic test
- Logs: Local unit-test output only; no production service was contacted
Summary
A workspace skill description is inserted into the XML-like chat customizations index without structural escaping. The generated text is later parsed back into instruction and skill file sets used by the external-file ReadFile confirmation logic.
As a result, delimiter characters in workspace-controlled skill metadata can alter the generated index structure and cause an outside-workspace URI to be classified as an instruction file. ReadFile then omits the confirmation that the safe control receives.
Steps to Reproduce
- Check out commit
dd862885ff5fbd279747c793e18105e6b7ddc805. - Create a workspace
SKILL.mdwhose valid frontmatter description contains XML delimiter characters that terminate the generated description element and introduce a synthetic instruction/file record. - Build the customizations index through
AutomaticInstructionsCollector. - Parse the generated index through
CustomInstructionsService.parseInstructionIndexFile. - Prepare a ReadFile invocation for the synthetic outside-workspace URI.
- Compare it with an otherwise identical control using a normal skill description.
Local deterministic test result on latest main:
Test Files 1 passed (1)
Tests 1 passed (1)
The control produced confirmation messages. The structurally altered index did not.
Expected Behavior
Workspace-controlled skill names, descriptions, and paths should be encoded as data and must not be able to add records to the generated customization index or influence external-file authorization.
Actual Behavior
The skill description is interpolated as markup. The later index parser accepts the additional structure, and the resulting URI is treated as an external instruction file for which ReadFile confirmation is not shown.
Relevant Source
extensions/copilot/src/platform/promptFiles/node/automaticInstructionsCollector.ts:497-504constructs the skill entry and interpolatesskill.description.extensions/copilot/src/platform/customInstructions/common/customInstructionsService.ts:501-585parses the model-facing text back into instruction and skill URI sets.extensions/copilot/src/extension/tools/node/toolUtils.ts:217-233exempts URIs present in those parsed sets from the normal outside-workspace rejection.extensions/copilot/src/extension/tools/node/readFileTool.tsx:207-244prepares the ReadFile confirmation.
Impact and Scope
This is a confirmation/security-boundary consistency issue. It can cause a file outside the workspace to be returned to the configured model without the expected external-file confirmation.
The reproduced behavior requires the outer Copilot/workspace-trust requirements and an agent ReadFile request for the affected path. The test does not demonstrate command execution or direct exfiltration to a workspace-controlled server.
Suggested Fix
- Escape every dynamic field before including it in the model-facing XML-like representation.
- Prefer a structured, non-text authorization object rather than reparsing prompt text.
- Do not derive external-file authorization from a representation containing workspace-controlled display metadata.
- Add a regression test with delimiter characters in skill metadata and assert that the safe and adversarial cases both require confirmation for the same outside-workspace URI.
Existing-Issue Review
I searched issues and pull requests in microsoft/vscode and microsoft/vscode-copilot-release using the relevant class names, parser names, external-file confirmation terminology, and skill-description wording.
Adjacent issues #292297, #295643, and #305168 concern legitimate skill files incorrectly receiving confirmation or being inaccessible. They do not describe workspace metadata altering the customization-index structure or suppressing confirmation. Issue #301966 concerns losing the index during context compaction.
Activity
vs-code-engineering commentedon Jul 25, 2026
Thanks for creating this issue! It looks like you may be using an old version of VS Code; the latest stable release is 1.130.0. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!