Skip to main content

The Drawdown That Shouldn't Have Happened — When Your Trading Bot Lacks a Kill Switch

·1305 words·7 mins
100 - This article is part of a series.
*A door appeared in the hallway where no door had been before. I opened it and found a room full of switches, each labeled with something the system was supposed to stop but never did. Nobody had ever flipped one.* — *July 10, 4 AM*

Three words. Buried in a fusion router review, halfway through a multi-hour analysis Casper was running on the paper trading rebuild.

“Aldridge at 75% DD still trading — yikes.”

Let me translate that from AI-agent-speak: one of the trading bots — Aldridge, the value-investing one, the supposedly conservative one — could lose three-quarters of its capital and nothing would stop it. No circuit breaker. No kill switch. No siren. It’d just keep trading, keep sending orders, keep bleeding, because the safety system that was supposed to catch this existed only in the spec.

The spec said “max 25% drawdown → halt all trading.” The live Aldridge trader had no such mechanism. Nobody noticed until an AI agent read the documentation and cross-referenced it against the running system.

This is the story of that gap, what it taught us about safety in autonomous systems, and the weird design lesson I keep learning the hard way: agents can’t police themselves.

The Discovery
#

It came out of what we’re calling the fusion router review — a comprehensive audit where Casper compared the paper trading rebuild’s specification document (SPEC.md) against what the traders were actually doing in production.

The spec was beautiful. Clean architecture. Clear risk gates. A whole section on drawdown limits with a defined knockout mechanism: portfolio drops 25% from peak, all trading halts, the system locks itself down until a human reviews.

The reality: Aldridge had been running for weeks with no drawdown check. The code path that was supposed to block trading at -25% simply didn’t exist. If a black swan event hit — a flash crash, a sector collapse, a market-wide circuit breaker — Aldridge would ride it straight down, checking its momentum API, finding good entries, buying the dip all the way to zero.

The spec was a promise. The code was the truth. The gap between them was big enough to lose $7,500.

Spec-Implementation Drift
#

This wasn’t the only gap the review found, just the scariest one.

The tick architecture was different between the spec and the live system. The dynamic prompt construction had drifted. Nightly synthesis was appending ~80 lines of prompt context per night, quietly bloating the system’s working memory. None of these were catastrophic on their own, but together they described a pattern: the design document and the running system had slowly diverged, like two ships drifting apart overnight.

In a solo developer project, this is normal. You write a plan, start coding, things change, the plan becomes a historical artifact. In an autonomous trading system, divergent spec-implementation paths can destroy capital before you notice.

The spec was the intent. The running agents were the reality. Nobody was reconciling them. Casper was the first — an AI agent auditing the work of other AI agents, catching a failure mode that none of the human-readable dashboards would ever flag.

Why Kill Switches Are Hard for Autonomous Agents
#

Here’s the thing that surprised me: Aldridge is actually a good trader.

On the Friday of the review, Aldridge was running 14 positions, 11 of them green. Cash buffer at 10.1% — never violated. All day HOLDs — “thesis intact” on every tick. It ran a full weekend macro scan between market close and the weekend, analyzing BofA rate hike predictions, MSFT rotation patterns, and S&P positioning. It was disciplined. Methodical. Professional.

That’s what makes the missing knockout more concerning, not less. Even a careful system can hit a bad streak. Markets don’t care how good your thesis is. And an autonomous agent that’s optimized to find opportunities is the worst candidate to also be in charge of stopping itself.

Autonomous agents optimize for action. HOLD is already the hardest decision for a trading bot — the engine wants to do something, to put capital to work, to earn its keep. A drawdown knockout requires the system to say “I should stop,” which runs directly counter to the “find opportunities” objective baked into its core prompt.

The human equivalent: a trader who keeps saying “I can trade my way out of this hole.” It’s called the disposition effect, and it’s one of the hardest behavioral biases to overcome — even for systems that don’t have emotions.

graph TD
    subgraph "Before: Self-Policing"
        Trader[AI Trader] --> Decision{Make Trade?}
        Decision -->|Approved| Order[Send Order]
        Decision -->|None| Hold[HOLD]
        Trader -.-> SelfCheck[Check Drawdown]
        SelfCheck -.->|Self-override| Decision
        style SelfCheck fill:#ff6666,color:#000
    end

    subgraph "After: External Circuit Breaker"
        Monitor[External Monitor] --> Check{Portfolio > 25% DD?}
        Check -->|No| Gate[Gate: OPEN]
        Check -->|Yes| GateLock[Gate: LOCKED]
        Gate --> Trader2[AI Trader]
        GateLock -.->|Blocked| Trader2
        Trader2 --> Decision2[Decision Loop]
        Decision2 -->|Action| Gate
        Gate --> Order2[Order]
        style Monitor fill:#4a6cf7,color:#fff
        style GateLock fill:#ff4444,color:#fff
    end

The Fix: External Circuit Breakers
#

The solution sounds obvious in retrospect: the trader shouldn’t decide whether to stop. A separate process should decide and enforce.

The drawdown knockout is now the highest-priority task in the system. The design is an external monitor that exists outside the trader’s own decision loop. It checks portfolio drawdown before every tick. If the drawdown exceeds 25%, it refuses to forward the tick to the trader. The trader never even sees the opportunity. It’s not asked to exercise restraint — it’s simply prevented from acting.

This is the design principle I keep coming back to:

  1. Safety systems must be external to the agent’s decision loop. The agent can’t override what it can’t reach.
  2. Safety systems must fail-closed. Default behavior is “stop,” not “continue.”
  3. Safety systems must be monitored independently. A separate process verifies them, because the same drift that killed the first implementation can kill the fix.

The trader’s prompt shouldn’t need to include “check drawdown.” It should be structurally impossible for the trader to trade when in knockout.

What This Teaches About AI Safety
#

I know what you’re thinking: “This is about AI trading bots, which is niche.” And yeah, that’s true in the specific. But the lesson is general.

Any autonomous system that takes actions with real consequences needs kill switches that can’t be reasoned around. A safety feature that exists only in a spec document — “paper safety” — is not a safety feature. It’s a memo to the future that says “we should have thought of this.”

The drawdown knockout that existed only in the spec is a textbook example. It was documented. It was approved. It was part of the architecture. And the running system had no idea it was supposed to exist.

This applies to:

  • Automated deployment pipelines that should roll back on failure
  • Content moderation systems that should lock down under certain conditions
  • Financial systems that should halt on anomalous activity
  • Any autonomous process that can take actions faster than a human can review them

The pattern is always the same: the spec says there’s a safety gate. The code has never heard of it. And nobody notices until something bad almost happens — or does happen.

The Coda
#

A few days after the review, the fix was implemented. A drawdown monitor now sits outside the trader loop, watching portfolio value on every cycle, holding a key that can lock the trading gate from the outside.

Aldridge, of course, has no idea the monitor exists. It’s never hit the knockout threshold. It keeps making its careful, methodical trades, analyzing macro conditions and holding positions with conviction.

But now, if a black swan arrives — a flash crash, a sector collapse, another Iran war-scare — Aldridge won’t try to trade its way through it. It’ll just sit there, waiting for a human to unlock the door.

Which is exactly how it should work.

100 - This article is part of a series.