Stop Runaway AI Orders.
Enforce Hard Risk Gates on Interactive Brokers.
AirbagMCP is a Rust MCP server that sits between an AI agent and Interactive Brokers. It checks every order against hard risk limits before the order can leave your machine. It is early access for IBKR paper accounts. Support for live accounts is planned.
We Tested Our Own Strategies. None Survived.
We built five strategy families and ran each one through the tests below. We publish the result because the tests only mean something if they can fail.
Together the five families ran 11,364 backtests. Each family then went through combinatorial purged cross-validation, the probability of backtest overfitting (PBO), a deflated Sharpe ratio that uses the true trial count, and a permuted-signal placebo test. 0 of 5 families pass.
Median out-of-sample excess return over SPY, % per year, 20-year test
| Strategy family | Median OOS excess (%/yr) | PBO | Deflated Sharpe | Placebo p-value | Gates failed | Result |
|---|---|---|---|---|---|---|
| Conviction reversion | -3.06 | 0.13 | 0.001 | 1.000 | Excess, Sharpe, placebo | Fail |
| HMM stat-arb | -3.92 | 0.24 | 0.681 | 0.951 | Excess, Sharpe, placebo | Fail |
| Catalyst spike | -3.10 | 0.16 | 0.017 | 0.171 | Excess, Sharpe, placebo | Fail |
| Bottleneck tailwind | -2.12 | 0.68 | 0.959 | 0.268 | Excess, PBO, placebo | Fail |
| Dual momentum | -7.13 | 0.37 | 0.279 | 1.000 | Excess, Sharpe, placebo | Fail |
A family passes only if its median out-of-sample excess over SPY is positive, its PBO is below 0.40, its deflated Sharpe is at least 0.95, and its placebo p-value is at most 0.05.
- Limits of these tests:
- The look-ahead tests cover symbols in the local cache and a sample of cut days.
- The local cache has survivorship bias.
- Prices exclude dividends.
- These are simulated results. They do not predict future results.
Test the Risk Gate Live
Pick an order and run it. The server runs the real gate code on a throwaway ledger with sample prices. No broker is connected.
Running the scenario on the server...
What the Gate Checks, in Order
The gate runs these checks in this order. The first check that fails rejects the order.
Duplicate Key
Looks up the client order key in a SQLite ledger. A repeated key is refused. The MCP layer also asks the broker whether it already holds that order ref.
Loss Locks and Kill Switch
Applies the daily loss lock and the total drawdown kill switch.
Market Orders and Limit Validity
Rejects market (MKT) orders. Requires a valid limit price.
Rate Limit
Limits how many orders can pass each minute.
Spread and Price Collar
Rejects orders when the spread is too wide. Rejects limit prices that sit too far from the market (fat finger).
Position, Sector and Volume Caps
Applies caps on a single name, on a sector and on average daily volume.
Commission Estimate and Adaptive Routing
Estimates commission and margin locally. Rejects orders where commission drag is too high. The estimate does not reject for margin. Approved limit orders route via IBKR Adaptive (Normal).
The time badge shows the time measured for that request. It includes opening the throwaway ledger. The gate does not time each step.
Three Problems and What AirbagMCP Does About Them
Each card lists a problem and what the code does today. Where a point is not proven, the card says so.
1. Backtests That See the Future
An SEC filing has a period-of-report date and a later acceptance time. An agent that sees the filing on the period date trades on numbers that were not public yet. A model can also remember how an asset performed.
- Queries return an event only if
accepted_at <= sim_clock. - Ticker masking replaces symbols with tokens. The tokens rotate daily.
- Masking does not prove that a model cannot recognise an asset.
- Friction accounting charges commission and spread costs.
2. Piping Every Tick to the Model
If every market tick reaches the model, every tick costs tokens. The agent also reacts to noise.
- Absorbs ticks locally at zero tokens.
- Tracks VWAP, volatility and spread.
- Wakes the agent on anomalies.
- We have not measured the total token saving.
3. An Agent That Places Orders Alone
An agent can send market orders, loop on errors, or send the same order twice after a reconnect.
- Rejects market orders. Requires a limit price.
- Refuses a repeated order key.
- Daily loss lock and total drawdown kill switch.
- Order rate limit, spread limit and price collar.
- Single-name, sector and volume caps.
- Rejects orders with high commission drag.
- Routes approved limits via IBKR Adaptive (Normal).
Nine MCP Tools
- set_sim_clock
- query_pit_events
- ingest_stream_tick
- get_stream_digest
- stage_airbag_limit_order
- get_conviction_candidates
- get_risk_and_friction_status
- get_ibkr_paper_account
- flatten_all_positions
Where It Stands
- Built and tested for IBKR paper accounts. No real order has been sent through the Rust path yet. Live support is planned.
- One Rust binary. Run
airbag mcpto start the MCP server over stdio. The server offers tools only and no MCP resources. - Tested on Linux only.
- The repository includes a Docker Compose file that runs a local paper IB Gateway.
- Local SEC ingest covers 8-K filings, MD&A tone and XBRL facts for 2,396 filers.
- The local data cache has survivorship bias.
Developer Pricing
No payment is taken today. This is the planned pricing. Items marked Exists are in the code now. Items marked Planned are not built yet.
Developer Execution Sidecar
or $59/mo billed annually (save 25%)
Run the Rust binary locally against your own IBKR paper account. Live support is planned.
- Rust risk gate: rejects market orders, requires a limit price Exists
- Approved limits route via IBKR Adaptive (Normal) Exists
- Daily loss lock, drawdown kill switch and order rate limit Exists
- SQLite ledger that refuses repeated order keys Exists
- Starter strategy templates Exists
- Live account support Planned
- Deployment kit Planned
Hosted PIT SEC Catalyst Feed
or $29/mo billed annually (save 25%)
This tier is entirely planned. Nothing in it is hosted today.
- Hosted remote MCP URL Planned
- Point-in-time SEC data: 8-K events, MD&A tone and XBRL facts Planned
- Ticker masking that rotates daily Planned
- Usage limits set at launch Planned
The SEC ingest runs locally today.
Complete Quant Desk
or $79/mo billed annually (save 20%)
The local sidecar plus the planned hosted feed.
- Everything in Developer Execution Sidecar Exists
- Everything in Hosted PIT SEC Catalyst Feed Planned
- Starter strategy templates Exists
- Deployment kit Planned
- Survivorship-aware dataset Planned
Extras
Three extras are on the roadmap. One exists today.
Starter Templates
Two Python strategy templates in the repository: pead_drift_strategy.py and insider_cluster_strategy.py.
They are starting points, not tested strategies.
Deployment Kit
Scripts to run the server and a paper IB Gateway on a server. Not built yet.
Survivorship-Aware Dataset
A dataset that includes delisted names. Not built yet. Today's local cache has survivorship bias.
30-Day Paper-Trading Guarantee
This guarantee applies at launch. No payment is taken today. It covers only an order that breaks your configured limits, or a repeated order key, that the gate lets through on an IBKR paper account. In that case, email us within 30 days of your first payment and we refund that payment.
Join the Early Access List
No payment todayTell us which tier interests you. We will email you when it is ready. No payment is taken today.