Agentic tradingRiskMulti-agentDevelopers

How to control multi-agent trading systems with hard limits the agent cannot cross

Multi-agent trading systems amplify operational and market risk. Hard limits enforced at the infrastructure level, not inside the agent prompt, keep owner funds within bounded loss.

By the Felix team10 min read
Key takeaways
  • 01Multi-agent systems can create correlated failures, race conditions, and capital collisions that no single agent can produce on its own.
  • 02Hard limits must be enforced by the trading infrastructure, not by the agent's prompt or internal logic, because prompts can be misinterpreted or bypassed.
  • 03Every agent should receive its own scoped API key with distinct budget caps, position limits, and allowed instruments to contain the blast radius of any error.
  • 04Non-custodial architecture ensures that even if every agent acts maliciously or erratically, they cannot withdraw funds; they can only lose the preapproved budget.
  • 05Paper trading validates limit mechanics, but live authorization with a small budget is necessary to test hard limits under real market conditions.

Multi-agent trading systems introduce correlated failure modes that a single agent cannot produce, because multiple agents sharing capital, data, or execution paths can amplify errors or collide with each other. The only reliable way to control these risks is to enforce hard limits at the infrastructure level, outside the agent's reasoning loop, so that no prompt, logic error, or emergent coordination can override them. These limits must be mechanical, scoped per agent, and backed by a non-custodial architecture that treats the owner as the final authority over every dollar at risk.

Why do multi-agent trading systems fail differently than single agents?

A single agent operating alone has bounded error. If its logic fails, it can only lose whatever capital its key is authorized to touch. When you add a second or third agent, the failure surface expands in ways that are not obvious from the individual prompts. Multiple agents may subscribe to the same market data stream, and if that stream flashes a signal that three agents all interpret as a buy, they can pile into the same instrument simultaneously. This creates a concentration risk that none of the individual agents were explicitly instructed to avoid. The owner may end up with far more exposure than intended, not because one agent disobeyed, but because several agents obeyed independently and collided in the same market. This is especially dangerous when managing multi-market portfolios with agents that are supposed to diversify across stocks, crypto, perps, options, and prediction markets. You can read more about the coordination challenges in our guide to multi-market portfolio management.

Race conditions are another multi-agent hazard. Suppose two agents are both authorized to rebalance a portfolio. If they read the target allocation at the same moment and both decide to sell the same position, the first agent may fill its sell order while the second agent now sees an unexpectedly small or zero position. The second agent may then attempt to sell what no longer exists, or worse, interpret the missing position as a new signal and take an unintended offsetting trade. Capital allocation conflicts follow the same pattern. If agents share a single budget pool without per-agent ceilings, one agent can exhaust the available margin on a perps venue or the available buying power at a stock broker before the others have acted. The remaining agents then fail to execute their intended trades, leaving the portfolio lopsided and unhedged. These are not theoretical edge cases. They are the natural consequence of concurrent autonomous processes touching shared state.

What should hard limits cover in a multi-agent setup?

Hard limits must be comprehensive enough to cover every dimension of risk that multi-agent concurrency introduces. At minimum, each agent needs its own budget cap denominated in plain US dollars, not in venue-specific contracts or margin units. The API normalizes venue-specific math, so the owner can think in dollars and the system enforces in dollars. Beyond individual budgets, there must be an aggregate budget cap that prevents the sum of all agents from exceeding the total capital the owner is willing to risk. Without an aggregate ceiling, five agents each authorized for one thousand dollars could collectively expose the owner to five thousand dollars even if the owner intended a three thousand dollar maximum.

  • ·Per-agent budget caps in US dollars, separate from aggregate portfolio limits.
  • ·Position size limits per instrument and per market type, such as a maximum of five hundred dollars in any single options venue or perps contract.
  • ·Allowed instrument lists so an agent cannot drift into markets it was not assigned, for example preventing a stock agent from opening a prediction market position.
  • ·Velocity limits including maximum orders per minute and maximum notional value per hour, which contain damage from runaway loops or feedback cycles.
  • ·Concentration limits that block an agent from putting more than a defined percentage of its budget into one trade.
  • ·Loss thresholds and exit plans that automatically flatten positions when a drawdown limit is reached.
  • ·A panic or kill switch that immediately cancels all open orders, flattens positions, and revokes every scoped key associated with the agents.

These limits mirror the controls used when you rebalance a portfolio without crossing hard limits, but they must be replicated and isolated per agent. The owner should also define cross-agent rules, such as a total net exposure limit across all agents for a single underlying asset. If one agent is long and another is short the same perp, the owner may want the system to recognize the offset and only enforce residual exposure, or the owner may want to block the second trade entirely to prevent internal conflict. Either way, the limit must be expressed as a policy that the infrastructure evaluates, not as a suggestion that the agent may choose to follow.

How do you enforce limits that the agent cannot override?

The most important architectural principle is that the limit lives outside the agent. A prompt that says do not spend more than one thousand dollars is a soft constraint. The agent may misinterpret it, ignore it due to a reasoning error, or simply fail to account for concurrent orders placed by another agent. Hard limits are enforced at the API gateway or wallet level, where every outgoing order is checked against the immutable constraints baked into the scoped key. When the agent submits an order, the infrastructure evaluates the notional value, the current position, the remaining budget, the allowed instrument list, and the velocity counters. If any constraint is breached, the API rejects the request and the order never reaches the market. The agent cannot bypass this check because it does not hold the underlying wallet private key. It holds only a scoped key that the infrastructure treats as a capability token with fixed boundaries.

