Deterministic Ed25519 pre-trade risk firewall & MCP server for AI trading agents.
Sits between any untrusted AI trading agent (Claude, Grok, Codex, TradingAgents, ai-hedge-fund, or custom Python loops) and your execution gateway so LLMs never hold brokerage API keys and can never hallucinate or get prompt-injected into an unbounded market sweep.
pip install clearfills-firewall Run the MCP stdio server:
clearfills-firewall-mcp # or: uvx --from clearfills-firewall clearfills-firewall-mcp Run the FastAPI HTTP firewall service:
clearfills-firewall Connect to Claude Code & Cursor Claude Code claude mcp add clearfills -- uvx --from clearfills-firewall clearfills-firewall-mcp Cursor (.cursor/mcp.json) / Project .mcp.json { "mcpServers": { "clearfills": { "command": "uvx", "args": ["--from", "clearfills-firewall", "clearfills-firewall-mcp"] } } } Deterministic Policy Invariants (Zero LLM in the Loop) Every TradeProposal must satisfy all deterministic math rules before an Ed25519 attestation is signed:
Every APPROVED, VETO, and VETO (REPLAY) decision appends to a SHA-256 hash-chained audit ledger (prev_hash -> entry_hash).
Wrap TauricResearch/TradingAgents or virattt/ai-hedge-fund without rewriting their research pipelines:
from clearfills_firewall import FirewallService from clearfills_firewall.shims import TradingAgentsShim, AIHedgeFundShim Open Core vs. Pro Infrastructure Kit Open Core (clearfills-firewall, Apache-2.0 — $0): Deterministic risk engine, Ed25519 120s TTL attestation authority, replay protection, kill-switch, SHA-256 audit ledger, MCP stdio server, FastAPI server, and TradingAgents / ai-hedge-fund shims. Pro Infrastructure Kit ($299 one-time): Turnkey private source repo with Fly.io + Tailscale private mesh, headless IB Gateway + IBC + API-handshake watchdog, attested-only IBKR / Alpaca / Polymarket CLOB / Kalshi adapters, and Web Console → clearfills.com/#pricing. Private Desk Install (MLDSAI Inc., $15k–$25k): Custom deployment for family offices and prop desks → Book 30-min call. Risk engineering and execution software only. Not investment advice.
Both files in this release have provenance metadata.
ai-trading alpaca ed25519 ibkr kalshi mcp polymarket quant risk-firewall trading-agents
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Both files in this release have been uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Nov 23, 2026 2 release files Full provenance




