Agentic tradingRiskDevelopersSafety controls

How guardrails for trading agents break in practice

Guardrails for AI trading agents fail when budget caps are too vague, kill switches go untested, and dollar-based sizing hides real exposure across a single non-custodial API.

By the Felix team9 min read
Key takeaways
  • 01A budget cap without position limits and rate controls can be spent instantly, leaving a portfolio of open positions that still carry risk.
  • 02A kill switch that has never been tested in paper trading may fail under the latency and stress of a live market downturn.
  • 03Dollar-based order sizing simplifies the API but masks notional differences across stocks, options, and perpetual futures.
  • 04Scoped keys that are too broad remove the isolation benefits of a non-custodial system and increase the blast radius of a bug.
  • 05Paper trading validates strategy logic, not safety infrastructure; live guardrails must be rehearsed against real slippage and rejection patterns.

Guardrails for AI trading agents fail most often because owners set limits that are too vague, test them only in paper trading, or assume that a single budget cap is enough to prevent loss, especially when one API reaches stocks, crypto, perpetual futures, options, and prediction markets. A non-custodial API can enforce hard boundaries, but those boundaries only work if they are scoped, tested, and paired with an exit plan that the owner understands. Many mistakes come from treating safety controls as configuration rather than as operational infrastructure that requires rehearsal. Trading can lose money, including everything, and no guardrail removes that underlying risk.

Why do budget caps feel safe but still allow ruin?

Budget caps are the first control most owners configure because they translate risk into a simple number. You might set a daily spend limit of one thousand dollars and assume the agent cannot hurt you beyond that amount. The mistake is that a cap is a ceiling on outflow, not a throttle on speed or a limit on position concentration. Without per-order size limits, per-venue restrictions, or rate controls, the agent can hit the daily budget in seconds through a burst of orders. Once the cap is exhausted, the owner is left with a portfolio of positions that may be illiquid, correlated, or simply wrong. The real risk is not just the dollars spent, but the positions that remain open after the money is gone. Those positions can decay, gap, or accumulate funding costs while the owner waits for a recovery that may never come. Owners also forget that open positions have carry risk. An agent that buys a leveraged future and then hits its budget cap still holds a position that can gap against the owner overnight. A budget cap also does not account for path dependency. If the agent loses the daily budget early in the session, the owner may reset the cap manually out of frustration or optimism, which defeats the purpose of the limit. The cap becomes a suggestion rather than a hard rule. When a limit is treated as flexible, the agent learns nothing and the owner absorbs the full downside. To make budget caps useful, they must sit inside a broader control structure that includes position limits, maximum order sizes, and a clear rule about whether the cap auto-resets or locks until manual review. How to manage risk when you let an AI agent trade covers how to layer these controls so that no single limit carries the entire burden.

Why is the kill switch useless if you never test it?

A panic or kill switch is designed to flatten positions and revoke the agent's access in seconds, yet many owners treat it as a last resort they will never need. They configure it once, verify that the toggle exists in the dashboard, and then move on to strategy tuning. This is a mistake because an untested switch is only theoretical. In a live market, flattening requires crossing the spread, handling partial fills, and dealing with API latency. If you have never triggered the switch in paper trading, you do not know whether your positions will close in the expected sequence or whether the revocation will complete before the agent sends another order. The sequence matters too. If the agent has open orders across multiple venues, the switch must cancel all working orders before it flattens, or the agent may get filled on stale orders while the system is trying to exit. Testing should be adversarial. You should deliberately create a scenario where the agent is actively placing orders, then trigger the switch and measure how long it takes for the system to reach zero exposure and zero permissions. You should also verify that the revocation is irreversible until you manually reauthorize the key. If the switch merely pauses trading, rather than destroying the session and flattening, then it is not a kill switch. It is a pause button, and pause buttons do not protect against flash crashes or runaway logic. A true kill switch must be binary and final, leaving no room for the agent to resume or negotiate. How to execute orders safely with an AI agent in 2026 discusses how to rehearse these sequences before going live.

Why does dollar-based order sizing hide real exposure?

Felix normalizes orders into plain US dollars across all five market types, which removes the need for the agent to understand venue-specific contract math. Owners often mistake this simplification for risk reduction. They think that a five hundred dollar order is a five hundred dollar risk regardless of whether the agent is buying a stock, an option, or a perpetual future. This is incorrect. A five hundred dollar allocation to a stock is a directional bet with simple delta. The same nominal allocation to an option can carry convexity and time decay that magnifies the economic exposure well beyond the dollar amount. In perpetual futures, the same size can be leveraged by the venue's margin structure, meaning the notional risk is larger than the cash allocated. The single API makes this especially easy to miss because the interface looks identical for every market. The agent does not need to know the difference, but the owner does. The mistake is to set dollar-based budget caps and position limits without translating those dollars into the actual risk parameters of each instrument. The API normalizes the input, but the market does not normalize the payoff. Owners should map their dollar limits to volatility-adjusted or notional-adjusted thresholds for each market type. Otherwise, the agent will concentrate in the instruments that use the budget most efficiently, which often means the instruments with the highest implicit leverage. How to control the risks of dollar-based order sizing through a single API explains how to think about sizing when one API spans multiple instrument types.