Each agent should receive its own scoped key so that a compromise or logic error in one agent does not expand to the others. The owner creates these keys with explicit parameters, and changing those parameters requires owner reauthorization. The agent cannot modify its own budget, cannot add new withdrawal addresses, and cannot escalate its privileges. This is the difference between agentic trading and older automation models where a single API key carried full account access. In a properly scoped system, the agent proposes trades and the infrastructure approves them. The agent can reason, plan, and iterate, but it cannot act outside its cage. This separation of reasoning from execution is what makes multi-agent deployments viable with real money.

Where does non-custodial architecture fit in multi-agent risk control?

Non-custodial architecture is the foundation that makes hard limits meaningful. In Felix, funds sit in a wallet the owner controls. The agent can spend within its scoped limits, but it can never withdraw funds to itself or to any address that the owner has not preapproved. This means that even if every agent in a multi-agent system simultaneously malfunctions, the worst possible outcome is the loss of the preauthorized budgets, not the theft of the entire wallet. The owner remains the final custodian. This property is essential because multi-agent systems have more moving parts, which means more opportunities for bugs or unexpected coordination. If the infrastructure were custodial, a single API breach could expose the full balance. With non-custodial design, the breach exposes only the allowance. You can read more about this model in our explanation of how AI agents execute orders without taking custody of your funds.

Withdrawal addresses are owner-approved only, and the agent has no path to modify them. This removes an entire class of attacks where a compromised agent might try to siphon profits or principal to an external wallet. It also simplifies incident response. If an agent must be shut down, the owner does not need to rush to recover funds from a custodial exchange account. The funds were never outside the owner's wallet. The owner simply revokes the scoped key, flattens any positions, and the capital is already under their control. For multi-agent systems, this containment per agent and per wallet is what lets the owner scale from one agent to five without scaling the risk of total account compromise.

How should you test limits before live capital is at risk?

Paper trading exists for exactly this purpose. It lets you validate that the agent logic, the API integration, and the hard limit enforcement all behave correctly before any real money is committed. In a multi-agent setup, paper trading should include deliberate collision tests. Imagine two agents both receiving the same bullish signal and attempting to max out their position in the same instrument. The aggregate limit should reject the second order, or the per-agent limit should cap both, leaving the owner with a known maximum exposure. You should also simulate a breach attempt. Suppose an agent tries to submit an order sized at ten thousand dollars when its hard cap is one thousand dollars. The rejection must be immediate and absolute, with no partial fill that exceeds the limit.

Live trading requires explicit owner authorization of a key, and that authorization should start with the smallest meaningful budget. Paper trading validates mechanics, but live markets have slippage, liquidity gaps, and latency that paper environments do not replicate. A limit that looks solid in simulation may behave differently when the market is moving quickly. The owner should authorize one agent with a small live budget, observe the limit enforcement under real conditions, and only then authorize additional agents or larger limits. Reviewing logs after each session is critical. Look for cases where an agent hit a limit and verify whether the rejection happened at the infrastructure boundary or inside the agent's own code. If the agent is self-limiting, that is a warning sign, not a comfort. The limit must be external. Our overview of common mistakes when using one API for every market covers additional testing pitfalls that multi-agent deployments often encounter.

What happens when an agent hits a hard limit?

When an agent attempts to breach a hard limit, the API rejects the order before it reaches any venue. The agent receives an error, which it may log, retry, or ignore, but the capital remains protected. If the limit is a loss threshold rather than a size cap, the exit plan triggers. The system flattens the agent's positions, cancels its open orders, and disables its scoped key. The owner is notified through the standard logging and monitoring channels, and the agent cannot resume trading until the owner explicitly reauthorizes or resets the key. Other agents continue to operate if they are scoped independently, which means the failure of one agent does not force a total system shutdown unless the owner chooses to trigger the panic switch.

The panic or kill switch is the final hard limit. When activated, it flattens all positions across every affected agent and revokes their keys in a single operation. This is not a graceful shutdown. It is an emergency brake designed for moments when the owner suspects correlated failure, market chaos, or a systemic bug. Because the architecture is non-custodial, triggering the switch does not create a race to withdraw funds. The funds stay in the owner wallet. The agents simply lose their ability to trade. After the switch is thrown, the owner can review logs, adjust agent logic, reissue scoped keys with tighter limits, and reauthorize live trading one agent at a time. This containment and recovery cycle is what makes multi-agent trading manageable as a long-term operational practice.

Frequently asked questions

Can one agent steal funds from another agent in the same system?

No. Each agent operates under its own scoped key with budget and position limits. The infrastructure checks every order against these constraints, so one agent cannot spend another's allocated capital or withdraw funds. The owner wallet remains the sole source of truth.

What is the difference between a soft limit and a hard limit?

A soft limit is a guideline the agent may reason about in its prompt, which it can ignore or misunderstand. A hard limit is enforced by the trading infrastructure outside the agent's control. The agent cannot override a hard limit regardless of its reasoning or instructions.

Should I give each agent its own API key?

Yes. Separate scoped keys let you assign distinct budgets, instruments, and position limits per agent. If one key is compromised or its logic fails, the blast radius is contained to that agent's scope and does not affect the others.

Can hard limits prevent all trading losses?

No. Hard limits prevent catastrophic losses beyond a defined boundary, but trading within that boundary can still lose money, including the entire budget allocated to an agent. Markets are volatile and prices can gap past stop levels.

How do I revoke access immediately if multiple agents misbehave?

Use the panic or kill switch. This flattens all positions associated with the affected keys and revokes their access in a single operation. Because the system is non-custodial, funds remain in the owner wallet and cannot be withdrawn by the agents during this process.

Does paper trading prove that my hard limits work in live markets?

Paper trading validates the mechanics of limit enforcement and agent behavior, but live markets involve slippage, liquidity gaps, and latency that simulation cannot replicate. Always authorize live keys with a small budget and verify limits under real market conditions before scaling.

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.