SentinelOS

Resources · Agent security

A tool server is a supplier whose text is read as an instruction.

Securing MCP comes down to four decisions: treat any text from a server as untrusted input, freeze and monitor what each server declares, accept only tokens issued for it, and judge every tool call outside the model. The 2026-07-28 revision of the specification, now in force, itself writes that a human in the loop is only a recommendation. Incidents published since 2025 show what that choice costs: approval given once, tool definition changed afterward, token reused outside its scope.

In brief. Connecting an MCP server to an agent does not merely import third-party code: it injects into the model's window texts it will treat as reliable, namely the tools' names, descriptions and execution results. A compromised server has a dual vector: the code run on the host and the instructions slipped into the reasoning.

How do you secure an MCP server?

Securing an MCP server comes down to four controls. Any text from a server is treated as untrusted input, what was approved must remain what runs, a token is valid only for the server it is meant for, and the tool call is judged at every call, outside the model. Each answers an incident or attack documented below. The 2026-07-28 revision of the specification, now in force, itself writes that a human in the loop is not a requirement of the protocol. The protocol's safeguards are mostly recommendations and do not replace a policy enforced by the company.

  1. A server's text is untrusted input. Name, description, schema, annotations and tool results are read by the model as instructions. The specification already asks that annotations be considered untrusted, unless the server is trusted.
  2. What was approved must remain what runs. An approval tied to a name, or given once and for all, stops protecting as soon as the definition changes.
  3. A token is valid only for the server it is meant for. The specification forbids an MCP server from accepting or passing through a token issued for another.
  4. The tool call is judged at every call, outside the model. The protocol's safeguards are mostly recommendations. They do not replace a policy enforced by the company.

The specification in force is the 2026-07-28 revision. It states what most guides leave out: a human in the loop is not a requirement of the protocol.

For trust & safety and security, there SHOULD always be a human in the loop with the ability to deny tool invocations.
Model Context Protocol, specification 2026-07-28, "Tools"

The protocol sets the interoperability floor. A company's security policy starts above it, and outside the MCP client.

A protocol driven by the model

The Model Context Protocol standardizes how an agent discovers and invokes tools hosted on local or remote servers. The specification sets out the principle: tools are model-controlled. The language model lists them and calls them autonomously, according to its interpretation of the context and of the user's request.

This choice explains the protocol's rapid adoption and its exposure surface. The model picks the tool on the strength of the text description the server presents to it. A server that publishes a manipulated description bends the agent's decisions without touching a line of client code.

In its April 2026 bulletin, CERT-FR, France's national CERT, puts this property in governance terms: deploying these agents significantly extends the software supply chain and its attack surface, because third-party extensions can be loaded dynamically and, depending on the integration architecture, run as trusted code with the same privileges as the host application.

Connecting an MCP server to an agent means bringing into your perimeter a software subcontractor, an executor holding rights and a writer of instructions.

Tool poisoning: the text the user does not see

On April 1, 2025, researchers at Invariant Labs documented a class of attack they named the Tool Poisoning Attack. Their definition: hostile instructions are buried in MCP tool descriptions, invisible to the user but read in full by the model.

The mechanism exploits a display asymmetry. The interface shows the user only a shortened preview of the tool. The model receives the full specification. An operator who validates a tool on the strength of a harmless summary approves only the visible surface. Human control exercised only on the approval interface leaves intact the channel where the offensive payload lives.

On June 26, 2026, a post from Microsoft's security community on the state of MCP security presents tool poisoning as the sharp end of prompt injection in MCP. It describes instructions hidden in a tool's description or schema, which the model reads and the user generally does not. Its measures: treat tool descriptions and outputs as untrusted input, review the full schema before approving a server, display the full call rather than a summary, isolate sensitive servers from general-purpose ones, pin tool definitions and alert on any change.

clients MUST consider tool annotations to be untrusted unless they come from trusted servers
Model Context Protocol, specification 2026-07-28, "Tools"

The same rule of distrust applies to all descriptive text: a string supplied by a third-party server is never a mere label, it is untrusted external input. This vector extends the mechanism of indirect prompt injection across the tooling bus.

The rug pull: approved one day, changed the next

In the same April 2025 publication, Invariant Labs describes the rug pull: a tool server changes the description of its functions after the client has collected the user's initial approval. Human consent is requested once, and the tool definition then evolves freely. The protocol provides for this behavior as a standard feature: a server declares the listChanged capability and notifies its clients that its catalog has changed.

