Security Guide

Model Context Protocol Prompt Security

An MCP prompt is a server-defined template that can be populated with dynamic arguments and returned to a client for use in an LLM interaction. Because MCP servers are often third-party and their prompts and tool descriptions are treated as trusted input by default, unsanitized arguments or malicious server content can manipulate agent behavior, trigger unauthorized tool calls, or expose data. Securing MCP requires validating prompt content, enforcing least-privilege tool scoping, and monitoring tool-call execution at runtime, since the protocol itself does not mandate these controls.

MCP Prompt Security at a Glance

Protocol Primitive

Prompts, tools, and resources are distinct MCP primitives with different trust and execution implications.

Primary Risk

Untrusted server-supplied prompts and tool descriptions can inject instructions into agent context.

Enforcement Point

Security boundaries are enforced by the client implementation, not the protocol specification.

Governance Need

Least-privilege tool scoping, consent workflows, and runtime monitoring reduce exposure.

Where Security Responsibility Sits in the MCP Stack

MCP does not mandate a single security model across transports, so responsibility is distributed across the following layers.

  1. 1

    Client Implementation

    The client is responsible for enforcing trust boundaries, since the MCP specification itself does not require validation of prompt content or tool descriptions before they reach the model.

Controls to Apply Before Production Deployment

  • Validate and sanitize all dynamic arguments before they are inserted into MCP prompt templates.
  • Enforce per-tool, per-invocation consent rather than blanket approval at initial connection.
  • Apply least-privilege scoping so a manipulated prompt cannot trigger tool calls beyond an approved set.
  • Pin approved MCP server tool and prompt definitions and detect changes between sessions.
  • Implement OAuth 2.1-based authorization for remote MCP servers where the transport supports it.
  • Log prompt content and tool-call arguments and results for incident investigation.

What an MCP Prompt Is and Why It Matters

An MCP prompt is a server-defined template that can be populated with dynamic arguments and returned to a client for use in an LLM interaction. Prompts, tools, and resources are distinct primitives within the Model Context Protocol, each carrying different trust and execution implications. Because MCP servers are frequently third-party and their prompt content is treated as trusted input by default, the content returned by a server can shape how an agent behaves without the client necessarily verifying its intent.

How Prompt Injection Manifests in MCP Environments

Prompt injection in MCP shares the same underlying mechanism as traditional LLM prompt injection: untrusted content influencing model instructions. MCP introduces a specific vector for this risk, since server-supplied prompt templates and tool descriptions may be rendered directly into model context without sanitization. Unsanitized dynamic arguments or malicious server content can manipulate agent behavior, trigger unauthorized tool calls, or expose sensitive data if left unchecked.

The Rug Pull Problem and Tool-Call Exposure

A rug pull attack refers to a scenario where an MCP server changes its exposed tool behavior or prompt content after a user has already approved the connection, without triggering a new consent request. This can potentially expand access without the user's knowledge. Because tool descriptions and prompt definitions are not guaranteed to remain static between sessions, clients that rely on a single initial approval are exposed to this class of risk.

Governance Considerations for Enterprise Adoption

MCP does not require authentication by default. It does not mandate a single authentication mechanism across all transports. Remote HTTP-based servers can use OAuth 2.1-based flows where implemented, but local stdio transports and server trust decisions are left to the client implementation. Enterprise adoption therefore depends on governance decisions made at the client and deployment layer rather than guarantees built into the protocol itself.

Evaluation Criteria for Security Teams

Security teams evaluating MCP-connected agent infrastructure should assess how prompt content is validated, how tool consent is managed across sessions, and how changes to server-side definitions are detected and audited.

Frequently Asked Questions

Is MCP prompt injection the same as traditional LLM prompt injection?

It shares the same underlying mechanism, untrusted content influencing model instructions, but MCP introduces a specific vector: server-supplied prompt templates and tool descriptions that a client may render directly into model context without sanitization.

Does MCP require authentication by default?

No. MCP does not mandate a single authentication mechanism across all transports. Remote HTTP-based servers can use OAuth 2.1-based flows where implemented, but local stdio transports and server trust decisions are left to the client implementation.

What is a rug pull attack in MCP?

It refers to a scenario where an MCP server changes its exposed tool behavior or prompt content after a user has already approved the connection, without triggering a new consent request, potentially expanding access without the user's knowledge.

Govern MCP Prompt Execution at Runtime

Review how runtime policy enforcement, tool approval workflows, and audit logging apply to your MCP-connected agent infrastructure.

Request a Demo