Model Context Protocol Security: Enterprise Guardrails

Updated

10 min read

Isometric illustration of an arched stone gateway with dark wooden doors and a brass key on a step, representing guarded access to enterprise tools
In this article
  1. What Model Context Protocol security covers
  2. Authentication: tokens must be issued for the MCP server
  3. Token passthrough and the confused deputy problem
  4. Tool-calling guardrails: confirmation, validation and annotations
  5. Local servers, vendor controls and workspace trust
  6. Two advisories that show the stakes
  7. Enterprise checklist for MCP servers
  8. Which to pick first
  9. Frequently asked questions
  10. Is an MCP server required to support OAuth?
  11. What is the difference between token passthrough and a confused deputy?
  12. Does lockdown mode stop prompt injection?
  13. Should a team allow a tool to skip confirmation?

Model Context Protocol security decides what an AI client may reach, which token it presents, what the server may do with that token, and whether a person confirms each action. The MCP specification writes most of these rules as MUST and SHOULD requirements, so an enterprise team can audit a deployment against text instead of against a vendor’s claims. This article reads the 2025-11-25 specification, the MCP security best practices page, three vendor security documents and two advisories confirmed in the National Vulnerability Database.

What Model Context Protocol security covers

Model Context Protocol security covers four layers: the authorization between client and server, the token the server accepts, the rules for calling tools, and the risk of running a server on a workstation. Each layer has written requirements, so each can be checked on its own.

A gap in one layer is not repaired by a strong control in another.

The stakes come from what a server exposes. The specification describes three kinds of server features: resources, which are data the model can read; tools, which are functions the model can call to act; and prompts, which are templates. Tools are where a weak control turns into an action in a database, a ticketing system or a cloud account. The table below lists the requirements this article returns to, with the source for each.

LayerRequirementLevelSource
AuthorizationClient names the target server in the resource parameter of the authorization and token requests (RFC 8707)MUSTMCP specification 2025-11-25, Authorization
Token acceptanceServer accepts only tokens valid for its own resources and does not accept or transit any other tokenMUST and MUST NOTMCP specification 2025-11-25, Authorization
Token passthroughServer does not accept any token not explicitly issued for the MCP serverMUST NOTMCP Security Best Practices
ConsentProxy servers implement per-client consent before the third-party authorization flowMUSTMCP Security Best Practices
Tool input and outputServer validates tool inputs, applies access control, rate-limits calls and sanitizes outputsMUSTMCP specification 2025-11-25, Tools
ConfirmationHuman in the loop with the ability to deny a tool invocationSHOULDMCP specification 2025-11-25, Tools
Tool annotationsClients treat annotations as untrusted unless they come from a trusted serverMUSTMCP specification 2025-11-25, Tools

Authentication: tokens must be issued for the MCP server

MCP authentication follows OAuth. The client names the target server in the resource parameter, and the server accepts only tokens issued for its own resource. A token minted for another API is rejected, not forwarded, and the check happens at the server before any tool runs.

The specification sets the error codes: 401 when authorization is required or the token is invalid, 403 when the scopes are wrong or the permissions are insufficient, and 400 for a malformed request.

Microsoft’s API Management documentation shows the same pattern at a gateway. Inbound requests can carry a subscription key in the Ocp-Apim-Subscription-Key header, or an OAuth token from Microsoft Entra ID that is checked with the validate-azure-ad-token policy. That policy returns HTTP 401 when the token is missing or invalid. The documentation presents both options, and the token option is the one that carries the identity provider’s checks into the gateway.

Audience checks are the control that stops a token from one service being replayed against another. Each server should run the check on every request. The harder part is inventory: teams need to know which token each server accepts, which resource URI it expects, and which identity provider issues the token.

Token passthrough and the confused deputy problem

Token passthrough happens when an MCP server accepts a client’s token without checking that it was issued to the server, then forwards it downstream. The MCP guidance calls this an anti-pattern and says servers MUST NOT accept such tokens. The confused deputy problem is the related risk for proxy servers.

The downstream API may trust the token as if the MCP server had validated it, and an attacker who obtains a token for another service can reuse it.

The confused deputy problem is the related risk for proxy servers. An MCP proxy that calls a third-party API with a static client ID can be used by an attacker to obtain an authorization code without the user’s consent, when the proxy’s consent cookie is set too early. The guidance requires per-client consent storage, and it says the consent cookie or state must not be set until the user has approved the consent screen on the MCP server. It also asks for single-use state values with a short expiry, and gives ten minutes as an example.

Azure API Management documents a case that needs care. The gateway can forward the incoming Authorization header to a backend. That is convenient for backends that read the caller’s identity, but it is the pattern the MCP guidance warns about when the header is the client’s token. The safer design uses a separate outbound credential. API Management’s credential manager can inject an OAuth 2.0 token for the backend calls that the tools make, so the client token stays at the gateway.

Tool-calling guardrails: confirmation, validation and annotations

A tool call is where a model’s output becomes an action on a system. The specification asks servers to validate inputs, enforce access control, rate-limit calls and sanitize outputs. It also says a human SHOULD always be able to deny a tool invocation.

On the client side, the specification asks for user confirmation on sensitive operations, display of tool inputs before the call, validation of results before they reach the model, timeouts and logging of tool use.

Tool annotations need the same caution. Annotations are metadata that a server attaches to a tool. The specification says clients MUST consider annotations untrusted unless they come from trusted servers. An enterprise policy should not allow a tool to skip confirmation because its own annotation says it is safe. The decision should come from the tool’s permissions and the client’s policy.

Input validation matters because tool arguments can come from untrusted text. A tool that accepts a free-text query and passes it into a shell, a SQL statement or a URL needs the same checks as any public API. The specification places the duty to validate on the server, so the server team owns it.

Local servers, vendor controls and workspace trust

A local MCP server runs on the user’s machine, so a malicious startup command, a payload inside the server, or another local process can reach the workstation. Vendor controls narrow that access, from GitHub’s read-only mode to Claude Code’s workspace trust.

The MCP best practices page names these risks. Without sandboxing and consent, the server has the same access as the user. An enterprise should treat each local server as software that needs an owner, a version and a review.

Vendor controls narrow that access. The GitHub MCP server offers a read-only mode with the --read-only flag, which skips every write tool, even one named in the --tools list. Its toolsets work as an allow-list, so a team can expose only the groups it needs. GitHub’s lockdown mode filters content from public repositories when the author has no push access. GitHub describes lockdown as a best-effort content filter, not an authorization boundary, because it does not change what the credential can read or write.

Anthropic’s Claude Code documentation makes the same point about trust. Users are asked to verify each server before they connect it, and servers that fetch external content can expose the user to prompt injection. Approvals for project servers are read only from settings files that are not checked into the repository until the workspace is trusted through the trust dialog. A cloned repository therefore cannot approve its own servers.

Two advisories that show the stakes

Two critical advisories show what happens when a client trusts a server too easily. CVE-2025-6514 allows OS command injection in mcp-remote, and CVE-2025-49596 allows remote code execution in MCP Inspector below 0.14.1. NIST scores them 9.6 and 9.4, both critical.

CVE-2025-6514 is triggered when a client connects to an untrusted MCP server, through crafted input in the authorization endpoint response URL (CVSS v3.1 base score 9.6). CVE-2025-49596 exists because the Inspector client and its proxy do not authenticate each other, so unauthenticated requests can launch MCP commands over stdio (CVSS v4.0 base score 9.4).

Both records were checked in the NVD on 2026-11-25. The NVD record for CVE-2025-6514 does not name a fixed version, so this article gives none. The lesson is the same for both: the developer tool and the client both need a trust decision before they connect to a server, and a debugging proxy must not accept commands from any unauthenticated caller.

Enterprise checklist for MCP servers

Before an MCP server goes into production, the team should be able to answer yes to each item below. The list follows the specification and the vendor documents in this article. It is a working checklist for engineering and security reviews, not a compliance statement.

  • Inventory: every MCP server has a named owner, a version, a transport (local or remote) and the list of tools it exposes.
  • Resource URI: the client sends the canonical URI of the server in the resource parameter, and the server documents it.
  • Audience check: the server rejects any token not issued for it, and returns 401 or 403 as the specification sets.
  • No passthrough: the client token is never forwarded to a downstream API. Backend calls use a separate outbound credential.
  • Consent: any proxy to a third-party API keeps per-client consent, and the state value is single-use with a short expiry.
  • Confirmation: sensitive tools need a person to approve the call, and the approval screen shows the tool inputs.
  • Least privilege: the server exposes only the toolsets it needs, and a read-only mode is used where writes are not required.
  • Annotations: the policy does not rely on tool annotations from untrusted servers to skip a check.
  • Local servers: each one runs under a sandbox or a restricted account, and workspace trust is checked before project servers are approved.
  • Patch level: each MCP tool, inspector and bridge is on a version that includes the fix for the advisories it is affected by.
  • Logs: tool calls and their inputs are logged for audit, and the logs are reviewed when a tool behaves unexpectedly.

Which to pick first

My pick for the first control is the audience check on each server, because every other control depends on which identity reaches the tool. Without it, a token issued for one system can open another, and a confirmation prompt does not catch that.

For a team with one remote server behind an identity provider, the order is audience check, then confirmation for write tools, then logging. For a team that runs many local servers from different sources, the order changes: inventory, workspace trust and sandboxing come first, because a compromised local server reaches the workstation directly. For a team that builds a proxy to a third-party API, consent and the state handling come before anything else, since the confused deputy risk sits in the proxy itself.

Frequently asked questions

Four questions come up most often in enterprise reviews: whether OAuth is required, how passthrough differs from a confused deputy, whether lockdown mode stops injection, and when a tool may skip confirmation. The short answers follow, and each one is tied to the text read on 2026-11-25.

Is an MCP server required to support OAuth?

The 2025-11-25 authorization section sets OAuth-based rules for clients and servers that use it, including the resource parameter and the rule that servers accept only tokens valid for their own resources. The specification does not settle every deployment, so a team that runs a server without OAuth should still apply the same audience and confirmation rules at its gateway.

What is the difference between token passthrough and a confused deputy?

Token passthrough is a server accepting and forwarding a token that was not issued to it. The confused deputy problem is a proxy using its own authority to act for a user who has not consented, usually through a static client ID and a consent cookie that was set too early.

Does lockdown mode stop prompt injection?

No. GitHub describes lockdown mode as a best-effort filter that reduces the risk from untrusted repository content. It does not stop every injection, and content withheld by one tool may still be reachable through another tool or through the API.

Should a team allow a tool to skip confirmation?

The specification says there SHOULD always be a human in the loop with the ability to deny a tool invocation. It leaves the rest to the team. Any exception should be written down, and it should not rest on the tool’s own annotations, which the specification says clients must treat as untrusted.

About the author

Equipe Gui Tech

68 articles published

The Gui Tech team researches, verifies and updates every guide with verifiable sources. Enterprise tech, AI and security explained.

All articles

Keep reading