Skip to content

ChatAllowedMcpServers enterprise policy is not enforced for agent-host (delegated) chat sessions #328241

Agent suggestions

Public preview

Description

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

  1. Apply the policy above so only the one approved serverCommand is allowed.
  2. Add a second, non-approved MCP server to mcp.json (any other stdio command,
    or a marketplace-installed MCP server).
  3. 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").
  4. Switch the same session to the delegated agent-host runtime (the
    "Local" → Copilot session toggle; the agent-host integration from MCP server integration for agent-host sessions #320854).
  5. 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.

Related

Activity

  1. vs-code-engineering commented on Jul 30, 2026

    @vs-code-engineering
    Contributor

    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!

  2. yanivt-jfrog commented on Jul 31, 2026

    @yanivt-jfrog
    Author

    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.

  3. removed their assignment
    on Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions