Agentic tradingRisk managementLLM safetyNon-custodial

How to control the risks of LLM-powered trading without giving up custody

LLM trading agents can hallucinate, loop, or misread signals. Non-custodial infrastructure and scoped controls let you limit exposure without surrendering fund ownership.

By the Felix team8 min read
Key takeaways
  • 01An LLM trading agent can hallucinate instructions, misinterpret market data, or enter infinite loops that generate repeated orders.
  • 02Non-custodial architecture ensures the agent can spend within owner-defined limits but can never withdraw funds to itself or an external address.
  • 03Scoped API keys, budget caps, and position limits should be configured before any live key is authorized, not after the first trade.
  • 04Paper trading reveals how an agent behaves under realistic conditions without exposing capital to actual market losses.
  • 05A panic switch that flattens positions and revokes access is the final layer of defense when automated behavior diverges from intent.

LLM-powered trading agents can hallucinate instructions, misinterpret real-time data, and execute orders that diverge from your intent. The core risk is not that the model is malicious, but that it is probabilistic and can act on wrong assumptions with real money. Non-custodial infrastructure lets you keep funds in a wallet you control while the agent operates within strict, pre-defined spending limits. The way to control these risks is to layer defensive controls, scoped keys, budget caps, paper testing, and a kill switch, before the agent ever touches a live market.

What can go wrong when an LLM decides to trade?

Large language models generate text based on statistical patterns, not verified facts. When connected to a trading API, a model might invent a ticker symbol that does not exist, misread a news headline as a price signal, or interpret an injected instruction in a social media feed as a valid command from the owner. An agent can also enter a feedback loop where it repeatedly issues the same order because it mistakes its own previous trade confirmation for new market data. Even when the model has access to real-time market data, it may overweight recent headlines, confuse bid and ask formatting, or assume correlation where none exists. Because the reasoning is wrapped in natural language, the error can look coherent until you trace it back to the raw inputs. These failures do not require a bug in the trading API or the wallet infrastructure. They can arise from ambiguous prompts, noisy context windows, or the model’s tendency to confabulate details when it lacks certainty. In traditional automation, a rule is deterministic. In LLM-based systems, the same input can produce different outputs depending on temperature, context length, and prior conversation history. This means risk management must account for stochastic behavior rather than simple code errors. The agent might reason convincingly about a trade while being completely wrong about the underlying facts. You cannot assume that a well-written prompt eliminates this possibility. You can only assume that the model will eventually produce an output you did not expect, and design the system to absorb that shock without catastrophic loss.

How does non-custodial architecture change the risk profile?

Custodial platforms require you to deposit funds into an account that the platform controls. If an agent goes rogue on such a platform, it can often trade, transfer, or withdraw within the permissions you granted, and recovering funds can be difficult or impossible. Non-custodial design flips this relationship entirely. Your funds remain in a wallet you own, and the agent receives only a scoped key that authorizes spending within boundaries you set during setup. The agent cannot withdraw to an arbitrary address because withdrawal destinations are owner-approved by construction and cannot be altered by the agent. Even if the agent is compromised, hallucinates aggressively, or receives malicious instructions from an external source, the financial damage is bounded by the budget cap and position limits you configured. The worst-case scenario is loss of the allocated budget, not loss of the entire wallet balance. This distinction is critical for algorithmic traders who are used to depositing entire portfolios onto a single venue. In a non-custodial model, the API normalizes order sizing in plain US dollars, which removes the ambiguity of venue-specific contract math and makes it easier to reason about exposure at a glance. This architecture is explained in more detail in our overview of how an AI agent executes orders while you keep full custody.

What controls should you set before the first live order?

Risk management for an LLM agent should be proactive, not reactive. Start with a scoped key that restricts the agent to specific markets and order types, so it cannot accidentally or deliberately access instruments you never intended to trade. Add a budget cap denominated in plain US dollars so the agent cannot obscure true notional exposure behind venue-specific contract multipliers or decimal conventions. Set position limits to prevent concentration in a single instrument, and define an exit plan that triggers under conditions you specify, such as a drawdown threshold, a time-based flattening rule, or a volatility spike. You should also consider time-based restrictions, such as limiting the agent to specific trading hours or session windows, so that overnight drift or low-liquidity periods do not trigger unexpected behavior. Common mistakes with scoped API keys for trading agents shows how misconfigured scopes can silently expand an agent’s authority beyond what the owner intended. The goal is to make the infrastructure enforce your constraints, because you cannot rely on the LLM to respect them voluntarily.

  • ·Scope the key to specific markets and order types, excluding withdrawals and transfers.
  • ·Cap the total budget in US dollars across all positions.
  • ·Limit maximum position size per instrument to avoid concentration.
  • ·Require owner approval for any new withdrawal address.
  • ·Define drawdown or time-based exit triggers that flatten automatically.

Why is paper trading necessary before live authorization?

Paper trading lets you observe how an agent behaves when market data is real but the money is not. This distinction matters because an LLM might generate plausible sounding reasoning that falls apart when checked against actual price feeds, liquidity conditions, and order book depth. During paper testing, watch for repeated orders, incorrect symbol resolution, and overreactions to news headlines that the model misinterprets as actionable signals. Look for cases where the agent tries to trade outside its scoped permissions and confirm that the API rejects those requests cleanly. You should also test the kill switch during paper sessions to verify that it flattens positions and revokes access within the expected timeframe. Document every instance where the agent produces a surprising rationale, even if the trade would have been profitable. Profitability does not equal correctness, and a lucky mistake is still a mistake that will eventually repeat under different conditions. Our guide on how to evaluate paper trading for an AI agent before live markets covers the specific behaviors to log and review. Only after the agent behaves consistently across multiple sessions should you authorize a live key, and even then, start with the smallest budget cap that still permits meaningful execution. Trading can lose money, including everything, and paper trading is the stage where you catch dangerous patterns before they cost capital.

How do kill switches and exit plans work in practice?

A kill switch is a manual or automated mechanism that immediately flattens open positions and revokes the agent’s API access. It exists because no amount of prompt engineering or pre-deployment testing can guarantee zero errors in production markets, especially when the agent is reacting to real-time data it has never seen before. An exit plan is the automated counterpart: a set of rules that close positions and pause trading when predefined thresholds are breached. For example, you might specify that the agent must flatten all positions if the portfolio drops by a certain percentage, or at the end of each trading session regardless of profit or loss. Some traders choose to implement a tiered exit plan, where the first threshold reduces position size, the second pauses new orders, and the third triggers full flattening and revocation. This graduated approach prevents overcorrection from single volatile ticks while still protecting the bulk of the capital. These controls are not suggestions or soft guidelines. They are hard limits enforced by the infrastructure, not by the agent, and they operate independently of the model’s reasoning. Why AI agents force developers to rethink trading risk management discusses why static stop losses designed for human traders are often insufficient for autonomous systems that can place dozens of orders per minute. The kill switch is the final layer of defense when behavior diverges from intent.

How should you monitor an agent without micromanaging it?

Constant oversight defeats the purpose of automation, but zero oversight is dangerous with a probabilistic system. The middle ground is structured logging and alerting that surfaces anomalies without requiring you to watch every tick. Configure alerts for anomalous order frequency, repeated rejections from the API, or budget cap drawdowns that happen faster than your backtesting suggested. Review logs periodically to see if the agent’s reasoning chain is drifting from your original strategy, especially if you are updating prompts or data sources over time. If you are running multiple agents, tag each order with its agent identifier so you can attribute behavior correctly. An anomaly in one agent should not trigger a global shutdown unless the underlying strategy or key scope is shared. Do not change the strategy or key scope in response to a single unusual trade. Instead, observe the pattern over a meaningful sample. If the agent consistently misinterprets a specific data source, refine the prompt or filter the data feed rather than raising limits to let it recover losses. Trading can lose money, including everything, and monitoring exists to catch divergence early, not to guarantee profits or prevent all losses. The goal is to detect when the agent is no longer operating inside the statistical bounds you expect, so you can intervene before the error compounds.

LLM-powered trading introduces risks that deterministic bots do not, primarily because the model’s output is stochastic and context-dependent. Non-custodial infrastructure does not eliminate these risks, but it contains them by keeping fund ownership separate from agent execution. The combination of scoped keys, budget caps, paper testing, exit plans, and kill switches creates multiple layers of defense that limit the blast radius of any single mistake. You do not need to surrender custody to automate trading. You need to automate the boundaries within which the agent can operate, start small, test thoroughly, and treat the LLM as a capable but unreliable collaborator whose hands you keep inside a locked box.

Frequently asked questions

Can an LLM trading agent steal my funds?

No. In a non-custodial setup, the agent holds a scoped key that can only place orders within limits you set. Withdrawal addresses are owner-approved, so the agent cannot send funds to itself or an external wallet.

What happens if the agent hallucinates a trade?

The order is still subject to the scoped key’s permissions and budget caps. If the agent invents an invalid symbol or exceeds a position limit, the API rejects it. If it passes the checks, the loss is bounded by the pre-set cap.

Is paper trading enough to guarantee safe live behavior?

No. Paper trading reveals many failure modes, but live markets involve slippage, latency, and emotional pressure that paper environments cannot fully replicate. It is a necessary filter, not a proof of safety.

How quickly can I shut down an agent that is acting strangely?

A panic switch flattens positions and revokes the API key immediately. You should verify that this mechanism works during paper testing before any live trading begins.

Should I start with a large budget cap if my strategy looks good on paper?

No. Start with the smallest budget cap that allows meaningful execution. You can raise limits only after observing consistent, correct behavior over multiple live sessions.

Does non-custodial trading mean I cannot lose money?

No. Trading can lose money, including everything. Non-custodial architecture limits the agent’s authority and prevents theft, but it does not prevent market losses from bad trades.

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.