The 2026-07-28 revision clarifies the framework. The catalog returned by the server must no longer vary from one connection to another, but it can change over time and vary with the authorization presented on the request. Change notifications travel over a subscription stream opened by the client. The "Tools" page does not require the client to ask for the user's agreement again when a description changes.

The same flaw exists one level down, in development environments. On August 5, 2025, Check Point Research published MCPoison (CVE-2025-54136): approval of an MCP server in Cursor was tied to the name of the configuration entry, not to its content. A command modified after the initial agreement ran without a new prompt. Cursor 1.3, released on July 29, 2025, now requires explicit approval on every change to the MCP configuration.

On June 26, 2026, Wiz Research published the flaw CVE-2026-12957 in the Amazon Q extension for VS Code: the extension loaded the MCP servers declared in a repository's files as soon as the folder was opened, without asking the user's agreement. These processes inherited the developer's environment, cloud credentials included. Amazon fixed the flaw in version 1.65.0 of the language server, with a consent prompt before any server from a workspace is loaded.

Any security model whose control stops at installation ceases to protect the agent at the first silent update.

Fake servers: the postmark-mcp case

In September 2025, the Koi Security team uncovered the npm package postmark-mcp, which impersonated the MCP connector of the email delivery service Postmark. According to the investigation reported by CSO Online on September 26, 2025, the package behaved normally for fifteen versions. Version 1.0.16 added a single line of code: a hidden copy (Bcc) of every email sent by the agent, directed to an address tied to the attacker. Koi Security estimated that about 500 organizations were affected. The package had about 1,500 downloads per week.

The package was removed before it was even reported to npm. That removal leaves the code active everywhere the dependency had already been downloaded. Koi Security urged the teams concerned to uninstall version 1.0.16, rotate the secrets that had passed through email and audit their fleet of MCP servers.

A package name imitating a known vendor, fifteen clean versions to build trust, then a one-line update. The agents invoked the connector as their mission required, and the tool did the requested task while duplicating the flow to the outside. It is a classic supply chain compromise, plugged directly into the agents' mail.

Trust boundaries, according to the specification itself

The "Security Best Practices" chapter of the 2026-07-28 revision lists the classes of attack inherent in the protocol's architecture. Its authors set out there what the protocol does not guarantee. The table takes up the cases that concern a company.

ThreatMechanismWhat the specification asks
Confused deputyA proxy server that uses a static client ID, accepts dynamic client registration and lets a consent cookie persist allows an attacker to obtain an authorization code without the user's consent.Consent specific to each client, stored server-side and checked before calling the third-party authorization server. Exact match on the redirect URI.
Token passthroughAn MCP server accepts a token issued for another service and relays it to the downstream API. It bypasses controls that depend on the token's audience and blurs the logs.MCP servers MUST NOT accept or transit any other tokens. The server validates that the token is meant for it (audience, RFC 8707).
SSRFA malicious server places internal addresses in its OAuth discovery metadata, including that of the cloud provider's metadata service. The client makes the request on its behalf, behind the firewall.Clients should block private and reserved address ranges and validate redirects. A client deployed server-side should consider an egress proxy.
State handle hijackingMCP no longer has a protocol session. State between two calls travels in an identifier that the server creates and the model replays as an argument. Whoever obtains or guesses it acts on another user's state.MCP servers MUST NOT treat possession of a state handle as authentication. Random identifiers, bound server-side to the authenticated user.
Compromised local serverA local server runs with the client's rights. A booby-trapped startup command in a configuration, or a server left open on the machine, gives code execution.The client must show the exact command, untruncated, and obtain explicit agreement. It should run the server in a sandbox with minimal rights.
Hostile authorization URLA malicious server supplies as the authorization URL an executable scheme or a string interpreted by a command shell.Only the http and https schemes are accepted. The client must not open a URL through a command shell.
Mix-upAn attacker-controlled authorization server receives a code issued by an honest server.The client records the issuer before the redirect and must compare the iss parameter of the response, when present.
Excessive scopeA broad-scope token, obtained through a log leak or a memory read, opens tools unrelated to the task.Minimal scopes at the start, progressive elevation on challenge, logging of elevations.

Two changes in the 2026-07-28 revision alter how this chapter reads. The changelog states that dynamic client registration (RFC 7591) is now deprecated in favor of Client ID Metadata Documents, and remains available for compatibility. It also states that clients must validate the issuer present in an authorization response before using the code.

The tools documentation adds rules of conduct for client applications: show a call's parameters to the user before sending, to prevent accidental or hostile exfiltration, validate tool results before passing them to the model, and record every call in an audit log. Each of these rules is worded with SHOULD. The MUST requirements on this page are addressed to servers: validate inputs, control access, limit rate, sanitize outputs.

A compliant client can therefore show no parameters and log nothing.

Tokens and authorization: where the specification is strictest

Authorization is optional in MCP. When it is implemented on an HTTP transport, the specification bases it on OAuth 2.1: the MCP server acts as the resource server and the client as the OAuth client. The client must send the resource parameter (RFC 8707) in authorization and token requests, to designate the server the token is meant for.

MCP servers MUST validate that access tokens were issued specifically for them as the intended audience
Model Context Protocol, specification 2026-07-28, "Authorization"

The rule has a practical reason. Token passthrough creates a failure in the field of evidence. When an intermediate server passes along a token it did not issue or validate, the downstream service loses sight of the real caller: its logs record requests that appear to come from another source, under another identity. The specification writes it: this confusion makes post-incident investigation, access control and audit harder. An agent that calls ten MCP servers with passthrough tokens turns its log into a register in which no one can any longer establish who acted.

The confused deputy poses the symmetrical problem on the consent side. The proxy is the only client the third-party authorization server sees. If consent is not requested again for each client registered with the proxy, the agreement given once serves another.

The question of scopes follows the same logic. The specification recommends a progressive model: a minimal set of read scopes at the start, then elevation on demand, logged. Among common mistakes it cites publishing every possible scope and generic "full access" scopes. For the general framework of an agent's rights, see agent identities and least privilege.

No more session, a state handle

The specification published in 2025 described a session hijacking attack scenario: an attacker who had intercepted a session identifier injected a forged event that reached the legitimate client as an asynchronous notification. The specification gave a concrete example. By injecting a catalog change notification, the attacker could activate on the client machine tools the user had never authorized.

The 2026-07-28 revision removed the cause. Its changelog states the removal of protocol-level sessions and of the Mcp-Session-Id header from the HTTP transport. Servers that need state between two calls carry it in a handle that the server issues and the model replays as an ordinary tool argument. The risk changes nature without disappearing: the "State Handle Hijacking" chapter covers the case where a third party obtains or guesses this handle, and verification moves to the application.

Why does an agent make the problem worse?

When a developer imports a booby-trapped library, they suffer a classic code compromise. When an agent connects a compromised MCP server, it suffers both a code compromise and a cognitive compromise through text, and it provides the bridge between all its tools itself. The exploitation of GitHub's MCP connector demonstrated by Invariant Labs on May 26, 2025 rests on this coupling: a malicious instruction read by a tool that browses public tickets leads the agent to invoke a second tool, which has access to the user's private repositories. The intrusion vector is the text that travels from one tool to another in the model's context.

On June 16, 2025, Simon Willison summed up the problem: the appeal of MCP is that it encourages users to mix servers of disparate origins. Many of these tools give access to private data. Many others, often the same ones, give access to places that may host malicious instructions. Each server added completes the lethal trifecta presented in the overview of agent security.

OWASP has published three works that give teams a common vocabulary. On November 4, 2025, a cheat sheet for the safe use of third-party MCP servers, which insists on least privilege and human supervision. On December 9, 2025, the Top 10 for Agentic Applications for 2026, separate from the ranking devoted to language models. And a Top 10 for MCP, still in beta, whose entries include Tool Poisoning, Software Supply Chain Attacks & Dependency Tampering, Lack of Audit and Telemetry and Shadow MCP Servers. The last joins the subject of shadow AI in the enterprise: a server no one has inventoried is controlled by no one.

What an architecture must control

The lesson goes beyond MCP: any protocol for plugging in tools raises the same challenges. The decisive question is where the control is inserted.

Accrediting a server at installation is necessary and never sufficient. The tool definition can change during its life, and the data it returns goes straight into the model's prompt. The control must be exercised at every call: which tool is invoked, with which arguments, on which resource and following which reads. SentinelOS sits between your agents and everything they touch, and judges every action before it leaves. Cerberus holds the door: keys for the length of one act, signed tools, and nothing leaves except through it.

