How to build your first automated exit plan without losing control
Automating exits and take profits introduces new failure modes. Hard limits, scoped keys, and non-custodial controls let you test safely before committing real capital.
- 01An automated exit plan is only as safe as the hard limits underneath it.
- 02You must define the exact price source, percentage, and position percentage to close before the agent enters.
- 03Paper trading proves the plumbing works, but it does not prove the psychology or slippage will behave the same way.
- 04A scoped key with a budget cap and a manual kill switch should be enabled before any live exit automation runs.
- 05Trading can lose money, including everything, and automation can accelerate both losses and missed opportunities if the instructions are ambiguous.
Automating an exit plan means a machine decides when to close your position, which removes the hesitation that protects capital but also removes the hesitation that prevents mistakes. The risks are mechanical: a misconfigured threshold, an ambiguous prompt, or a missing guardrail can trigger at the wrong time or not at all. You control these risks by layering hard limits underneath the strategy, testing in paper mode, and keeping a kill switch within reach before you delegate a single close order to an agent.
Why is automating an exit plan different from clicking sell manually?
Manual trading follows a human cadence. You watch a chart, feel the drawdown, debate with yourself, and eventually click sell. That delay is expensive, but it is also a crude filter for impulse. When you delegate the exit to an agent, the delay disappears, and so does the filter. The agent does not hesitate, reconsider, or check a second chart. It executes the instruction literally, at the speed of an API call.
This changes the nature of risk. In manual trading, the danger is usually that you do nothing while a loss grows. In automated trading, the danger is that the machine does exactly what you told it to do, but what you told it was incomplete. For example, if you tell an agent to cut losses early, it has no inherent definition of early. Without a numeric threshold, an LLM may interpret the instruction differently across market conditions. One day it might close at a two percent dip. The next day, in higher volatility, it might wait for ten percent because the prompt never specified an absolute boundary.
The emotional distance is another factor. When you click sell yourself, the loss is immediate and visceral. When an agent closes the position, you receive a notification after the fact. That detachment can lead to slower recognition that the strategy itself is flawed. You may blame the venue, the latency, or the fill price before you accept that the exit logic was wrong. Before you automate any exit, you should understand that you are trading human reaction time for mechanical precision, and precision requires exact specifications. If you are connecting through an AI editor or MCP client, the translation layer from natural language to order adds another place for intent to drift. How to control risk when an AI agent trades through MCP covers that translation layer in more detail.
What can go wrong when a machine closes your position?
Several failure modes appear only when a machine is responsible for the exit. The first is threshold ambiguity. A stop loss needs a reference price, a trigger condition, and a tolerance for wicks or index deviations. If your agent watches the last traded price on one venue while your liquidation logic uses a mark price elsewhere, the stop may fire too late or too early. You must state which price source matters.
The second failure mode is partial fills. Suppose your agent sends a market order to close a position, but the book is thin and only twenty percent fills. The agent may log the order as submitted and assume the position is flat, leaving eighty percent exposed. Without explicit follow-up logic, the remaining exposure sits unprotected. You need to instruct the agent to verify the position size after the order and resubmit if necessary, or you need to size the original order so that a partial fill is still acceptable.
Third, network or venue lag can turn a stop loss into a slip loss. In fast markets, the price may move through your trigger level before the order reaches the venue. The agent cannot will the network faster. This is not a bug in the agent, but it is a risk in the automation that does not exist when you are staring at the screen and can choose to chase or wait.
Fourth, overtrading around small targets. A take profit at three percent and a stop loss at three percent, combined with frequent re-entry, can create a churn that bleeds fees and spreads. The machine does not feel fatigue. It will hit your take profit, re-enter, hit your stop, re-enter, and repeat until you run out of budget or the scoped key hits its cap. This is why position sizing and exit frequency matter as much as the exit price itself. Common position sizing mistakes when letting an AI agent trade real money explains how small sizing errors compound when an agent loops quickly.
How do hard limits keep an automated exit from running away?
Hard limits are the floor beneath your strategy. They do not improve your edge, but they prevent a misconfigured exit from draining your wallet. The Felix model uses several layers.
- ·Budget caps are the simplest. You allocate a maximum dollar amount the agent can lose in a day, week, or month. Once the cap is hit, the key refuses further orders. This is useful when an exit plan fails to fire and the agent tries to average down instead, or when a churning strategy racks up losses faster than you expected.
- ·Position limits restrict the maximum notional value the agent can hold. If an exit partially fills and the agent attempts to hedge or double down, the position limit blocks the new order and keeps exposure bounded.
- ·Scoped keys restrict what the key can do. An exit-plan key can be permissioned to close only, meaning it cannot open new positions or withdraw funds. Even if the agent logic goes haywire, it cannot increase risk, only reduce it.
- ·The panic or kill switch is the final layer. It flattens all positions and revokes the key. You should know where this button is before you need it, and you should test that it works in paper mode.
How hard limits control the remaining risks of non-custodial agent trading walks through how these limits interact when multiple markets are involved. These limits are non-custodial by construction. Your funds sit in a wallet you control. The agent can spend within the limits you set, but it cannot withdraw to itself or to an address you have not pre-approved. Withdrawal addresses are owner-approved only.
How should you test an exit plan before it touches real money?
Paper trading is the obvious first step, but it is not sufficient. Paper mode proves that the agent can send an order and that the webhook or MCP tool responds. It does not prove that the fill price will match your trigger in a live market with real slippage. It also does not test your own reaction to seeing the agent close a position you would have held.
Start by testing the simplest possible exit. One position, one take profit level, one stop loss level, no trailing logic. Watch the agent execute in paper mode for several sessions. Verify that it closes the full position, not a fraction. Verify that it uses the price source you intended. If you are using natural language prompts, check whether the LLM interprets sell half at five percent the same way every time.
After paper testing, move to live trading with the smallest position size your risk tolerance allows. Enable every hard limit. Set the daily budget cap to an amount you can lose without changing your lifestyle. Set the scoped key to close-only if you are only testing exits. Monitor the first few executions manually.
It is also worth testing the failure paths. Simulate a partial fill in paper mode if the platform allows it. Test what happens when the network is slow. Test the kill switch while a position is open. Common mistakes developers make with paper trading for AI agents lists assumptions about fill guarantees that often break when moving to live markets.
What does a minimal safe exit plan look like in practice?
A safe first plan has few moving parts. Complexity is the enemy of control when you have never automated a trade before.
Define the entry criteria and the exit criteria before the agent enters. Do not decide the stop loss after the position is underwater. Write the exit rules in the same prompt or configuration where you write the entry rules. If you separate them, the agent may enter with one set of instructions and exit with another, creating a mismatch during fast moves.
Use absolute numbers or percentages anchored to the entry price. For example, close the entire position if the mark price drops five percent below the average entry price. Avoid relative terms like if it looks weak or if the trend breaks. The agent cannot see the chart the way you do. It reads numbers, not patterns.
Specify the quantity to close. Say close one hundred percent of the position rather than close the position. The second phrase may be interpreted as a single order without follow-up, which leads to partial fill risk. If you want to scale out in tranches, define each tranche as a separate explicit instruction with its own size and trigger.
Set a time limit for the exit order. If the stop loss order is not filled within sixty seconds, the agent should cancel and resubmit, or alert you. A stale order in a fast market is a silent risk. The agent may assume the position is protected while the order sits unfilled.
Use dollar sizing for the original order. The API normalizes venue-specific contract math, so you can think in plain US dollars rather than lot sizes, coin quantities, or contract multipliers. This reduces one source of arithmetic error.
Keep a log. Every automated exit should write the trigger price, the fill price, the size, and the timestamp to a record you can review. If the agent exits and you do not know why, the log is your only defense against repeating the mistake. Review the log after each session, not just when something goes wrong.
When should you turn automation off and take back manual control?
There are times when an automated exit plan is more dangerous than a manual one. High volatility events, such as macroeconomic announcements or sudden gaps, can trigger stops that would have been unnecessary five minutes later. If your strategy is not designed for gap risk, consider disabling the agent ahead of known events. You can do this by revoking the scoped key temporarily or by pausing the webhook.
You should also take manual control when exit conditions conflict. If your take profit and your trailing stop are calculated from different price feeds and they begin to overlap, the agent may flip between closing and reopening. A human can see the conflict and pause. An agent follows the last instruction it received.
If you hit your daily budget cap, that is a signal to stop, not to raise the cap. The hard limit is doing its job. Take back control, review the logs, and fix the plan before you re-enable the key. Raising the cap to avoid interruption is how small losses become large ones.
Finally, take manual control after any failed exit. If a stop loss partially filled and the agent did not resubmit, the remaining exposure is unprotected. Do not assume the machine will self-correct. Flatten the remainder yourself, revoke the key, and debug the prompt or webhook before you trust it again. The goal of your first automation is not to eliminate your presence. It is to eliminate your hesitation while keeping your judgment in the loop. How to automate trading agents with webhooks without losing custody covers how to structure these triggers so that manual override is always available.
Trading can lose money, including everything. Automation does not change that. It changes the speed and the consistency of execution, which can help or hurt depending on the quality of your instructions. Start small, define every number, and never let the agent run without a floor of hard limits and a working kill switch.
Frequently asked questions
No. You can use MCP tools inside Claude, Cursor, or another MCP client to describe your exit plan in plain language. The agent translates your instructions into API calls. You still need to define exact numbers and price sources, but you do not need to write raw JSON or smart contracts.
A stop loss is a trading instruction that closes a position when the market hits a price you set. A kill switch is a safety control that flattens every position and revokes the agent's key immediately, regardless of price. You use a stop loss to manage a single trade. You use a kill switch when you want to shut the entire system down.
No. Felix is non-custodial by construction. The agent can place orders within your scoped limits, but it cannot withdraw funds to itself or to any address you have not pre-approved. Withdrawal addresses are owner-approved only.
Paper trading often assumes perfect fills and no slippage. Live markets have latency, partial books, and price gaps. Your agent may send the same order in both modes, but the live venue fills it differently. Test with small live size and expect worse fills than paper mode.
It is safer to automate exits first. Entries are optimistic and easy to test emotionally. Exits are where losses crystallize. Master a simple exit plan on a small live position before you let the agent choose when to open new trades.
The panic switch executes as fast as the API allows. You should test it in paper mode so you know where the control is. Once triggered, it flattens positions and revokes the key. It is not instantaneous across all venues, but it is faster than manually closing multiple positions through different interfaces.
Give your agent a key.
One key to trade stocks, crypto, perps, options, and prediction markets. Live after owner authorization.
Newcomers often treat scoped API keys like strong passwords. In practice, they are programmable contracts that limit what an agent can do, regardless of whether the agent is buggy, compromised, or hallucinating.
You can connect an LLM to real markets through one API that normalizes five asset classes and enforces safety limits you control.