Agentic tradingRiskMCPDevelopers

How to limit risk when AI agents trade through MCP tools and a single API

Learn how MCP trading tools and a single API create unique risks for AI agents, and how scoped keys, budget caps, and kill switches control them.

By the Felix team10 min read
Key takeaways
  • 01MCP trading tools insert an LLM interpretation layer between your intent and the order, which introduces risks that deterministic bots do not have.
  • 02A single API is convenient, but without scoped keys and market restrictions, a bug or compromise can affect every connected market type.
  • 03Hard budget caps and per-order limits are the final backstop; they enforce boundaries that the LLM cannot override even if it misinterprets a prompt.
  • 04Deterministic exit plans and a physical kill switch should be configured before any live capital is deployed, not after.
  • 05Paper trading tests integration, but real risk control is proven only under live conditions with a small, explicitly authorized budget and continuous logging.

When an AI agent connects to trading venues through MCP tools and a single API, it gains the ability to move capital across multiple market types with natural language instructions. This convenience introduces concentration risk, because one compromised session or misinterpreted prompt can affect every approved market. The controls that matter are non-custodial architecture, scoped permissions, strict budget caps, and a kill switch that the owner can trigger at any time.

MCP, or Model Context Protocol, is the standard that lets an LLM such as Claude or Cursor discover tools and call them on your behalf. When those tools include order placement, the LLM becomes an intermediary between your intent and the execution layer. That intermediary can misinterpret, hallucinate, or loop. The risk is not malicious intent but structural fragility: a language model parsing financial instructions with finite context and no innate understanding of loss.

What makes MCP trading tools different from traditional API integrations?

A traditional trading bot calls a REST endpoint with deterministic logic. The programmer writes the exact payload, the exact sequence, and the exact conditions. You can trace the exact execution path and patch it. The bot may contain bugs, but those bugs are usually reproducible and bounded by the code paths the developer wrote.

An MCP trading tool, by contrast, lets the LLM decide which function to call and what arguments to pass based on a conversation that changes with every prompt. This flexibility is useful for multi-market strategies. The agent can rebalance a portfolio, hedge a position, or take exposure across stocks, crypto, perps, options, and prediction markets without the developer hard-coding each venue's format. Felix normalizes order sizing to plain US dollars, so the agent does not need to compute contract multipliers or decimal precision. The agent does not need to know whether a perps venue uses notional or lot-based sizing, because the API translates the plain dollar amount into the native format.

However, the LLM still chooses the dollar amount, and that choice is where risk enters. Because the LLM interprets rather than executes, it may read 'reduce my exposure' as a flat command to sell everything, or 'buy a small amount' as a trade that exceeds your risk tolerance. The single API makes this efficient, but it also means the LLM has a unified door into every market you have enabled, so a single misinterpretation can cross asset boundaries instantly.

MCP tool calls are also opaque to the user in some clients. The LLM may summarize its action as 'I placed the trade' without showing the exact dollar amount or the venue until after execution. This latency in feedback means you might not catch an error until the position is already open. Requiring confirmation on every trade is one workaround, but it defeats the purpose of automation. Hard limits are the better compromise.

Why does a single API increase concentration risk?

One key and one API can reach five market types. That is the feature. The risk is that a single point of failure now spans your entire trading surface. If the key is over-scoped, an error in one market can cascade into others. Suppose the agent is authorized for stocks and perps and misinterprets a hedge command as a doubling of exposure in both markets. Without segmentation, the mistake is not isolated, and the combined exposure can exceed your total intended risk budget before you notice.

Non-custodial design limits the damage. Funds remain in a wallet you control. The agent can spend within limits but cannot withdraw to itself or to any address you have not explicitly approved. This means the worst case is bounded by what you permit, not by your total balance, which is why setting that permitted boundary correctly is the most important step in onboarding. Still, within that permitted boundary, the agent can lose money, including the entire allocated budget. Trading can lose money, including everything you allocate to the agent.

