Agentic tradingRiskMulti-agent

How does a single API safely run multiple trading agents?

A single API keeps multiple trading agents safe with scoped keys, budget caps, and non-custodial boundaries that isolate one agent's failure from the rest.

By the Felix team10 min read
Key takeaways
  • 01Each trading agent should operate inside its own scoped key with independent budget caps and position limits.
  • 02Non-custodial design means no agent can withdraw funds to itself, even when multiple agents share the same underlying wallet.
  • 03A kill switch must flatten positions and revoke access for any agent without manual intervention across multiple venues.
  • 04Orders are sized in plain US dollars, so agents do not need to handle venue-specific contract math when calculating risk.
  • 05Every new agent must be tested in paper trading, and live trading requires explicit owner authorization of the key.

A single API can safely run multiple trading agents only when each agent operates inside its own scoped permissions, budget limits, and non-custodial boundaries. The owner keeps control of the funds at all times, while the API normalizes order sizing and execution across stocks, crypto, perpetual futures, options, and prediction markets. Risk does not disappear when more agents are added, but it can be partitioned so that a mistake by one agent does not cascade to the others. Trading can lose money, including everything, and a multi-agent setup does not change that fundamental truth.

Why does one API need a multi-agent safety model?

When you run one agent through a single API, the failure surface is limited to that agent's logic and the market it touches. When you add a second agent, and perhaps a third, the same API now routes orders for stocks, crypto, perps, options, and prediction markets. The opportunity for automation grows, but so does the blast radius of a bug. A coding error in one agent could exhaust a shared budget, create correlated exposure across asset classes, or trigger a drawdown that forces another agent to close positions prematurely.

The API abstracts venue-specific details. It normalizes orders into plain US dollars and handles the contract math for each market type. This abstraction is useful, but it can also obscure risk if the owner assumes the API itself will manage agent behavior. The API is a router and execution layer. The safety model lives in the keys, the caps, and the wallet architecture that sit below it. Without explicit partitioning, multiple agents behave like multiple processes sharing a single bank account. Any one of them can spend the whole balance.

Trading can lose money, including everything. A single agent can lose its allocated budget. A multi-agent system without boundaries can lose more than any single allocation because agents may interact in unexpected ways. For example, one agent might increase margin usage in a perps venue while another agent simultaneously sells collateral in a spot market. The owner might intend these as independent strategies, but the shared funding source creates a dependency. The safety model must therefore enforce isolation at the wallet and key level before any strategy goes live.

Developers sometimes assume that because the API is unified, the risk model is also unified. This is a dangerous assumption. The unified API makes integration easier, but it does not merge the risk profiles of the underlying strategies. A unified interface for order entry does not imply a unified tolerance for loss. Each agent still faces its own alpha decay, its own slippage, and its own tail events. The job of the safety model is to keep these risks in separate containers.

How does non-custodial design protect the owner from any single agent?

Felix is non-custodial by construction. Funds sit in a wallet the owner controls. The agent can spend within limits but can never withdraw to itself or steal. Withdrawal addresses are owner-approved only. This design choice becomes even more important when multiple agents are connected to the same API, because it means that adding a new agent does not increase the risk of total wallet theft.

In a custodial model, giving an API key to an agent means trusting the infrastructure provider or the agent itself with the full balance. With multiple agents, that trust requirement multiplies. Under Felix's model, each agent receives a scoped key that can only initiate trades within its boundaries. Even if the agent's key is leaked, or if the agent's logic is hijacked by a malicious prompt, the attacker cannot sweep the wallet. The worst-case scenario is bounded by the agent's budget cap and the positions it currently holds.

The owner retains ultimate control over withdrawal addresses. If an agent needs to realize profits, the destination address must be pre-approved by the owner. This prevents a scenario where a compromised agent redirects proceeds to an external wallet. For developers building multi-agent systems, this means that the agent architecture can be modular. You can add a prediction market agent, a stock broker agent, and a perps venue agent without redesigning custody for each one. The wallet remains the same, but the keys are different.

This modularity matters for teams. One developer might write the options agent, while another writes the crypto agent. Neither developer needs access to the owner's seed phrase or withdrawal credentials. They only need scoped keys that permit trading within defined limits. This boundary holds even if the agent is connected through MCP tools or the REST API, because the key permissions are enforced below the interface layer. If a developer leaves the project, their keys can be revoked without rotating the entire wallet. How AI agents trade across markets without taking custody of your funds explores this architecture in more detail.

What controls prevent one agent from affecting another?

  • ·Scoped keys restrict each agent to specific markets, actions, and budget ranges. A key assigned to a stock broker agent cannot place orders on a crypto venue.
  • ·Budget caps are set in plain US dollars. The API enforces the owner-defined limit in real time and rejects orders that would breach the cap.
  • ·Position limits cap the maximum notional exposure an agent can hold in one market.
  • ·Drawdown limits trigger an automatic halt when unrealized losses cross a threshold.

Because orders are sized in plain US dollars, the API normalizes venue-specific contract math. An agent trading perpetual futures does not need to calculate funding rates or margin tiers. An agent trading options does not need to handle multiplier logic. The API translates the dollar amount into the correct venue-specific order. This prevents one agent from misinterpreting contract size and accidentally consuming another's budget.

