When Thousands Of AI Agents Read The Same Headline: Detecting Lockstep Agent Order Flow And Building The Stress Circuit The Bank Of England Asked For - With The Chart That Shows It
Retail agentic trading went mass market this month. Robinhood is rolling out in-app agents to customers in waves, on top of 150,000 agentic accounts and 30 million agent tool calls a day, with human approval on by default - and switchable off. Claude Haiku 5.5 launched on 7 October at $0.10 per million input tokens, making it cheaper than ever to run thousands of agents on the same handful of models. Cambridge's 2026 survey found 52% of financial firms already piloting or scaling agentic AI. And the Bank of England's Sarah Breeden has warned that agents trained alike could react to a shock in lockstep, that 'relying on a human in the loop for all agent actions is unlikely to be realistic', and that market-wide circuit breakers and kill switches are on the table. Nobody has published how a platform would actually detect lockstep agent behaviour and respond. This is that build: a herding measure computed over agent order flow, model-concentration tracking, a stress circuit that degrades agents safely, and a Lightweight Charts view that puts the herding signal under the price - in code.
AlchmAI Engineering17 min read
150,000+
Robinhood agentic accounts before this month's in-app rollout, with agents calling its tools about 30 million times a day
52%
Of financial firms piloting or scaling agentic AI in early 2026, per the Cambridge Centre for Alternative Finance - 57% of fintechs
$0.10
Per million input tokens for Claude Haiku 5.5, launched 7 October - cheap enough to run thousands of agents on the same model
1 question
Nobody has answered in public: how does a platform know its agents are trading in lockstep before the market does?
The Bank of England framed the risk precisely. Speaking at the ECB's forum in Sintra at the end of June, deputy governor Sarah Breeden warned that if many firms deploy agents trained in similar ways on similar data, those agents could react to the same shock in the same direction and amplify volatility in stress - and that 'our frameworks were not built to contemplate autonomous agents, and relying on a human in the loop for all agent actions is unlikely to be realistic'. The Bank is exploring market-wide circuit breakers, kill switches and enhanced recovery arrangements. At the time, agentic retail trading was a niche.
Three months later it is not. Robinhood is rolling out in-app agents to customers in randomised waves, on top of more than 150,000 agentic accounts and roughly 30 million agent tool calls a day; approval of each trade is on by default and can be switched off. The models behind those agents come from two or three labs, and they are getting cheaper - Anthropic's Claude Haiku 5.5, released on 7 October, costs $0.10 per million input tokens for prompts under 100,000 tokens. Cambridge's 2026 global survey found 52% of financial firms already piloting or scaling agentic AI. Model monoculture plus falling cost plus a switch that removes the human is the configuration Breeden described. The engineering question is how a platform sees it happening.
1. A Herding Measure Over Agent Order Flow
Market microstructure research has a standard measure for exactly this: the Lakonishok-Shleifer-Vishny herding statistic. For each instrument and interval it compares the share of participants who are net buyers with the share you would expect by chance, and subtracts the deviation that random trading would produce anyway. Positive values mean participants are clustering on one side more than chance explains. Computed over agent accounts only, and compared with the same measure for human accounts, it is a direct, explainable lockstep signal.
from dataclasses import dataclass
from math import comb, sqrt, pi
@dataclass(frozen=True)
class AccountFlow:
account_id: str
instrument: str
net_qty: float # signed net quantity in the interval (+buy / -sell)
is_agent: bool
model: str | None # e.g. "claude-haiku-5-5", "gpt-6-luna"; None for humans
def adjustment_factor(n: int, p_bar: float) -> float:
"""E|B/n - p_bar| when B ~ Binomial(n, p_bar): the deviation chance alone produces."""
if n > 400: # normal approximation for large n
return sqrt(p_bar * (1 - p_bar) / n) * sqrt(2 / pi)
return sum(comb(n, k) * p_bar**k * (1 - p_bar)**(n - k) * abs(k / n - p_bar) for k in range(n + 1))
def lsv_herding(flows: list, agents_only: bool = True, min_traders: int = 20) -> dict:
"""LSV herding per instrument for one interval. Returns {instrument: H}."""
by_inst = {}
for f in flows:
if agents_only and not f.is_agent:
continue
if f.net_qty == 0:
continue
b, s = by_inst.get(f.instrument, (0, 0))
by_inst[f.instrument] = (b + (f.net_qty > 0), s + (f.net_qty < 0))
usable = {i: (b, s) for i, (b, s) in by_inst.items() if b + s >= min_traders}
if not usable:
return {}
# Expected buy share across instruments this interval (the market-wide tilt).
p_bar = sum(b / (b + s) for b, s in usable.values()) / len(usable)
out = {}
for inst, (b, s) in usable.items():
n = b + s
p = b / n
out[inst] = abs(p - p_bar) - adjustment_factor(n, p_bar)
return out
def model_concentration(flows: list, instrument: str) -> dict:
"""Share of agent gross flow in an instrument attributable to each underlying model."""
gross = {}
for f in flows:
if f.is_agent and f.instrument == instrument and f.model:
gross[f.model] = gross.get(f.model, 0.0) + abs(f.net_qty)
total = sum(gross.values()) or 1.0
return {m: v / total for m, v in sorted(gross.items(), key=lambda kv: -kv[1])}- Compute it per minute for liquid instruments and per five minutes for the rest; agents react in seconds, but a one-minute window is enough to see a herd form well before a human desk would.
- Always compute the human-account version alongside. Agents herding while humans do not is the signal; everyone herding after a genuine news event is just a market.
- Track model concentration next to it. A herd that is 80% one model and one prompt template is the monoculture risk in a single number.
2. A Stress Circuit That Degrades Agents Safely
Detection is only useful if the platform does something proportionate with it. The circuit below has four states. It never cancels customers' existing positions or blocks human orders; it changes how agents may act. The key design choice is that the first response is to bring the human back - requiring approval for agent orders - rather than to stop trading, which answers Breeden's point directly: humans cannot approve every agent action all the time, but they can approve them when the platform can see the herd forming.
export type CircuitState = "normal" | "approval_required" | "throttled" | "agents_halted";
export interface FlowWindow {
instrument: string;
agentHerding: number; // LSV over agent accounts, this interval
humanHerding: number; // LSV over human accounts, same interval
agentShareOfVolume: number; // 0..1
topModelShare: number; // largest single-model share of agent flow, 0..1
priceMovePct: number; // move over the last 5 minutes, absolute
}
const CFG = {
herdingAbove: 0.15, // calibrate on a clean quarter, per asset class
herdingGapAbove: 0.10, // agents herding much more than humans
agentShareAbove: 0.25,
monocultureAbove: 0.70,
movePctAbove: 2.0,
};
export function evaluate(w: FlowWindow, prev: CircuitState): CircuitState {
const herding = w.agentHerding > CFG.herdingAbove && w.agentHerding - w.humanHerding > CFG.herdingGapAbove;
const material = w.agentShareOfVolume > CFG.agentShareAbove;
const monoculture = w.topModelShare > CFG.monocultureAbove;
const moving = w.priceMovePct > CFG.movePctAbove;
if (herding && material && moving && monoculture) return "agents_halted"; // the Breeden scenario
if (herding && material && moving) return "throttled";
if (herding && (material || moving)) return "approval_required";
// Step down one level at a time, never straight back to normal from a halt.
if (prev === "agents_halted") return "throttled";
if (prev === "throttled") return "approval_required";
return "normal";
}
export async function apply(state: CircuitState, instrument: string, platform: Platform) {
switch (state) {
case "approval_required":
await platform.forceApprovalFor({ instrument, agentsOnly: true }); // overrides 'autonomous' settings
break;
case "throttled":
await platform.forceApprovalFor({ instrument, agentsOnly: true });
await platform.rateLimitAgentOrders({ instrument, perAccountPerMinute: 1 });
break;
case "agents_halted":
await platform.pauseAgentOrders({ instrument }); // humans unaffected
await platform.notify({ audience: "risk_and_supervisor", instrument, reason: "lockstep agent flow" });
break;
}
await audit.append({ at: Date.now(), instrument, state }); // every transition is evidence
}- Hysteresis matters: the circuit steps down one level per interval so it does not flap on the boundary.
- A per-model kill switch is the sharpest tool: if one model's agents are the herd, pause that model's agents platform-wide while others continue. It needs the model attribution from step 1.
- Customers must be told in advance that 'autonomous' means 'autonomous unless the platform detects stress'. That disclosure is what makes the override fair.
3. Put The Herd On The Chart
A risk dashboard that shows a herding number in a table will be read after the event. A chart that shows it under the price, bar by bar, with the circuit transitions marked, will be read during it. Lightweight Charts v5 supports multiple panes, so the price, the herding signal and the agent share of volume sit on one time axis, and series markers show exactly when the circuit tripped.
import {
createChart, CandlestickSeries, HistogramSeries, LineSeries,
createSeriesMarkers, LineStyle, UTCTimestamp,
} from "lightweight-charts";
interface Bar { time: UTCTimestamp; open: number; high: number; low: number; close: number }
interface Point { time: UTCTimestamp; value: number }
interface Transition { time: UTCTimestamp; state: "approval_required" | "throttled" | "agents_halted" | "normal" }
const STATE_COLOUR = { normal: "#22c55e", approval_required: "#f59e0b", throttled: "#f97316", agents_halted: "#ef4444" };
export function mountHerdingChart(el: HTMLElement, bars: Bar[], agentHerding: Point[], agentShare: Point[], transitions: Transition[], threshold = 0.15) {
const chart = createChart(el, { layout: { background: { color: "#0b0b12" }, textColor: "#cbd5e1" } });
// Pane 0: price.
const candles = chart.addSeries(CandlestickSeries);
candles.setData(bars);
// Pane 1: agent herding (LSV) as a histogram, coloured when it crosses the threshold.
const herd = chart.addSeries(HistogramSeries, { priceFormat: { type: "price", precision: 2, minMove: 0.01 } }, 1);
herd.setData(agentHerding.map((p) => ({ ...p, color: p.value > threshold ? "#ef4444" : "#6366f1" })));
herd.createPriceLine({ price: threshold, color: "#ef4444", lineStyle: LineStyle.Dashed, lineWidth: 1, axisLabelVisible: true, title: "herding threshold" });
// Pane 2: agent share of total volume.
const share = chart.addSeries(LineSeries, { color: "#22d3ee", lineWidth: 2, priceFormat: { type: "percent" } }, 2);
share.setData(agentShare.map((p) => ({ time: p.time, value: p.value * 100 })));
// Circuit transitions as markers on the price pane.
createSeriesMarkers(candles, transitions
.map((t) => ({ time: t.time, position: "aboveBar" as const, color: STATE_COLOUR[t.state], shape: "square" as const, text: "circuit: " + t.state }))
.sort((a, b) => a.time - b.time));
return chart;
}“The herd is visible in the data before it is visible in the price. The only question is whether anyone has put it on the screen.”
Where This Belongs: Broker, Venue And Supervisor
- 01Brokers running agent platforms - Robinhood today, others within a year - should run the detector and circuit over their own agent accounts. They have the model attribution nobody else has.
- 02Venues can run the same measure over member flow tagged as agent-originated, which is a strong argument for an agent flag on orders - the counterpart of the algorithmic trading flags venues already require.
- 03Supervisors need the aggregate: herding and model concentration across brokers. That is the data a market-wide circuit breaker would trigger on, and it only exists if brokers and venues compute and share it in a common shape.
The Bottom Line
Robinhood's mass rollout of AI trading agents with an approval switch that can be turned off, Claude Haiku 5.5 making agents cheaper than ever on the same few models, and 52% of financial firms already deploying agentic AI turn the Bank of England's lockstep warning into an engineering requirement. The build is concrete: a Lakonishok-Shleifer-Vishny herding measure over agent order flow compared with human flow, model-concentration tracking that exposes monoculture, a four-state stress circuit that brings humans back before it stops anything, with a per-model kill switch and full audit, and a multi-pane chart that puts the herd under the price. That is the trading AI architecture and charting work we build in London, and it is how a platform can say yes to autonomous agents and still answer the central bank.
References & Further Reading
- BIS - Agents of change, speech by Sarah Breeden (ECB Forum, Sintra). bis.org/speeches/20260730-agents-change.pdf
- Resultsense - Bank of England floats 'kill switch' for agentic AI trading. resultsense.com/news/2026-07-01-boe-breeden-agentic-ai-kill-switch
- Yahoo Finance - Robinhood is rolling out agentic AI trading accounts for the masses. finance.yahoo.com/markets/stocks/article/robinhood-is-rolling-out-agentic-ai-trading-accounts-for-the-masses-230517174.html
- Robinhood - HOOD Summit 2026 announcements. robinhood.com/us/en/newsroom/hood-summit-2026
- Cambridge Judge Business School - Report finds uneven AI adoption in financial services (2026 Global AI in Financial Services Report). jbs.cam.ac.uk/2026/report-finds-uneven-ai-adoption-in-financial-services
- Developers Digest - Claude Haiku 5.5: pricing, migration changes and when to use it. developersdigest.tech/blog/claude-haiku-5-5-release-guide-2026
- Lakonishok, Shleifer and Vishny - The impact of institutional trading on stock prices (Journal of Financial Economics, 1992). doi.org/10.1016/0304-405X(92)90023-Q
- TradingView - Lightweight Charts documentation: panes. tradingview.github.io/lightweight-charts/docs/panes
AlchmAI Engineering
Engineering, London
Written by the AlchmAI engineering team in Mayfair, London. We build trading platforms, real-time charts, market data pipelines and AI features for brokers, prop firms and fintech teams. The Playbook is where we explain how we approach these systems, with code you can run and sources you can check.
Code in this guide is illustrative and supplied without warranty. Review and test it before production use. Nothing here is investment advice. Important information