bmdpat
All writing
5 min read

Your AI Agent's MCP Server Is a Security Hole

1 in 35 GenAI prompts carries high risk of data leakage. MCP makes the attack surface worse. Here's what builders need to know.

Share X LinkedIn

MCP changed how AI agents interact with tools. It also changed the attack surface.

Model Context Protocol lets agents call APIs, read files, query databases, and trigger workflows. All with production credentials. All in real time. If you're running MCP servers, you're running code that has access to everything your agent can reach.

The numbers are bad.

The stats

Autonomous Security (MCPTotal) published a report this week with hard data on AI agent risk:

  • 1 in 35 GenAI prompts carries high risk of sensitive data leakage
  • 87% of organizations deploying GenAI at scale have data leakage patterns
  • 99% of organizations have files exposed to GenAI tools without formal safeguards
  • 63% lack formal AI governance policies
  • Only 36% of security leaders believe their capabilities match AI risk
  • 90% of companies believe they cannot defend against AI-driven threats

Those numbers come from production deployments, not labs.

Where MCP makes it worse

Before MCP, an AI agent could hallucinate or leak data through its output. Bad, but contained.

With MCP, an agent can execute. It calls your Stripe API. It queries your database. It reads files on the developer's laptop. It triggers CI pipelines. Every MCP server is a tool the agent can invoke with real credentials.

Three specific risks:

1. Shadow MCP servers. Developers install Cursor, Claude Code, or OpenAI plugins. Each one can spin up MCP servers on their laptop. These servers have access to local files, environment variables, and whatever credentials are lying around. Nobody in security knows they exist. There's no centralized inventory.

2. Cascading access. One MCP tool calls an API. That API returns data the agent uses to call another tool. A single LLM output can trigger a chain of real actions across uncoordinated systems. One bad prompt can cascade.

3. No ownership. Who owns MCP security? Model governance? Infrastructure? Application security? In most organizations, nobody. The report found that MCP falls between existing security team boundaries. Nobody is watching.

What you can do right now

The governance gap is real. While the industry figures out enterprise MCP policy, you can protect your own agents at the runtime level.

Budget limits. Cap how much your agent can spend per session. A runaway loop through an MCP tool that calls a paid API will hit the cap and stop.

Rate limiting. If your agent is making 200 API calls per minute through MCP, something is wrong. Set a ceiling.

Loop detection. Agents get stuck in tool-call loops. MCP makes this worse because each loop iteration executes real actions. Detect the pattern and kill the run.

Timeout guards. No agent session should run forever. Set a wall-clock limit.

These aren't fancy. They're the minimum. Runtime guards don't replace governance policy. But they stop the bleeding while you build the policy.

The gap between visibility and enforcement

Platforms like MCPTotal focus on visibility. They answer: what MCP servers exist, who's using them, what data flows through them. That matters for enterprise governance.

But visibility doesn't stop a runaway agent. If your agent loops through an MCP tool 500 times in 3 minutes, a dashboard shows you the damage after. A runtime guard stops it on iteration 5.

You need both. Visibility tells you where the risks are. Runtime enforcement stops the damage in real time.

Try it

AgentGuard gives you 6 runtime guards for AI agents: budget caps, loop detection, timeout limits, rate limiting, token ceilings, and retry storm detection.

pip install agentguard47

Zero dependencies. MIT license. Works with any LLM provider, any MCP setup.

Get started with AgentGuard

PH

Patrick Hughes

Building BMD HODL — a one-person AI-operated holding company. Nashville, Tennessee. Fifteen agents.

Want more like this?

AI agent builds, real costs, what works. One email per week. No fluff.

More writing