How do scoped keys become too broad?

Scoped keys are a core feature of non-custodial agent trading. You can restrict a key to a single market type, a narrow time window, a small set of instruments, and a specific wallet. The mistake is that owners gradually relax these scopes over time. They start with a key scoped to a single stock broker, then add a crypto venue for diversification, then enable perpetual futures because the strategy calls for hedging. Each addition seems reasonable in isolation, but the composite key ends up with access to five market types, twenty-four hour trading, and broad instrument whitelists. The blast radius expands without a proportional expansion of oversight. Some owners also whitelist withdrawal addresses casually, adding new addresses without a fresh review. Since the non-custodial model only allows owner-approved withdrawals, a broad whitelist undermines that protection. Another common error is to reuse the same scoped key across multiple agents or strategies. If one agent misbehaves, the key revocation affects all of them, which creates a dilemma during a crisis. You may hesitate to kill the key because it will also halt a profitable strategy running in parallel. The correct approach is to issue separate keys for each strategy, each with its own budget cap, position limit, and exit plan. This keeps the failure domains isolated. How the Felix architecture keeps AI trading agents secure describes how key scoping and non-custodial wallets work together to limit what any single compromised or buggy agent can touch.

Why do paper trading guardrails mislead live deployments?

Paper trading is a useful sandbox for validating strategy logic, but it is a poor environment for validating safety infrastructure. The mistake is to assume that a guardrail which works in paper mode will behave identically in live trading. In paper mode, orders fill instantly at the last traded price, there is no slippage, and the kill switch flattens positions without crossing a spread or facing partial fills. API rate limits are often relaxed, and rejected orders are rare. When the same guardrails move to live trading, the agent encounters real market friction. A budget cap that was never hit in paper mode may be consumed faster in live markets due to slippage. A kill switch that flattened instantly in simulation may take seconds or minutes in reality, during which the agent continues to act if the revocation is not atomic. Latency is another hidden variable. In simulation, the kill switch is a local function call. In production, it travels over the network and must compete with the agent's own order flow for priority. The emotional context also changes. In paper mode, triggering the kill switch is a calm experiment. In live trading, it is a stress response, and owners may delay pressing it because they hope the market will reverse. Paper trading should test the strategy, but the safety stack must be rehearsed against live conditions with small capital, or at minimum with realistic fill simulation. If you have not seen your guardrails fail in a controlled way, you have not validated them.

What does a tested safety stack look like?

A reliable safety stack is layered, narrow, and rehearsed. It does not rely on any single control. Instead, it combines several independent limits that must all align before the agent can act freely.

  1. 01A scoped key that grants access to only the markets and instruments the strategy actually needs.
  2. 02A budget cap that is conservative enough to survive a sequence of bad trades without wiping out the account.
  3. 03A position limit that prevents the agent from concentrating too heavily in one direction or one instrument.
  4. 04An exit plan, either automated or manually triggered, that defines when to take losses and stop trading.
  5. 05A kill switch that flattens and revokes, tested monthly under adversarial conditions.

Trading can lose money, including everything, and these layers only limit the speed and scope of that loss. They do not guarantee profit or prevent all drawdowns. Many owners make the mistake of setting these controls once and forgetting them. A tested stack requires periodic review. You should check the logs to see whether the agent brushed against soft warnings before hitting hard limits. If it did, that is a sign the limits are too tight or the strategy is too aggressive. You should also rotate scoped keys periodically and verify that old keys are fully revoked. Finally, you should document the human decision tree. If the kill switch fires, who decides when to reauthorize? If the budget cap locks, who evaluates whether to raise it? Without human clarity, the agent will sit idle while the owner debates, or worse, the owner will override the controls impulsively. That documentation is as important as the technical limits themselves.

Frequently asked questions

Can a budget cap alone protect my account?

No. A budget cap limits total outflow but does not control position concentration, leverage, or speed of execution. Without per-order limits and position caps, the agent can burn through the budget in seconds and leave you with risky open positions.

Should I use the same guardrails for paper and live trading?

Paper trading is useful for logic, but live guardrails must be calibrated for slippage, partial fills, and API latency. You should test the same control values in both environments, but expect them to behave differently under live market friction.

How often should I test the kill switch?

Test it monthly in paper mode with the agent actively placing orders, and verify that it flattens positions and revokes the key fully. You should also rehearse the human decision steps for reauthorization so you do not hesitate during a real event.

What happens if the agent hits a position limit but the market keeps moving?

The position limit stops the agent from adding to the trade, but it does not close the existing position. The market can still move against you, so you need an exit plan or stop logic separate from the position limit.

Can I change guardrails while the agent is running?

Yes, but changes should go through a deliberate review rather than an impulsive override. Rapidly raising a budget cap or widening a scoped key during a losing streak often defeats the purpose of the safety system.

Why does a scoped key matter if I trust the agent?

Trust is not the issue; bugs and edge cases are. A scoped key limits the blast radius of a logic error or unexpected market condition. It also prevents a compromised API key from accessing markets or instruments outside your intended strategy.

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.