Sooner or later, somebody in management asks for an AI tool that delivers daily financial reports. The reporting API behind it has fed internal dashboards for years, it never leaves the corporate network, and the team that built it knows every one of its quirks. A few days later, a Model Context Protocol (MCP) server wraps that API, and an AI agent calls it on behalf of whoever asked a question that morning. Nothing about the API changed that week, except for the reader at the other end, and that reader has never met its developers.
Every API carries knowledge that never made it into its contract. Developers learn that an HTTP 500 error from the export service usually means trying again in five minutes, and that closing an accounting period twice leaves the ledger in a state nobody wants to explain to the auditors. They pick this up from a colleague or from a painful afternoon in the test environment. An agent has the contract and nothing else, and it acts on what the contract says at machine speed.
In the previous post in this series, Who Said the Agent Could Do That, we argued that authorization decisions for agents belong with an external decision point that sees the operation, the object and the delegated identity on every call. This post looks at what that decision point needs from the APIs behind those calls, and at how rarely their contracts can provide it.
What Does a Machine Need to Know?
The market segment definition for our upcoming Leadership Compass on API Security and Governance names five design attributes that decide whether an interface can be consumed safely without human judgment: naming clarity, documented side effects, idempotency, machine-readable errors and documented state models. API designers have debated each of them for well over a decade, mostly as a question of developer experience, and agents now raise the price of getting them wrong considerably.
When an operation called prepareOffer() also emails the offer to the customer, a human developer will usually notice the discrepancy in testing and file it as a naming problem, while an agent takes the name as the specification and acts accordingly. Undocumented side effects are where most of the damage hides: notifications that go out and downstream workflows that start without anyone asking for them.
Agents also retry, because orchestration frameworks retry on timeouts and models retry when a result looks wrong. An operation that is not idempotent, and whose contract does not say so, turns every retry into a duplicate payment, order or ledger entry. Errors that explain nothing make this worse, because an agent that cannot tell what failed will try again or improvise a different route to the same goal. Machine-readable errors that state what failed and whether a retry is safe give it a way to recover instead.
The same applies to state models: if an invoice can move from draft to approved to paid but never back, and the contract does not document that state model, an agent will discover the restriction by trial and error, and it will most likely make that discovery in production.
Taken together, these attributes decide how much damage an agent can do while following its instructions to the letter, which moves them from the developer experience backlog onto the agenda of your security team.
Can the Protocol Fix This?
The MCP specification already acknowledges much of this. It separates protocol errors from tool execution errors, which carry actionable feedback that a model can use to correct itself and retry. Its non-normative guidance on stateful tools asks servers to return explicit handles and to state their lifetime in the tool description. Tools can also carry annotations that hint at whether they are read-only, destructive or idempotent.
The same specification is clear about how far those hints go: clients must treat tool annotations as untrusted unless they come from trusted servers. An annotation is a claim made by whoever wrote the server, and in practice an MCP server wrapped around an existing API inherits whatever that API's contract does or does not say. A tool marked as read-only on top of an endpoint with an undocumented side effect is worse than no annotation at all, because it gives the client a reason to skip the confirmation step.
For API owners, this raises the bar: their contracts now have to be trustworthy enough to feed a security decision, not just good enough for the developers who read them. The external decision point we described in the previous post can only route a destructive operation to a human for approval if something reliable tells it the operation is destructive, and in most organizations we speak with, nothing does yet, because the contract is silent on the matter and any annotation merely repeats what the server author assumed.
Where Does the Fix Belong?
Our market segment definition files these attributes under contract governance and pre-production validation, next to linting, security tests derived from the contract, and detection of drift between specification and implementation. Runtime detection that notices an agent calling the same payment operation twice remains necessary, but it can only react once the duplicate payment has already gone out. Establishing before release that the operation is not idempotent is a design-time task, and the contract is the one place from which that fact reaches the generated MCP server, the test suite and the runtime policy at the same time.
The vendor briefings we have held for the upcoming Leadership Compass show how early the market still is here. Some vendors told us plainly that they do not assess these design attributes yet, and others cover parts of them through general-purpose linting rules rather than checks built for agentic consumers. The report will have the details, but you should not expect to find this capability off the shelf in the next few months.
A Simple Test for Every API an Agent Can Reach
Finding out where an API stands takes an afternoon and no tooling. Hand its contract to an engineer who has never seen the API, and ask them to predict, operation by operation, what each call changes and whether it is safe to repeat. Every wrong prediction marks a place where an agent will go wrong as well, only faster and without asking anyone first. The test applies to every API an MCP server can reach, including the ones that never leave the corporate network, and it belongs before the server goes live rather than after the first incident.
Fixing what the test finds is mostly unglamorous work. Side effects, idempotency and state transitions belong in the contract itself rather than in a wiki page or in the heads of the original developers, and errors need to say what failed and whether a retry makes sense. The bigger gain comes from generating MCP servers, contract-derived tests and runtime policy from that same contract, because an inaccurate contract then breaks the build instead of misleading the next reader without anyone noticing. Drift between documented and observed behavior, including drift in tool lists and descriptions, becomes a security finding rather than a documentation bug.
For most of their history, APIs were written for other developers, and their documentation had a reliable audience problem: developers skimmed it, copied an example and asked a colleague about the rest. Agents have solved that problem in the least comfortable way possible, because they read every word and believe all of it. If you own an API that an agent can reach, you can make its contract worth believing, or you can keep discovering, one incident at a time, what it left out.
If you would like to discuss how your own APIs would fare in the test described above, our analysts are available for an inquiry.