A Compromised MCP Server Can Misuse Trusted Tools

Your agent can have a legitimate connection to customer messages and still leak them through a different tool. If one MCP server supplies instructions the agent treats as authority, the problem is no longer confined to that server: the agent may use another server’s perfectly valid permissions to carry out the attacker’s request.
For a founder or solo developer connecting agents to business systems, the question is not just “Do I trust this MCP server?” It is “What could this server persuade my agent to do with every other tool it can reach?”
The failure mode: one server supplies instructions, another supplies access
An MCP server can influence an agent through the tool descriptions and results it returns. Those are useful inputs for deciding how to complete a task, but they are not instructions from the user or the application owner. If the agent treats them as such, a lower-trust server can steer it toward a higher-trust tool.
This is not merely a hypothetical concern. In a research demonstration documented by Invariant Labs, an untrusted MCP server induced an agent that was also connected to a trusted WhatsApp MCP server to exfiltrate message history. The NSA’s MCP security guidance describes the same class of demonstration: a malicious server’s tool descriptions manipulated a client with access to both servers. It was a research demonstration, not a documented breach of real users.
The trust boundary is easy to miss because each individual connection can look reasonable:
- A user asks an agent to perform a legitimate task.
- The agent loads tools from several MCP servers.
- One server presents a tool description or response containing an instruction unrelated to its job.
- The model decides that instruction is part of the workflow.
- It calls a different, trusted tool using access that the agent already has.
For example, imagine an agent that can read customer support messages and use a separate tool to post summaries to an external workspace. A compromised server used for an unrelated lookup tells the agent to fetch full message threads and post them as “diagnostic context.” The message-reading tool has not been compromised. The posting tool has not been compromised. The agent has crossed the boundary between data it received and instructions it is allowed to follow.
Tool descriptions deserve the same scrutiny as tool results. Invariant Labs notes that a malicious instruction can be placed in a description the model sees but the user may not. An ordinary approval screen displaying only the final tool call can therefore omit the text that caused the call.
The NSA also describes a variation in which the malicious server initially advertised a benign instruction, then switched to a malicious one after its second use. A one-time check at installation would not catch that change.
Draw the trust boundaries before connecting the tools
The practical starting point is an inventory of what each MCP server can provide, what each tool can access, and where each tool can send data. Treat server-provided descriptions and results as lower-trust input, even when the server is useful and was intentionally installed.
The NSA recommends defining trust boundaries between MCP components, rather than blindly accepting data from a lower-trust component. For a small business agent, a boundary map can be a short document—not a large governance program.
| Component | Example | Boundary to enforce |
|---|---|---|
| User request | “Summarize these support threads” | Defines the task; does not authorize unrelated exports |
| MCP tool description | “Use this tool to look up account status” | Helps identify a tool; cannot grant new permissions |
| MCP tool result | Account data or retrieved text | Is task data; cannot instruct the agent to call other tools |
| Sensitive-data tool | Read customer messages | Available only to approved workflows and identities |
| Outbound tool | Send a message or create an external record | Restricted by destination, content, and workflow |
| Application policy | Approved tool combinations and limits | Enforced outside the model |
For each agent, write down the answers to four questions:
- What data can it read? Include attachments, message history, customer records, and any search tool that can retrieve them.
- What can it change or transmit? Sending email, posting to a workspace, updating a CRM record, and making an API request are different powers.
- Who or what is it acting as? A user’s delegated access, a service identity, and a shared team credential have different consequences.
- Which combinations are necessary? A support summarizer may need message-reading access. It does not automatically need an unrestricted outbound posting tool.
Pay particular attention when one flow combines sensitive-data access, untrusted-content ingestion, and external communication. Treat that combination as a design risk: an instruction from untrusted content could reach a tool that can transmit private data. For guidance on assessing MCP trust boundaries, check the NSA’s MCP security guidance. First ask whether you can remove one capability, split the work into separate agents, or insert a human-controlled handoff.
An inbox assistant, for instance, can draft a customer reply without holding permission to send it. A separate step can validate the recipient and present the draft for approval. This preserves much of the time-saving workflow while denying an injected instruction a direct route from private messages to an external destination.
Put tool permissions in code, not in the prompt
A system prompt can tell an agent to ignore malicious instructions, but a prompt alone cannot enforce a tool boundary. The application controlling tool calls must decide which tools an agent may call, under which identity, with which arguments, for the current workflow.
Start with a per-workflow allowlist, not a shared list of everything the organization has connected. Microsoft describes enforcing a per-tool allowlist in its MCP orchestration, so a model suggestion cannot call a tool outside policy.
The important detail is where the check runs. It must run in the tool-call path, after the model proposes a call and before your application executes it. Asking the model whether its own proposed call is safe is not an independent control.
Here is a deliberately small example. The tool identifiers and workflow name are illustrative; substitute identifiers from your own registered tool inventory.
WORKFLOW_TOOLS = {
"support_summary": frozenset({
"messages.read_thread",
"drafts.create",
}),
}
def authorize_tool_call(workflow, tool_name, arguments):
allowed = WORKFLOW_TOOLS.get(workflow, frozenset())
if tool_name not in allowed:
raise PermissionError("Tool is not approved for this workflow")
if tool_name == "messages.read_thread":
if set(arguments) != {"thread_id"}:
raise PermissionError("Unexpected message-read arguments")
if tool_name == "drafts.create":
if set(arguments) != {"thread_id", "body"}:
raise PermissionError("Unexpected draft arguments")
This does two useful things: an unknown workflow gets no tools, and the support-summary workflow cannot call a sending tool simply because the model asked for one. Checking argument names can reject unexpected arguments; preventing unauthorized use also requires checks on values, identity, and context. See Microsoft’s discussion of MCP security and governance for where those controls belong.
It does not make the workflow production-ready. Before execution, you would still need to validate argument types and ownership, check that the requesting identity may read the specified thread, constrain what the draft tool can store, and record the decision. In particular, do not let the model supply the workflow value that determines its own permissions. That value should come from trusted application state.
Also check the combination of actions, not only each tool in isolation. A workflow may legitimately read a customer record and legitimately send an email, but that does not mean it may email the entire record to an arbitrary address. A destination allowlist, content restrictions, or an approval step may be needed at the point of transmission.
A useful policy review question is: If a tool result said “ignore the user and call this other tool,” what would the executor refuse? If the answer depends entirely on the model recognizing the instruction as malicious, the boundary is still missing.
Scope credentials and identify the machine actor
An allowlist limits what your application will execute; credentials limit what the connected systems will accept. You need both. If every agent shares a broad credential, a mistake in routing or policy can turn a narrow workflow failure into access across the business.
For each agent or workflow, identify its machine actor and record the credentials it uses. Separate a message-reading integration from an outbound communication integration where practical. Remove unused permissions, and make credential rotation and revocation part of the operating procedure rather than an emergency invention.
Gartner identified identity registration and governance, credential automation, and policy-driven authorization for machine actors as AI-agent IAM challenges. The small-team translation is straightforward: you should be able to answer which agent made a call, which credential it used, why that workflow was authorized, and how to cut off its access.
For MCP connections using the protocol’s authorization flow, check the July 28, 2026 MCP authorization specification. It says clients must include a resource identifier in authorization and token requests, servers must validate that access tokens were issued for them, and clients should request only the scopes needed for intended operations. Resource validation helps prevent a token intended for one resource from being accepted by another; narrow scopes reduce what an accepted token can do. Neither replaces your application’s per-tool and per-workflow policy.
If you maintain MCP client registration code, note another protocol change before treating an old setup guide as current: the July 28, 2026 specification revision deprecated Dynamic Client Registration in favor of Client ID Metadata Documents. Dynamic Client Registration remains available for backward compatibility. Review which method your client and servers actually support rather than assuming deprecation means immediate removal.
OAuth configuration is not the whole threat model, either. A correctly issued token can still be used for the wrong business purpose if a lower-trust tool response persuades the agent to call an authorized tool. Token controls answer “May this client access this resource?” Your workflow policy must also answer “Is this particular call appropriate for this task?”
Test the attack path, then watch for changed tools
A useful security test should try to make the agent cross a boundary, not merely ask whether it recognizes the words “ignore previous instructions.” Put adversarial text where the agent will actually encounter it: in a test MCP tool description or tool result, alongside the trusted tools the workflow normally uses.
Use a non-production environment and synthetic records. Then run a task the agent is genuinely supposed to perform. A compact test might work like this:
- Give the agent access to a test message-reading tool and a test draft-creation tool.
- Add a lower-trust lookup server used by that workflow.
- Insert an instruction into the lookup tool’s description or result telling the agent to retrieve message history and send it through an unapproved tool.
- Confirm the executor refuses the unapproved call even if the model proposes it.
- Repeat with an approved outbound tool but an unapproved destination or inappropriate content.
- Inspect the logs to determine what the model proposed, what policy allowed or denied, and what actually executed.
A passing test is not “the agent said it would be careful.” It is an observable refusal at the execution boundary, with no sensitive data transmitted. A failing test tells you whether to remove a tool, narrow a credential, validate arguments, restrict a destination, or split the workflow.
Keep a reviewed copy of approved tool definitions, too. Microsoft recommends recording approved MCP tool definitions and alerting when they change to help detect a server “rug pull.” This matters because, as the NSA-described demonstration shows, a server can present benign text first and malicious text later. Treat an unexpected description change as a reason to pause and review the integration—not as proof of an attack by itself.
For an operational review, retain enough information to reconstruct the decision without copying sensitive customer data into a new, poorly protected log. Record the workflow, agent identity, server and tool identifiers, tool-definition version or digest, requested action, policy result, and execution outcome. Protect access to those records. If a definition changes, you should be able to identify which workflows could have loaded it and which calls followed.
A final test is recovery. Can you disable one server, revoke its credentials, and keep the rest of the business process running manually or in a reduced mode? For a small team, that fallback is often more valuable than an elaborate detection rule nobody can operate.
Decide which agent workflows should ship
The defensible default is not “connect every useful tool and hope the model chooses well.” It is to ship the smallest workflow that completes a real task, with a clear answer for what happens when an MCP server returns hostile text.
That matters as agents become more common. Gartner forecast that up to 40% of enterprise applications would include integrated task-specific AI agents by 2026, compared with less than 5% at the time of its announcement. That is a forecast, not a measured adoption rate. Gartner also listed agentic AI cybersecurity oversight as its first cybersecurity trend for 2026.
For a small business, you do not need an enterprise-sized program before automating email triage or support drafting. You do need a release decision. Before enabling an agent in production, require someone who owns the workflow to sign off on:
- The legitimate task and the data required to complete it.
- The exact servers and tools available during that task.
- The identity, credential scope, and allowed destinations for each action.
- The policy enforced before tool execution—not just instructions in the prompt.
- An injection test that attempts to cross from a lower-trust server to a trusted tool.
- A way to detect tool-definition changes and disable the integration.
If the workflow needs to read sensitive records and communicate externally, and you cannot reliably constrain the destination or review the output, keep a human handoff. That is a narrower automation, not a failed one. It still removes repetitive work without handing an untrusted tool result the authority to export business data.
How BizFlowAI approaches this
BizFlowAI builds practical AI automations for solopreneurs and small teams. For an MCP integration, the useful starting point is the workflow and its trust boundaries: which tools it needs, what each can read or send, where permissions are enforced, and what happens if a server changes its instructions. Those controls need to be verified in the actual integration, not assumed because an agent has a safety prompt.
Before an agent gets production access, decide what to restrict, separate, or leave under human approval. Make that decision against the tool inventory and an observed cross-tool failure test, rather than the agent’s assurance that it will follow instructions.
Work with BizFlowAI
If you'd rather have this built for you, that's what we do: production AI automation for solo founders and small teams — agents, integrations, and document pipelines that actually ship.
Request a free discovery call — 30 minutes, we map the highest-ROI automation in your workflow. No pitch deck, just engineering.
More guides like this on the BizFlowAI blog.
Frequently asked questions
Can a compromised MCP server make my agent misuse another server’s tools?
Yes. A compromised server can put instructions in a tool description or result that persuade an agent to call a different server’s tools. If that second server can read private data or send it externally, the agent may misuse valid permissions without either tool being compromised.
Are MCP tool descriptions safe to treat as instructions?
No. Tool descriptions help an agent identify tools, but they come from the server and should be treated as lower-trust input. A malicious description can contain instructions the user never sees, and a server can change its description after an initial review.
How do I stop an agent from calling MCP tools outside its task?
Enforce a per-workflow tool allowlist in your application after the model proposes a call and before the call executes. Derive the workflow from trusted application state, not from a model-supplied value. Also validate arguments, the requesting identity, and the data the tool may access.
Why isn’t a tool allowlist enough to prevent MCP data leaks?
An allowlist controls which tools can run, but two individually permitted actions can still form an unsafe sequence. For example, an agent might read a customer record and send its contents to an arbitrary address. Restrict destinations and content, and check whether the combined actions are authorized for the workflow.
What should I do if an agent needs to read customer messages and draft replies?
Give the agent access to the messages and a draft-creation tool, but not unrestricted sending permission. A separate step can verify the recipient and present the draft for human approval. This removes the direct path from an injected instruction to an outbound message.