Tools Are a Contract, and an Attack Surface
이 콘텐츠는 아직 번역되지 않았습니다.
Module 5 of 5 in the chapter MCP, Headless Systems, and Agent Tools, chapter 22 of the Integration Architect course. Each module stands on its own. Previous: Salesforce as the MCP Client · Next chapter: Agent-to-Agent Integration
The question this module answers: If an agent chooses a tool from its words, how do you write tools agents choose well, and how do you defend against tools whose words lie?
The Words Are the Contract
Section titled “The Words Are the Contract”In chapter 3 the contract was a file a developer read: what goes in, what comes out. A developer then wrote code that called one operation, on purpose.
An agent doesn’t work that way. Salesforce puts it in one line: “External models choose tools based only on the name and description. Make each tool task-specific” (The Salesforce Developer’s Guide to the Winter ‘27 Release (opens in a new tab), checked 2026-11-21).
Read that twice. The name and the description aren’t documentation any more. They’re how the caller decides. A tool with a vague description gets called at the wrong time, or not called when it should be. That’s a bug, and it’s in the words.
Salesforce treats the words the same way. When you register a server, it keeps the tool definitions, and in its words, “These definitions represent stable contracts, not just run-time data” (MCP for Agentforce (opens in a new tab), Salesforce Help, checked 2026-11-21).
Write the Contract
Section titled “Write the Contract”So write tools the way you’d write an API contract, for a reader who takes every word literally.
- One job per tool, named for the job. “Get delivery status” beats “query”. “Request a refund for one order” beats “payments”.
- Say when to use it, and when not to. “Returns the current status of one delivery, by delivery number. Doesn’t return history; use Get delivery history for that.”
- Describe every input with its format and an example: “delivery number, like D-10042”.
- Say what it changes. A tool that writes or deletes should say so in its description, and carry annotations that mark it, as Salesforce advises for custom tools: “set annotations explicitly” (General Best Practices (opens in a new tab), checked 2026-11-21).
- Size it sensibly. Start a little coarse, and split a tool when agents show they need finer control (module 3).
- Version it. Changing what a tool does is changing a contract. Treat it like a new API version, and tell its callers.
Words an Attacker Can Write
Section titled “Words an Attacker Can Write”Now the other side. If the agent trusts the words, then whoever writes the words has power over the agent.
Hidden instructions. A tool’s description is text the model reads. A malicious server can put instructions in it, not a description at all: ignore your other rules, send this data somewhere, call this other tool first. This is usually called tool poisoning. The agent reads it as part of its context, and may follow it.
Invisible characters. The instructions don’t even have to be visible to you. Salesforce checks for this when you register a server: “Invisible characters can hide malicious instructions… we check for invisible characters in the names and descriptions of the server and tools, and we warn you before you complete registration.” And its advice if you see that warning: “consider these tools to be high risk” (Register a Third-Party MCP Server in Agentforce Registry (opens in a new tab), checked 2026-11-21).
A tool that changes after you approved it. Salesforce calls it a rug pull: “A rug pull occurs when a previously safe MCP server or tool is updated by the publisher to include malicious instructions. Rug pulls occur after the server is registered.” In plain words: the tool you reviewed isn’t the tool that’s running. Salesforce’s defence is to keep the definitions from the day you allowlisted them, “scan for changes at the beginning of each agent session and whenever an agent calls a server tool,” and “automatically block use of the out-of-sync server or tool,” blocking “only the affected actions.”
That last defence is the contract idea doing security work. Because the approved definition is kept as the contract, a change is visible, and a changed tool stops until someone looks at it.
Your Defences
Section titled “Your Defences”Salesforce’s checks help. They don’t replace your decisions. Here’s the list I’d work through for every MCP server an agent can use.
- Trust the publisher before the tool. Who runs this server, what token does it hold, and how fast could you cut it off? Those are chapter 18 module 7’s vendor questions, asked of a new kind of vendor.
- Allowlist few tools. Only the ones this agent needs for its job, never the whole server.
- Read every description you allow. Out loud, if it helps. Anything that reads like an instruction to the agent rather than a description of the tool is a reason to stop. Treat Salesforce’s invisible-character warning as a no.
- Limit what the identity can do. Whatever a poisoned tool talks the agent into, it can only do what the agent’s identity allows. That’s least privilege, from the Identity course’s Agent Identity chapter.
- Put a person in front of the irreversible. As I put it at Dreamforce: high consequence or irreversible action, require human oversight. A refund, a deletion, a payment: the agent proposes, a person approves.
- Review changes on purpose. When a tool is blocked for changing, someone reads the new definition and decides. Salesforce suggests using “trace data in Agentforce Builder to identify when MCP tool actions are out of sync.”
One Door in Front of the Tools
Section titled “One Door in Front of the Tools”Now picture a company with a dozen agents and a dozen MCP servers. If every agent connects to every server on its own, you’ve drawn chapter 5’s web again, with agents as the boxes: credentials everywhere, allowlists everywhere, and no single place that sees what every agent did.
So put one door in front of the tools.
Every agent, every tool, one door.
That’s chapter 18’s gateway, doing the job it was heading for. Salesforce’s own version is Agentforce Gateway, where “you can create and apply policies to govern MCP server usage and behavior, including rules for specific agents and MCP tools” (MCP for Agentforce (opens in a new tab)). Across vendors, the MCP gateways from module 4 do the same.
And look at what the picture is. A contract on every tool. Something in the middle that checks every call. A list of what each agent may call. The same three ideas from chapter 17, in their newest form. Chapter 23 adds the last piece: when the thing an agent calls is another agent.
Beyond the exam. Tool design and tool poisoning aren’t in the Integration Architect exam’s objectives. The exam’s security habits carry straight over: least privilege, a narrow contract, a review before anything new is trusted, and one place to control and log access.
What an Architect Decides Here
Section titled “What an Architect Decides Here”- The words on every tool you publish: one job, when to use it, every input, what it changes, and its version.
- Which servers and tools each agent may use, after the publisher and every description have been reviewed.
- The identity behind each agent, so a poisoned tool can’t do much.
- Which actions need a person’s approval.
- Who reviews a changed tool, and how quickly.
- The gateway in front of every tool, with the log in one place.
Explore
Section titled “Explore”- MCP for Agentforce (opens in a new tab), Salesforce Help (checked 2026-11-26): the checks for invisible characters and rug pulls, and Agentforce Gateway.
- General Best Practices (opens in a new tab), Hosted MCP Servers (checked 2026-11-26): designing tools.
- The Salesforce Developer’s Guide to the Winter ‘27 Release (opens in a new tab), Salesforce Developers Blog, 2026-10-09 (checked 2026-11-26): tools chosen by name and description.
- Register a Third-Party MCP Server in Agentforce Registry (opens in a new tab), Salesforce Help (checked 2026-11-26): the checks Salesforce runs when you register a server.
- Gateways and API Management: chapter 18, the door policy.
