MCP prompt injection
MCP tool poisoning and prompt injection
A model reads tool descriptions and tool results as text, and it has no reliable way to tell data from instructions. The defences that hold up assume some injected text will get through and limit what it can cause.
Written by Octri · Checked 3 November 2026
Tool poisoning through metadata
Tool poisoning hides instructions in the fields a model reads to choose a tool: the description, parameter names and schema text. A person approving the server usually sees a short summary, while the model sees all of it.
A variant changes the description after approval, so a tool that passed review later carries new text. The specification lets servers announce changes to the tool list, which gives clients a point at which to check again.
Prompt injection through tool results
A support ticket, a customer name or a web page can all carry text addressed to the model, and a read-only tool will return it faithfully. Our post on read-only servers follows that path in detail.
This is the case API owners meet most often, because their own users control the content. The specification asks servers to sanitize tool outputs and asks clients to validate results before passing them to the model. No filter catches everything, so the controls below still matter.
Controls on the server
A server cannot make a model immune, and it can decide what a successful injection is able to reach.
- Write tool descriptions from a reviewed source, and treat changes to them as changes to the API
- Keep untrusted fields clearly separated in structured results
- Return the fields a task needs, which also reduces the text an attacker can place
- Remove credentials and internal identifiers from results
- Require approval for tools that write, and leave out tools no workflow needs
Controls on the client
Clients carry the other half. The specification says they should show tool inputs before sending them, confirm sensitive operations and log tool usage, and must treat tool annotations as untrusted unless the server is trusted.
The combination to avoid is one agent holding private data, untrusted content and a way to send data out. Removing any one of the three, through separate servers or narrower tool lists, closes that path.
How Octri handles this
Octri does not claim to detect injected text in API responses, and no filter can promise that. The controls limit what injected text can make an agent do.
Tools come from your OpenAPI document and reach agents only when you publish, so a change to a description goes through your own review.
Writes default to asking first with the exact request on screen, and a tool you switch off is never listed.
Credentials echoed in API responses are removed before the agent sees them.
Tool groups give a job a shorter list, such as a read-only server for support. A group narrows what an agent sees, and an installation is what keeps a team on one group.
Each publish that changes the tools is a numbered release, and each agent is told what was added, renamed or removed since it last connected.
Questions
It limits the damage to what reads can do. An agent that also holds tools from another server can still act on injected text using those, so the risk is decided across everything connected to that agent.
References
Checked against MCP specification revision 2026-07-28 on 3 November 2026.
Further reading
- Your read-only MCP server can still carry a prompt injectionFrom the Octri blog.
- Giving an agent write access to your API: what to exclude firstFrom the Octri blog.
- MCP security best practicesThe full checklist: sign-in, token checks, least privilege, approvals, limits and audit logs.
- MCP OAuth and authorizationThe sign-in flow in request order, from the first 401 to a scoped access token.
- Token passthrough and confused deputyWhat the specification forbids, why it does, and how per-client consent closes the proxy attack.
- MCP audit logs and rate limitsThe fields worth recording for each tool call, and how to size per-tool limits and write caps.
Try it on your own spec
Generate an MCP server from your OpenAPI spec on the Free plan, with every tool set to run, ask first or stay off.