These are per-agent settings. One agent hitting its drawdown limit does not pause the entire system unless the owner configures it that way. This granularity matters because different strategies have different risk profiles. A news-driven agent might need tight drawdown limits, while a rebalancing agent might need wider bands. It is worth repeating that trading can lose money, including everything. These controls do not guarantee profitability. They guarantee that one agent's losses are contained to its own allocation. The owner should still review total exposure across all agents, because two agents hitting their drawdown limits simultaneously will still create a combined loss. How spend caps and drawdown limits protect an MCP trading agent's owner explains the per-agent mechanics, while Common mistakes when using one API for every market with real money covers the pitfalls owners encounter when they skip these steps.

How do kill switches and exit plans protect the whole system?

A panic or kill switch flattens positions and revokes access. In a multi-agent system, this control must be available at two levels. The owner must be able to halt one agent without disturbing the others, and must also be able to halt the entire system in a true emergency. The API propagates these commands to the relevant venues without requiring the owner to log into each stock broker, perps venue, or prediction market manually.

When the kill switch is triggered, the API attempts to close open positions. In some markets, this means market orders. In others, it means submitting predefined exit orders. The exact behavior depends on the exit plan configured for that agent. An exit plan defines how an agent should unwind gracefully. For example, the plan might specify that the agent should close positions over a ten-minute window rather than dumping everything instantly. The API stores and enforces these plans, so a malfunctioning agent cannot override its own unwind logic.

Revocation is immediate. Once a key is disabled, the agent can no longer place new orders through the REST API or through MCP tools. This is true for agents connected via Claude, Cursor, or any other MCP client. The owner does not need to uninstall software or restart containers. The key is simply dead. This is critical in a multi-agent setup because it allows the owner to surgically remove a suspect agent while leaving a stable agent running. If the owner instead wants to stop everything, a master revoke command disables all keys associated with the wallet.

Live trading requires explicit owner authorization of a key. This means that even after a developer has built and paper-tested a multi-agent system, no real money can flow until the owner approves the specific keys for live trading. This approval step acts as a final sanity check before the safety model is truly tested under market conditions. The authorization is per key, so adding a new agent requires a new approval. The owner cannot accidentally authorize unlimited agents by approving a single master key.

What should developers validate before adding another agent?

Paper trading exists for testing, and every new agent should pass through it. Developers often make the mistake of paper-testing one agent thoroughly, then assuming the second agent will behave similarly because it uses the same API. This is not true. Each agent has its own prompt logic, its own loop structure, and its own error handling. Agents that appear independent in code may still compete for the same capital pool or move prices against each other if they trade correlated instruments. Observing them together in simulation reveals these dependencies before they become expensive. Paper trading for a multi-agent system means running all agents together against simulated markets to observe interaction effects.

Before adding an agent, verify that its scoped key cannot read or modify another agent's state. Test this by attempting to use one agent's key to query the budget of another. The API should reject the request. Next, test the kill switch while multiple agents hold simulated positions. Confirm that flattening one agent does not flatten the others, and that the master kill switch flattens all of them.

Check that budget caps are enforced in real time, not just at order entry. An agent might split a large order into multiple slices. The API must sum these slices against the cap. Also evaluate correlation risk. Two agents trading different asset classes might still be exposed to the same macro factor. A stock broker agent and a perps venue agent might both be long risk assets. A prediction market agent might be hedging the same event. The API does not eliminate correlation risk. It only provides the tools to measure and cap each agent's exposure.

Finally, remember that live trading requires explicit owner authorization of a key. The developer can build the multi-agent logic, but the owner must approve each key before it can touch real money. Slippage, liquidity gaps, and latency behave differently in live markets. A paper-tested multi-agent system that looked safe in simulation might still experience unexpected losses when real capital is deployed. Developers should treat the transition from paper to live as a distinct phase that requires its own checklist, not merely a settings toggle. How to take an AI trading agent live in 2026 describes the authorization flow.

Frequently asked questions

Can one agent steal funds from another agent using the same API?

No. Felix is non-custodial by construction. Funds sit in a wallet the owner controls, and withdrawal addresses are owner-approved only. An agent can spend within its own budget cap but can never withdraw to itself or access another agent's allocation.

What happens if two agents try to exceed the total wallet balance?

The API enforces per-agent budget caps and position limits in real time. If one agent exhausts its own cap, it cannot place further orders. The API does not allow agents to pool their caps or overdraw the shared wallet beyond what the owner has authorized for each individual key.

Does adding more agents increase the risk of a total loss?

Not necessarily. Because each agent is isolated by scoped keys and budget caps, a bug in one agent is contained to its own allocation. However, trading can lose money, including everything, and correlation risk between agents can still amplify losses if the owner does not monitor overall exposure.

Can the owner stop one agent without stopping the others?

Yes. The kill switch can be applied to a single key, which revokes that agent's access and flattens its positions. The owner can also trigger a master kill switch that halts all agents simultaneously. Both actions propagate through the API without manual venue login.

Do agents need to handle different contract sizes for each market type?

No. Orders are sized in plain US dollars. The API normalizes venue-specific contract math for stocks, crypto, perps, options, and prediction markets. This simplifies risk management because every agent thinks in the same unit of account.

Is paper trading sufficient before going live with multiple agents?

Paper trading is necessary but not sufficient. Developers should test all agents together to observe interaction effects, then explicitly authorize each live key. Live trading requires owner authorization, and real market conditions introduce slippage and liquidity risks that paper trading cannot fully replicate.

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.