Circuit breaker – Mangrove

GlossaryGuardrails and control

Circuit breaker

Definition: A circuit breaker is an automatic stop that halts trading or another activity when a measured value, such as a price fall or a loss, passes a set limit.

In US stock markets, market-wide circuit breakers are coordinated trading halts across the securities and futures exchanges, triggered by a one-day fall in the S&P 500 index. The trigger levels are calculated each day from the index’s prior closing price. A fall of 7 percent (Level 1) or 13 percent (Level 2) before 3:25 p.m. halts market-wide trading for 15 minutes, while the same fall at or after 3:25 p.m. does not halt trading. A fall of 20 percent (Level 3) at any time during the trading day halts trading for the rest of the day (Stock Market Circuit Breakers, Investor.gov, U.S. Securities and Exchange Commission).

In software, a circuit breaker wraps calls to another service and watches for failures. Once failures reach a threshold, the breaker trips, and further calls return an error at once without reaching the service, which keeps a failure in one service from cascading to the systems that call it (Fowler, 2014). In an agent system the same idea stops actions instead of calls. For example, an agent whose losses for the day reach a set limit may be blocked from opening new positions until the breaker is reset. A related term is kill switch. In the US Commodity Futures Trading Commission’s description, an order kill switch lets a market participant cancel all working orders from its automated trading systems at once, and blocks new orders until the appropriate people allow trading to resume (CFTC, 2013).

Mangrove enforces circuit breakers in code outside the AI model, together with position sizing rules, daily loss limits and drawdown limits. A risk halt stays in force until a person resets it, and a reset is allowed only once open positions are closed.

In October 1987 the Dow Jones Industrial Average fell 508 points in one day, and the New York Stock Exchange had no circuit breakers in place. Studies of the crash in 1988 recommended trading halts, and in October 1988 the exchange implemented Rule 80B, which halted trading for one hour after a 250-point fall in the Dow and for two hours after a 400-point fall (Chicago Fed Letter, July 1998). In software, Michael Nygard popularized the circuit breaker pattern in his book Release It!, as Martin Fowler records in Circuit Breaker (6 March 2014). AI researchers later reused the name for a training method that “interrupts the models as they respond with harmful outputs” by acting on the model’s internal representations (Zou et al., 6 June 2024). That breaker is part of the model, while the market and software kinds run outside the system they stop.