The defense is segmentation. Scoped keys let you restrict the agent to specific markets, specific sides, and specific position sizes. Budget caps create a hard ceiling on daily or total spend. These limits live at the API level, below the LLM, so they enforce boundaries even if the model behaves unexpectedly or a prompt injection tries to escalate privileges. How a single API changes safety for trading agents versus bots explains why this layer matters.

How should you scope permissions for an MCP trading session?

Every live trading session should start with the smallest viable scope. Ask which markets the agent actually needs, which actions it must perform, and how much capital it is allowed to touch. Then create a key that reflects only those requirements. If the strategy changes, you can issue a new key with adjusted limits rather than reusing a broad master key. The API will reject any request that falls outside the scope, regardless of how confidently the LLM asks.

  • ·Market scope: enable only the markets the strategy requires. If the agent is managing a stock portfolio, disable perps, options, and prediction markets for that key.
  • ·Action scope: restrict to buy, sell, or flatten. Do not grant cancel or modify permissions unless the strategy requires dynamic order management.
  • ·Position limits: set a maximum dollar value per order and per open position. This prevents a single oversized trade from consuming the entire budget.
  • ·Time bounds: set an expiration on the key. A session that auto-expires after twenty-four hours cannot be left running indefinitely by accident.
  • ·Budget caps: define a daily or total spend ceiling. Once the cap is reached, the API rejects further orders until you explicitly raise it.

Imagine you authorize a key for five hundred dollars total, two hundred dollars per order, stocks only, with a twenty-four hour expiry. Even if the LLM interprets 'aggressive entry' as a sequence of large orders, the second order above two hundred dollars is blocked, and the cumulative spend above five hundred dollars is blocked. Paper trading lets you observe these rejections safely and refine the prompt language before any capital is at risk. How to build guardrails for a trading agent provides a practical checklist for this process.

What are the common mistakes when sizing orders through natural language?

Natural language is ambiguous. An LLM does not know what 'a small bet' or 'heavy exposure' means in your personal financial context. Felix expresses orders in plain US dollars, which removes venue-specific math errors, but the LLM still has to translate your words into a number. Even a well-intentioned prompt like 'buy two hundred dollars of this token' can be misread if the conversation context shifts or the model confuses one asset for another. If you do not set explicit numeric limits, the model may choose a value that is technically valid but financially dangerous.

One frequent mistake is relying on the LLM to infer position size from portfolio percentage without defining the portfolio value. Another is giving open-ended instructions such as 'rebalance whenever you see divergence' without specifying the maximum dollar amount per rebalance trade. A third mistake is allowing the agent to retry failed orders automatically. A transient error might produce a partial fill; if the agent retries blindly, it can stack multiple unintended positions. The API can prevent the trade from executing, but it cannot prevent the LLM from attempting it, which is why logging and review are essential. Common position sizing mistakes when letting an AI agent trade real money examines these patterns in depth.

  • ·Vague modifiers: words like 'small', 'large', or 'aggressive' have no fixed dollar value. Always pair them with a numeric cap.
  • ·Implicit portfolio context: the LLM may not know your total net worth or the size of the wallet. State the budget explicitly or bind it to a hard cap.
  • ·Retry loops: configure the agent to halt on errors rather than retrying indefinitely. A stuck loop can generate orders faster than you can review them.
  • ·Cross-market double counting: if the agent trades multiple correlated assets through the same API, it may not recognize that combined exposure exceeds your risk limit. Set a global position cap where possible.

How do you build a kill switch and exit plan into the workflow?

Safety controls are only useful if they can be invoked quickly. A kill switch is a deterministic command that flattens all positions and revokes the active key. It should not rely on the LLM to decide whether to execute. The owner triggers it directly, and the API responds by closing exposure and cutting access. In practice, this means the kill switch endpoint should be callable from outside the MCP session, directly by the owner, without waiting for the LLM to process a natural language command. This is a hardware-level brake, not a suggestion.

