---
id: 11290
lang: en
title: "MCP and AI agent security: how the protocol created a new attack surface"
published_at: "2026-07-07 16:14:00"
source_name: "Habr AI"
source_url: "https://habr.com/ru/articles/1055316/?utm_campaign=1055316&utm_source=habrahabr&utm_medium=rss"
canonical_url: "https://news.hamidun.com/en/news/11290"
categories: ["llm"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

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

> **Краткая суть (BLUF):** 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.

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.

---
- **Первоисточник:** [Habr AI](https://habr.com/ru/articles/1055316/?utm_campaign=1055316&utm_source=habrahabr&utm_medium=rss)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/11290
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
