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
ChatAllowedMcpServers enterprise policy is not enforced for agent-host (delegated) chat sessions #328241
TL;DR (admin/user): Existing editor MCP allow/deny policies may not constrain servers used through Agent Host.
Does this issue occur when all extensions are disabled?:No
VS Code Version: 1.130.0
OS Version: macOS 15
Bug - enterprise policy / MCP governance
The ChatAllowedMcpServers policy (added in #326226) is deployed via managed
settings (macOS configuration profile / Windows registry) with a single allowed
stdio command, e.g.:
"ChatAllowedMcpServers": [
{ "serverCommand": ["npx", "--yes", "my-approved-mcp-server"] }
]
Confirmed applied via Developer: Policy Diagnostics (shows the resolved value)
and it behaves correctly for the built-in agent.
Steps to reproduce
Apply the policy above so only the one approved serverCommand is allowed.
Add a second, non-approved MCP server to mcp.json (any other stdio command,
or a marketplace-installed MCP server).
In a chat session using the local agent, ask the model to call a tool
from the non-approved server.
→ Correctly blocked: the server never connects and the tool call is
rejected ("blocked by policy").
Ask for the same tool call again. Expected
The ChatAllowedMcpServers allowlist should apply regardless of which runtime
executes the session. The non-approved server should be blocked in the
agent-host session exactly as it is in the local agent. Actual
In the delegated agent-host session the non-approved MCP server connects and
its tools are fully callable - the allowlist is not consulted. MCP: List Servers for the agent-host session shows the non-approved server as Running.
Removing the policy makes no difference; re-selecting the local agent blocks it
again.
Impact
ChatAllowedMcpServers is an enterprise security control. Any user can
bypass it - and run an otherwise-blocked MCP server - with a single click that
delegates the session to the agent host. Administrators have no way to detect or
prevent this from the policy artifacts themselves.
Thanks for creating this issue! It looks like you may be using an old version of VS Code; the latest stable release is 1.131.0. Please try upgrading to the latest version and checking whether this issue remains.
joshspicer
Confirmed also on 1.131.0 (macOS 15). The bypass also affects type: http MCP servers, not only stdio.
Repro:
Policy ChatAllowedMcpServers allow-lists only ["npx","--yes","--registry","..."].
mcp.json contains "deepwiki": { "type": "http", "url": "https://mcp.deepwiki.com/mcp" }.
Local agent: deepwiki is blocked (does not connect). Delegated agent-host session (Copilot): deepwiki connects, and read_wiki_structure returns a full response.
Developer: Policy Diagnostics shows the policy is applied.
Activity
vs-code-engineering commentedon Jul 30, 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.131.0. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
yanivt-jfrog commentedon Jul 31, 2026
joshspicer
Confirmed also on 1.131.0 (macOS 15). The bypass also affects type: http MCP servers, not only stdio.
Repro:
Policy ChatAllowedMcpServers allow-lists only ["npx","--yes","--registry","..."].
mcp.json contains "deepwiki": { "type": "http", "url": "https://mcp.deepwiki.com/mcp" }.
Local agent: deepwiki is blocked (does not connect).
Delegated agent-host session (Copilot): deepwiki connects, and read_wiki_structure returns a full response.
Developer: Policy Diagnostics shows the policy is applied.
Document device policy gaps in Copilot harness sessions (#10491)