4 December 2026

AI and agents, every day. Straight to it.

ToolsQuick notes

TradeGate filters AI agents' orders before they reach a paper broker

The open-source layer rejects agent orders that break risk limits and logs each decision in a hash chain.

Rafael Moura

· 2 min read

Read in Portuguese

An AI agent's order leaves the model and heads for a broker. TradeGate, an MIT-licensed repository by hkedia08, sits at that handoff. The project was posted to Hacker News on November 29 and takes orders through an MCP server that clients such as Claude, Copilot and Cursor can call. It forwards them only to simulated brokers: both bundled adapters, LocalPaperBroker and AlpacaPaperBroker, refuse live mode.

Each order runs through gate rules, among them an exchange holiday calendar that blocks non-trading days, a duplicate client order ID check and a price collar that caps price deviation. In the demo UI, that 5% collar stops an indirect prompt-injection hijack. With allow_downsize enabled, an oversized order shrinks to the largest quantity that satisfies every sizing limit.

Every decision lands in audit.jsonl with the SHA-256 hash of the previous record, and startup fails if entries were edited, deleted or reordered. Deleting the kill switch's flag file never resumes trading; an operator has to reset it and log a reason.

These commands from the TradeGate README run the local demo without credentials and check an existing log.

tradegate demo
tradegate verify-audit path/to/audit.jsonl

TradeGate requires Python 3.12+ and ships no live market data, so callers supply reference prices. Who may release the kill switch, and on what grounds, remains a call for whoever runs the agent.

Rafael Moura

Agents & automation.

Read articles by Rafael MouraEditorial policy
Report an error

Use 10–1,000 characters; a reply email shares this space.

Next in your reading list