Anyone who has run an agent for long enough has watched it do something nobody asked for. In a notes app that costs a stray entry. On a trading account it costs a position. The useful design question is not how to stop a model ever going wrong, but where its mistakes stop.
JAFX gives one answer in the way its MCP server lets AI agents near client accounts. It is worth studying even for builders who never touch a market: bad instructions, retries, injected text and runaway loops turn up in every agent that can act.
Proposals should be the default
JAFX’s keys come in three presets. Read only sees prices and the account. Trading places orders directly. Proposals, which the docs recommend for AI agents, turns every order into a request that waits: the call returns awaiting_confirmation, nothing reaches the broker, and the account owner confirms or rejects it in the web terminal. A proposal nobody confirms expires after 10 minutes, and it is checked against the key’s limits both when it is created and again when a confirmed one executes.
The docs sum it up: “the agent does the analysis, you keep the last word.” That costs a tap per trade, and the tap is the point. Few retail strategies need an agent faster than a person reading a one-line summary such as BUY 0.01 EURUSD market.
Put the limits under the model, not in the prompt
A system prompt is a request, and a confused or manipulated model can ignore it. JAFX puts the rules where the model can’t reach them: the server checks each key’s limits before anything goes to the broker, whatever the agent sends.
The JAFX API limits page lists every number. On demo, a key defaults to 1.00 lot per order, 20 open positions and pending orders, 30 orders a minute and a daily loss stop at 10% of the day’s starting equity. Live keys start at 0.10 lot, 10 positions, 10 orders a minute and 2%. Keys can also be held to a list of symbols and IP addresses. Breaches come back as typed refusals, such as volume_limit_exceeded or daily_loss_limit_reached, rather than as text the agent might misread.
The daily loss stop is a model guardrail. Once reached, new positions are refused until the next trading day, while closing and reducing still work and nothing is closed for the trader. It limits damage without acting on its own.
Several smaller choices matter as much:
Scopes shrink the tool list. An agent with a read-only key never even sees the trading tools.
Retries can’t double up. Every order carries an idempotency key, and a retry with the same key is never placed twice.
Outside text is marked as data. Text JAFX didn’t write, such as an order comment or a help-centre snippet, reaches the model as untrusted_content, with a note that it is never instructions.
Stopping is easy; starting is not. Any key, read-only included, can call stop_api_trading. Nothing over MCP starts trading again: that takes a human sign-in or Renew.
Refusals say what to do next. Each one carries a plain next line for the model, which helps keep an agent from looping on an error.
Start on demo, and mean it
JAFX’s docs tell developers to build and test on a demo account with virtual money, where orders go through the same routing as live. The structure enforces it in places. An AI app connected by sign-in can trade without asking only on a demo account; on live it can read or propose. The two example bots in the docs refuse to run unless their key belongs to a demo account.
Demo is also where to read the log. Every call a key makes, refused ones included, is kept for 180 days under Activity, and agents can read it with get_activity. What an agent tried and was refused teaches more than what it did.
None of this makes an agent profitable or careful. The docs are blunt: “Automated and AI-driven trading can lose money quickly.” Scoped keys, server-side limits and proposals put a ceiling on how bad a mistake can get, and keep a person between the model and the money.

