Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →
ReleaseInsight · On RadarHabr AI→ original

MCP and AI agent security: how the protocol created a new attack surface

Model Context Protocol made it easier to connect AI agents to tools — but it also created a new attack surface. Every MCP server becomes a trust point, and language models have no clear boundary between data and instructions. Tool poisoning, indirect prompt injection, and sampling abuse attacks have already been documented in the ecosystem. Researchers tested the vulnerabilities on a dedicated MCP test bench and showed how "harmless" documents can lead an agent to execute commands.

AI-processed from Habr AI; edited by Hamidun News
MCP and AI agent security: how the protocol created a new attack surface
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1Tool poisoning — a tool description in an MCP server contains hidden instructions that change the agent's behavior when the tool is called
Key metric #2Indirect prompt injection — malicious instructions are hidden in a document, database record, or web page that the agent reads while working on a task
Key metric #3Sampling abuse — manipulating how the agent requests new outputs from the model, which makes it possible to bypass system prompt restrictions

Model Context Protocol (MCP) made AI agents modular: one standard interface for connecting to any tool or service. But that unification hides a systemic problem — every new MCP server expands the agent's trusted zone and creates a potential point of attack.

Why MCP created new vulnerabilities

Large language models have no architectural boundary between "data" and "instructions." Anything that lands in a model's context is potentially executable. MCP doesn't solve this problem — it scales it: an agent can now have dozens of connected tools, and each one widens the attack surface.

Because MCP is a standard, an attacker who gains control of a single server, or who can slip data into its responses, can potentially influence the agent's entire chain of actions.

Three main classes of threats in the MCP ecosystem:

  • Tool poisoning — a tool description in an MCP server contains hidden instructions that change the agent's behavior when the tool is called
  • Indirect prompt injection — malicious instructions are hidden in a document, database record, or web page that the agent reads while working on a task
  • Sampling abuse — manipulating how the agent requests new outputs from the model, which makes it possible to bypass system prompt restrictions

Even a "harmless" PDF, tool description, or database row can contain commands that the agent will execute on par with legitimate instructions.

What hands-on testing showed

The vulnerabilities aren't theoretical. A researcher ran tests on a deliberately vulnerable MCP test bench and recorded injected commands actually being executed. The documented scenarios include hijacking tool calls through specially crafted MCP server responses and executing hidden instructions from text documents passed to the agent as "data."

"Every MCP server you trust expands the trusted zone of the entire system — not only through

its tools, but through everything it can feed the agent as data."

BarkingDog, a scanner built by the author, detects suspicious tool calls in real time — one of the few practical detection tools available to security teams today.

How the industry is trying to close the gap

AI infrastructure vendors are pushing in several directions at once:

  • MCP Gateways — a proxy layer that filters and controls tool calls before they reach the agent; some solutions add a full audit log of interactions
  • Sandboxing — isolating MCP server execution and restricting access to the file system, network, and system resources
  • OAuth architectures — explicit authorization for each tool with least-privilege access; each MCP server gets only the permissions it actually needs for a specific task

For now, all of these solutions are partial. The fundamental problem is architectural: until language models learn to separate the data plane from the control plane at the level of context processing, any incoming data remains potentially executable.

What this means

MCP has become the de facto standard for AI agents, and its security has moved from an academic question to a practical one. Developers deploying agents with MCP servers should treat every connected tool as a trusted third party — with mandatory auditing, isolation, and least privilege on every call.

Story

Key Questions Answered

Why MCP created new vulnerabilities?

Large language models have no architectural boundary between "data" and "instructions." Anything that lands in a model's context is potentially executable. MCP doesn't solve this problem — it scales it: an agent can now have dozens of connected tools, and each one widens the attack surface. Because MCP is a standard, an attacker who gains control of a single server, or who can slip data into its responses, can potentially influence the agent's entire chain of actions.

What hands-on testing showed?

The vulnerabilities aren't theoretical. A researcher ran tests on a deliberately vulnerable MCP test bench and recorded injected commands actually being executed. The documented scenarios include hijacking tool calls through specially crafted MCP server responses and executing hidden instructions from text documents passed to the agent as "data." "Every MCP server you trust expands the trusted zone of the entire system — not only through its tools, but through everything it can feed the agent as…

How the industry is trying to close the gap?

AI infrastructure vendors are pushing in several directions at once: MCP Gateways — a proxy layer that filters and controls tool calls before they reach the agent; some solutions add a full audit log of interactions Sandboxing — isolating MCP server execution and restricting access to the file system, network, and system resources OAuth architectures — explicit authorization for each tool with least-privilege access; each MCP server gets only the permissions it actually needs for a specific task…

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Free · Waitlist · Hermes + DeepSeek

Free 2-Day Vibecoding & AI Agents Intensive

Day 1: the autonomous Hermes + DeepSeek AI agent — vibecoding and development on par with Claude Code / Codex / Gemini. Led by Jemal Hamidun, Head of AI at Alpina Digital and academic supervisor at MIPT. Right after you register with our bot Nika: the recording + 11 materials from the previous intensive.

Join the waitlist →Nomad AI Workspace
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — MCP and AI agent security: how the protocol created a new attack surface https://news.hamidun.com/en/news/11290/mcp-and-ai-agent-security-how-the-protocol-created-a-new-att

What do you think?
Loading comments…