Repository navigation
Agent Host: stop delivering standalone customizations as plugin content - #340079
Anthony Kim (anthonykim1) merged 2 commits into
Conversation
VS Code bundled forwarded user and workspace skills and agents, and the MCP servers it forwards, into the synthetic "VS Code Synced Data" plugin. The Copilot Agent Host passed that bundle in `pluginDirectories`, so the runtime treated everything inside as plugin content and `strictPluginOnlyCustomization`, including its array form, skipped it. Bundle those items separately and mark the bundle as standalone. The host passes them through the SDK's `skillDirectories`, `customAgents`, and session `mcpServers`, so the runtime applies its own lockdown to them. Extension and built-in skills and agents, instructions, and prompt files stay in the synced plugin.
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Security-sensitive runtime lockdown enforcement remains unverified beyond mocked SDK routing tests.
Review effort: Balanced
Findings: 1
What changed in this PR
Separates forwarded standalone customizations from plugin content so Copilot Agent Host can delegate lockdown enforcement to the runtime.
Changes:
- Adds a separate, marked bundle for standalone customizations.
- Routes marked content through non-plugin SDK options while preserving trusted resource reads.
- Updates routing tests and policy documentation.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/test/browser/agentSessions/syncedCustomizationBundler.test.ts |
Tests standalone bundle metadata. |
src/vs/workbench/contrib/chat/test/browser/agentSessions/resolveCustomizationRefs.test.ts |
Tests split customization routing. |
src/vs/workbench/contrib/chat/common/plugins/AGENTS_PLUGINS.md |
Documents standalone delivery. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.ts |
Adds standalone bundle support. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.ts |
Separates standalone files and forwarded MCP servers. |
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.ts |
Manages both bundlers and their lookups. |
src/vs/platform/agentHost/test/node/copilotAgent.test.ts |
Tests projected SDK options. |
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts |
Preserves trusted bundle reads. |
src/vs/platform/agentHost/node/copilot/copilotAgent.ts |
Removes standalone bundles from plugin-directory delivery. |
src/vs/platform/agentHost/common/meta/vscode/clientPluginCustomizationMeta.ts |
Adds standalone marker helpers. |
src/vs/platform/agentHost/common/meta/clientPluginCustomizationMeta.ts |
Exports marker helpers. |
src/vs/platform/agentHost/common/agentHostPolicySupport.ts |
Clarifies partial-policy support comments. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Verified on macOS 26.7 arm64 with Code OSS Dev 1.142.0, comparing Setup: Results:
Screenshots are collapsed. Click a section below to expand it. Runtime policy: the lockdown reached the runtimeThe runtime's server layer has Before (without this PR, lockdown on): bad, the configured skill still loads
After (with this PR, lockdown on): good, the configured skill and agent are blocked
Control (with this PR, lockdown off): good, forwarded items still reach the runtime
Control (without this PR, lockdown off): the MCP server works, but the agent isn't available
The test build reused |
Addresses review thread #340079 (comment). The unit test only checked SDK routing. This host-only E2E test serves strictPluginOnlyCustomization ["skills", "agents", "mcp"] to the bundled runtime and reads its /env report: a standalone skill and MCP server are blocked while a plugin skill still loads, and both return once the policy is removed.









Part of: https://github.com/microsoft/vscode-internalbacklog/issues/8826
TL;DR: VS Code bundles the skills, agents, and MCP servers it forwards into a synthetic "VS Code Synced Data" plugin (
SyncedCustomizationBundler), and the Agent Host passes it inpluginDirectories. The runtime loads those skills as plugin skills, so theskillslockdown skipped them. Forwarded MCP servers were already registered through session config, and bundled agents weren't exposed. Fix: send user/workspace skills and agents, and all forwarded MCP servers, throughskillDirectories,customAgents, andmcpServers, so the runtime filters them itself. Extension and built-in skills and agents stay in the synced plugin.Current flow
resolveCustomizationRefsbundles loose skills, agents, instructions, prompt files, and forwarded MCP servers into "VS Code Synced Data".pluginDirectories.skillslock doesn't apply. MCP servers already go through session config, and agents in the bundle aren't exposed.New flow
_metavscode.standaloneCustomizations: true.pluginDir, so skills go throughskillDirectories, agents throughcustomAgents, and MCP servers through sessionmcpServers, where the runtime applies the lockdown.resourceDirkeeps reads of its files auto-approved.Not in this PR
Risks
customAgentsconverter carries name, description, model, reasoning effort, tools, skills,infer, and the prompt; other agent frontmatter is dropped.customAgentsand session-config MCP servers, so moved agents and MCP servers don't reach them.How to test
Manual before/after verification with screenshots: #340079 (comment)
{"strictPluginOnlyCustomization": ["skills", "agents", "mcp"]}through the mock policy server (.github/skills/policy-and-managed-settings/local-testing.md).chat.agentSkillsLocationsandchat.agentFilesLocations, add a server to the usermcp.json, and start a Copilot Agent Host session./envshouldn't list the skill or the server, and the model can't run the agent. Without the lockdown, all three work.Automated: the targeted suites pass (93, 1524, and 1878 passing), and ESLint is clean.
npm run typecheck-clientreports no new errors; my localnode_modulesis stale, so CI is the real check.Commands
npm run transpile-client ./scripts/test.sh \ --run src/vs/workbench/contrib/chat/test/browser/agentSessions/resolveCustomizationRefs.test.ts \ --run src/vs/workbench/contrib/chat/test/browser/agentSessions/syncedCustomizationBundler.test.ts ./scripts/test.sh \ --run src/vs/sessions/contrib/providers/agentHost/test/browser/agentHostAutomationStore.test.ts \ --run src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts \ --run src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remoteAgentHostSessionsProvider.test.ts \ --run src/vs/sessions/services/agentHost/test/browser/agentHostCustomizationService.test.ts \ --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts \ --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostClientTools.test.ts \ --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostCustomizationService.test.ts \ --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostUntitledProvisionalSessionService.test.ts \ --run src/vs/workbench/contrib/chat/test/browser/agentSessions/enumerateLocalCustomizationsForHarness.test.ts \ --run src/vs/workbench/contrib/chat/test/browser/agentSessions/workbenchAgentHostCustomizationService.test.ts \ --run src/vs/workbench/contrib/chat/test/browser/aiCustomization/customizationMigrationServiceImpl.test.ts \ --run src/vs/workbench/contrib/chat/test/browser/aiCustomization/customizationsTelemetryService.test.ts ./scripts/test.sh \ --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts \ --run src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts \ --run src/vs/platform/agentHost/test/node/copilotSessionLauncher.test.ts \ --run src/vs/platform/agentHost/test/node/copilotPluginConverters.test.ts \ --run src/vs/platform/agentHost/test/node/claudeAgent.test.ts \ --run src/vs/platform/agentHost/test/node/codex/codexClientCustomizations.test.ts \ --run src/vs/platform/agentHost/test/common/agentMetaReaders.test.ts npx eslint --max-warnings 0 $(git diff --name-only HEAD~1 -- '*.ts') npm run typecheck-clientInspirations from:
_metamarker and its reader follow themcpDefaultCwdsclient plugin meta.pluginsWithoutDirspath intoskillDirectoriesandcustomAgents.resolveCopilotMcpServerInfo.areStandalonePromptFilesBlockedandMcpRegistry.isCollectionAllowed.resourceDirkeeps the read trust from_isReadWithinAppliedPluginDirectory.