Exit plans are the preventive counterpart. Before the agent enters a position, you should define the conditions under which it exits. These can be price-based stops, time-based rollovers, or budget-based drawdown limits. The safest approach is to let the API enforce these plans automatically rather than asking the LLM to re-evaluate the market and then decide. For example, a stop loss set at the API level will trigger when the market price crosses your threshold, even if the LLM is offline or the MCP session has stalled. Automatic execution removes interpretation delay and emotional drift.

The exact request schema is in the docs; the shape looks like this.

{
  "api_key": "YOUR_KEY",
  "command": "flatten_and_revoke",
  "markets": ["stocks", "perps"]
}

After the switch is triggered, the agent cannot place new orders because the key is invalidated. You can then audit the session, adjust the guardrails, and issue a new scoped key if you choose to resume. The important part is that the interruption is mechanical, not mediated by the model. You retain the final authority over capital.

Exit plans should be configured as parameters on the key or the order, not as instructions in the system prompt. A prompt-based exit rule relies on the LLM to monitor the market continuously, which is both unreliable and expensive. An API-level exit plan is evaluated by the trading infrastructure directly, so it executes even if the MCP session ends or the model loses context.

When should you switch from paper trading to live trading?

Paper trading lets you test the integration, observe how the LLM interprets your prompts, and verify that the API rejects out-of-scope requests. It is a necessary step, but it is not sufficient. Paper markets do not simulate liquidity gaps, slippage, or the psychological pressure of watching real money move. A fill that appears instant in paper mode may take seconds or longer in live markets, and the price can move against you during that gap. A strategy that looks smooth in simulation can behave differently when fills are live.

Move to live trading only after you have observed the agent through multiple prompts and confirmed that the guardrails fire correctly. Start with a small budget that you can afford to lose entirely. Explicitly authorize the live key for a short duration and a narrow scope. How to start an AI agent with a small budget offers guidance on sizing that first allocation.

Once live, review the logs regularly. Look not only at profits and losses but at the LLM's reasoning trace. Check whether it misinterpreted any prompts and whether the API blocked those requests. If you see near-misses where the model attempted to exceed limits, tighten the scope before expanding the budget. Live testing is part of risk control, not a reward phase. Risk control is a process of continuous tightening, not a one-time setup that you forget after launch.

Frequently asked questions

Can an MCP trading tool withdraw my funds to an external wallet?

No. Felix is non-custodial by construction. The agent can spend within your set limits but cannot change withdrawal addresses, which are owner-approved only.

What happens if the LLM misinterprets my prompt and sends a large order?

Hard budget caps and per-order limits enforce the ceiling at the API level. The LLM request is blocked if it exceeds the scoped key's limits, regardless of what the prompt intended. You should still review logs to catch near-misses and tighten the prompt language.

Does a single API mean all my markets are exposed if the key is compromised?

Only if you scoped the key broadly. You can create narrowly scoped keys that restrict the agent to specific markets, position sizes, and action types. This segmentation limits the blast radius of any single error or compromise.

Is paper trading enough to verify safety before going live?

Paper trading validates logic and integration, but it does not simulate liquidity, slippage, or your reaction to real losses. Use it to test guardrails and prompt behavior. Then start with a small live budget to observe how the system performs under actual market conditions.

How quickly can I stop an agent that is trading live?

The panic switch flattens positions and revokes the key in one action. You retain manual control and can halt the agent faster than it can place new orders. The revocation is immediate and does not depend on the LLM cooperating.

Should I let the LLM decide when to take profits or stop losses?

It is safer to set deterministic exit plans that trigger automatically. Relying on the LLM to interpret market conditions and then exit introduces unnecessary latency and interpretation risk. API-level exits execute even if the model is offline or the session has stalled.

Give your agent a key.

One key to trade stocks, crypto, perps, options, and prediction markets. Live after owner authorization.

Keep reading

Not a brokerage, exchange, or investment adviser. Not investment advice. Trading involves risk, including total loss.