Only this inspection at the point of call withstands the three scenarios documented here: the connector whose description mutated after installation, the one whose metadata hides an instruction, and the sound connector that returns a booby-trapped document. For development environments, see the supply chain of coding agents. For data leaving through a tool call, see data exfiltration by an agent.

The risks specific to tool servers appear in OWASP's ranking of agentic applications, where the agent supply chain and tool misuse are categories in their own right. The agentic Top 10, read category by category, places each case described here in the grid security teams use to talk to one another.

Inspect the call, not just the catalog

  1. They keep an enforceable inventory of tool servers. For each connector: identity of the publisher, source repository, exact version, agents allowed to invoke it. Servers installed outside the approved channel appear there too.
  2. They pin versions and definitions. Every version bump follows the review path of a critical dependency. Every change to a description or schema raises an alert before it reaches the agent.
  3. They approve the content, not the name. The agreement given to a server is tied to its command, its arguments and its tool definitions. A repository that gets opened loads no server without a person's decision.
  4. They read the full schema. The review covers what the model receives, not the summary shown in the interface.
  5. They bind each token to one server. Own audience, minimal scopes, short lifetime, no relay to a third party. They prefer Client ID Metadata Documents to dynamic registration.
  6. They confine local servers. Sandbox, restricted rights on the file system and the network. For remote servers, an egress proxy that forbids internal destinations.
  7. They judge every call outside the model. Every invocation is evaluated by a deterministic policy before it runs. The log keeps the exact trace of the content read just before the call.

Sources

  1. Model Context Protocol, specification 2026-07-28, "Key Changes". modelcontextprotocol.io
  2. Model Context Protocol, specification 2026-07-28, "Security Best Practices". modelcontextprotocol.io
  3. Model Context Protocol, specification 2026-07-28, "Authorization". modelcontextprotocol.io
  4. Model Context Protocol, specification 2026-07-28, "Tools". modelcontextprotocol.io
  5. Invariant Labs, "MCP Security Notification: Tool Poisoning Attacks", April 1, 2025. invariantlabs.ai
  6. Invariant Labs, "GitHub MCP Exploited: Accessing private repositories via MCP", May 26, 2025. invariantlabs.ai
  7. Check Point Research, "Cursor IDE's MCP Vulnerability" (MCPoison, CVE-2025-54136), August 5, 2025. research.checkpoint.com
  8. CSO Online, "Trust in MCP takes first in-the-wild hit via squatted Postmark connector", September 26, 2025. csoonline.com
  9. Wiz Research, "MCP Auto-Execution: From Git Clone to Cloud Compromise in Amazon Q VS Code Extension" (CVE-2026-12957), June 26, 2026. wiz.io
  10. Microsoft Security Community Blog, "The state of MCP security in 2026", June 26, 2026. techcommunity.microsoft.com
  11. Simon Willison, "The lethal trifecta for AI agents", June 16, 2025. simonwillison.net
  12. OWASP GenAI Security Project, "CheatSheet: A Practical Guide for Securely Using Third-Party MCP Servers 1.0", November 4, 2025. genai.owasp.org
  13. OWASP GenAI, "OWASP Top 10 for Agentic Applications for 2026", December 9, 2025. genai.owasp.org
  14. OWASP, "Top 10 for MCP" (beta). owasp.org
  15. CERT-FR, "Vulnérabilités et risques des produits d'automatisation par IA agentique sur les postes de travail" (CERTFR-2026-ACT-016), April 13, 2026. cert.cyber.gouv.fr

Frequently asked questions

How do you secure an MCP server?

Four controls are enough. A server's text is untrusted input, what was approved must remain what runs, a token is valid only for the server it is meant for, and the tool call is judged at every call, outside the model. Each answers a documented incident or attack.

What is an MCP rug pull?

A tool server changes the description of its functions after the client has collected the user's initial approval. Consent is requested once, then the tool definition evolves freely, and the protocol provides for this behavior with the listChanged capability. The MCPoison case (CVE-2025-54136) gives an example in Cursor, where approval was tied to the name of the configuration entry and not to its content.

Does the MCP protocol require a human in the loop?

No. The 2026-07-28 specification writes that there should always be a human in the loop with the ability to deny tool invocations, which remains a recommendation. The protocol's safeguards are mostly recommendations and do not replace a policy enforced by the company.