How to secure an AI trading agent without giving up custody
Non-custodial AI trading keeps your funds in a wallet you control while letting agents execute trades through scoped API keys, hard limits, and kill switches.
- 01Your funds stay in a wallet you control because the agent receives scoped API keys that can trade but never withdraw.
- 02Hard limits on budget, position size, and drawdown are enforced by the infrastructure, not by the AI model.
- 03Paper trading lets you verify that safety controls actually block bad orders before you risk real capital.
- 04The kill switch flattens all positions and revokes the agent's key instantly, acting as an emergency circuit breaker.
- 05Live trading requires explicit owner authorization and should begin with a small allocation that you are prepared to lose.
You can let an AI trading agent execute orders across multiple asset classes without ever depositing funds into a third party account or sharing your private keys. Your capital remains in a wallet that only you control, and the agent receives scoped API permissions that include hard limits on spending, position sizing, and withdrawal rights. If the agent behaves unexpectedly or market conditions shift rapidly, a kill switch flattens all open positions and revokes access instantly. This architecture lets you automate strategies across stocks, crypto, perps, options, and prediction markets while keeping full custody and without trusting the agent with anything more than the exact permissions you grant.
What does non-custodial AI trading actually mean?
Most automation platforms require you to deposit capital into an account they control, which means you are no longer the sole owner of the private keys or funds. With a non-custodial model, your assets remain in a wallet where only you hold the signing authority. The agent connects through a single API key that can instruct trades but cannot move capital to an external address unless you have explicitly approved that destination in advance. The API translates your plain dollar order sizes into the contract math required by each underlying venue, so you do not need to manage decimal precision, margin formulas, or contract multipliers manually. Because the funds never leave your wallet, the agent cannot run away with your capital. Even if the agent is compromised or the model produces an unexpected sequence of trades, the worst case is bounded by the permissions and limits you set before activation. This is fundamentally different from custodial bots, where a breach of the platform often means total loss. Non-custodial design also means that you can revoke access at any time by rotating or deleting the API key, without waiting for a withdrawal window or support ticket. The wallet remains yours, the keys remain yours, and the agent is merely a temporary visitor with a tightly defined role.
How do scoped keys limit what an agent can do?
Scoped keys are the foundation of safe agentic trading. When you create a key, you define exactly which actions it can perform. A properly scoped key for trading might allow placing orders, reading balances, and checking positions, but it will never allow withdrawals or transfers to unapproved addresses. Withdrawal addresses are owner-approved only, which means the agent could not send funds to itself or to any external wallet even if it attempted to do so. You can scope keys further by market type. If your strategy only trades stocks and prediction markets, you can disable perps and options entirely. This reduces the attack surface and prevents the model from accidentally entering a market it does not understand. If you use an AI editor or MCP client like Claude or Cursor, the same key governs every interaction. The agent does not receive your wallet credentials or signing keys. It receives a session token that is valid only for trading operations within the bounds you define. Scoped keys also help with operational hygiene. You can issue separate keys for separate strategies, which makes it easier to track which agent is responsible for which positions. If one strategy needs to be paused, you can revoke its key without affecting the others. This isolation limits the blast radius of a configuration error. You should treat each key as a single purpose credential with an expiration date, rotating it regularly and reviewing its permissions whenever you update the agent's strategy.
What safety controls should you set before going live?
Before you let an agent touch real money, you should configure a layered set of controls that work together like successive gates. Budget caps define the maximum notional value the agent can deploy across all positions. Position limits prevent any single trade from becoming too concentrated relative to your total account. Drawdown limits pause the agent if the account loses a predefined percentage of the allocated capital. Exit plans, which you can automate with MCP tools, ensure that take profit and stop levels are submitted alongside entry orders so that the agent is not making discretionary decisions about when to leave a trade. You should also set time based restrictions if your strategy is meant to operate only during certain sessions or if you want to prevent overnight exposure. A practical checklist for non-custodial trading beginners can help you verify each layer before activation. These controls are not suggestions. They are hard limits enforced by the infrastructure, not by the AI model. That distinction matters because an LLM might misinterpret a prompt or hallucinate a parameter, but the API will reject an order that violates a numeric cap. It is worth testing the boundaries of these controls intentionally. Submit an order that should be blocked and confirm that it is rejected. Trigger a drawdown threshold in paper trading and verify that the agent halts. These tests prove that your safety layer is active and that the model is not somehow bypassing the constraints. The controls exist to handle the moments when the AI is wrong, which will happen eventually.
How does a kill switch protect your capital?
A kill switch is the emergency brake. When triggered, it immediately flattens all open positions and revokes the agent's API key. Flattening means closing every open trade so that you are no longer exposed to market risk. The switch is designed to work even if the agent is in the middle of a reasoning loop, if the MCP client has stalled, or if the network connection between your agent and the API is unstable. You retain the ability to trigger it manually, and some implementations allow automatic triggers based on extreme drawdown or anomaly detection. The kill switch is your final backstop. It does not replace good limits or careful prompt design, but it ensures that a runaway process cannot compound a small error into a large loss. After a kill switch event, you can audit the agent's logs, adjust its strategy or constraints, and issue a new scoped key when you are ready to resume. You should keep the kill switch accessible outside of the agent's normal workflow. If the only way to stop the agent is through the agent itself, then a failure in the agent's logic could prevent you from intervening. Think of the kill switch as a circuit breaker for your trading operation. It is there to handle the tail risks that no model can predict. A flash crash, a broken data feed, or a cascading logic error can all create situations where the best response is to stop everything and return to cash. Having this capability pre configured and tested means you can react in seconds rather than minutes.
Why is paper trading essential before real money?
Paper trading lets you observe how an agent behaves without risking capital. You should use the paper environment to test that your prompts translate into the expected orders, that position limits actually block oversized requests, and that the exit plans fire at the right levels. Many errors only appear under live market conditions. Latency, slippage, and partial fills can expose gaps in a strategy that looked perfect in theory. The paper environment simulates these mechanics so you can see how the agent handles them. Treat paper trading as a security rehearsal, not just a profitability test. Verify that the agent cannot escape its scoped permissions even when it encounters an edge case. Confirm that the kill switch works and that the flattening process completes as expected. Check that the agent respects the market types you enabled. If you scoped the key to exclude options, try to see if an options order is rejected cleanly. Only after you have watched the agent operate correctly through multiple market scenarios should you consider authorizing live trading. This discipline is part of how you build guardrails for a trading agent that actually hold up under pressure. Paper trading is also the right time to refine your prompt design. The way you phrase instructions to an LLM differs from how you would write manual rules. You can test whether the model consistently interprets your intent or whether it needs more explicit constraints. Every ambiguous instruction you catch in paper mode is a potential loss avoided in live mode.
How do you authorize live trading without losing custody?
Moving from paper to live trading requires explicit owner authorization of a key. The system will not let an agent spend real money until you have manually approved the specific key for live execution. This approval step is a deliberate friction point. It gives you a final moment to review the scope, the budget caps, the position limits, and the withdrawal restrictions. You should read every setting carefully, because once live, the agent will act faster than you can. Once live, the non-custodial structure remains unchanged. The agent still cannot withdraw funds. It still must obey the hard limits. You should start with a small allocation. The small budget hard limits model is ideal for this phase. Remember that trading can lose money, including the entire amount you allocate. No set of guardrails can eliminate market risk. The goal is to ensure that the only way you lose money is through the market moving against your positions, not through a bug, a hack, or a misunderstanding of scope. During live trading, monitor the agent closely for the first few sessions. Compare its actions against your expectations. Look for any drift in behavior or any orders that seem outside the strategy's logic. If you see something unusual, trigger the kill switch and investigate. It is better to pause and miss a few trades than to let an anomaly develop into a serious problem. Keep your authorization habits strict. Do not leave live keys active during long periods when you are not watching. Rotate keys after major strategy changes. Security is a process, not a product, and your attention is the most important layer of protection.
Frequently asked questions
No. The agent operates through a scoped API key that explicitly excludes withdrawal permissions. Withdrawal addresses are owner-approved only, so the agent cannot transfer funds to any destination that you have not previously authorized.
Hard limits and drawdown caps will halt the agent before losses exceed the threshold you define. You can also trigger the kill switch manually to flatten positions and revoke the key instantly.
No. Budget caps, position limits, and kill switches are configured through the dashboard or API settings. If you use an MCP client, you can set these parameters in plain language before authorizing the agent.
Paper trading uses simulated execution so you can test strategy logic and safety controls without risking capital. Live trading requires explicit owner authorization of a key and involves real market risk, including the possibility of losing your entire allocated budget.
Yes, but you should scope the key to only the markets your strategy understands. The same dollar-based sizing and limit structure applies across stocks, crypto, perps, options, and prediction markets.
Trigger the kill switch. It will flatten all open positions and revoke the agent's access, returning you to cash and preventing any further orders regardless of what the agent is currently processing.
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.
Most trading automation repeats human workflows faster. AI agents change the underlying structure of how decisions, sizing, and custody work when capital is at risk.