TradeGate: open-source MCP firewall adds 17 deterministic pre-trade gates for AI trading agents
PassionDue4817 · reddit · 2026-11-29
A developer released TradeGate, an MIT-licensed, paper/sandbox-only MCP server that acts as a deterministic pre-trade execution firewall between Claude Desktop/Cursor/Copilot and a paper broker, addressing unreliable LLM-based financial risk control (hallucinated position sizes, duplicate fills from HTTP retries, stale balances, indirect prompt injection via market news).
Key components:
- 17 fail-closed pre-trade gates: paper-only lock, symbol allow/block lists, NYSE calendar checks, 300s snapshot staleness bounds, durable duplicate clientorderid detection, ±5% limit-price collars, daily order caps, unpriced-holdings locks.
- 8 monotone sizing rules with binary-search auto-trim: oversized orders are trimmed to the largest legal lot instead of failing the loop.
- OS single-writer lock + disk-latched kill switch: unapproved fills latch killswitch.json until an operator releases it with an audit entry.
- Tamper-evident SHA-256 hash-chained audit log with fsync and a verify-audit command.
Includes a browser demo with 8 attack scenarios, a GitHub repo (37/37 tests, green CI), architecture docs, and copy-paste MCP config. Both adapters refuse live mode fail-closed.
More from coding & agent
- Hosted WhatsApp MCP server lets Claude chat 24/7 for $10/mo, no Docker — uriwa · 2026-11-29
- From generating slop to filtering slop: AI code cleanup chart goes viral — Ryoiki-Tokuiten · 2026-11-29
- Open-Source TradingAgents LLM Framework Claims 24.9% Annual Returns in Backtests — mdancho84 · 2026-11-29
- A fallback ladder for agent approval requests that nobody answers — Ok-Awareness-6585 · 2026-11-29
- AI agent turns architecture images into editable diagrams and HLD docs — Limp_Celery_5220 · 2026-11-29
- "Services are the new software": 2 people can now serve what took 100, and private software beats selling SaaS — eptwts · 2026-11-29