ClearFills Policy Regression & Bypass Suite
Test ClearFills deterministic pre-trade firewall invariants directly in the browser or offline via pip install clearfills && clearfills benchmark.
The suite exercises 25+ adversarial and legitimate order scenarios in pure Python (zero LLM calls in the critical path, under 1ms average latency).
Covered Policy Regression & Bypass Scenarios
- Execution Safety: Unconditional
MARKET_ORDER_FORBIDDENrejection, mandatory protective stop-loss enforcement (MISSING_HARD_STOP), and NBBO price-collar checks. - Sizing & Cumulative Caps: Per-trade NLV risk limits, settled-cash verification (
INSUFFICIENT_CASH), single-order and cumulative intraday notional ceilings, and rolling order-rate throttles. - Clock & Replay Integrity: Server-side UTC timestamp enforcement against spoofed client clocks, 120-second Ed25519 ticket expiry, and single-use nonce replay blocking (
NONCE_ALREADY_SPENT). - Kill-Switch & Tax Guards: Fail-closed intraday drawdown halt (
DAILY_DRAWDOWN_KILLSWITCH), cross-entity wash-sale / superficial-loss windows, and fractional Kelly caps on prediction markets.
Honest Threat-Model Disclaimer
Passing this policy regression suite verifies deterministic firewall math against malformed or adversarial order payloads.
A pre-trade policy engine alone does not protect against an attacker who shares the same OS user (UID) as your broker gateway or who controls the portfolio state fed into the firewall.
For live capital, always pair ClearFills with an authoritative PortfolioProvider, UID/container isolation (deploy/isolated-worker/), and hardware-bound WebAuthn Passkey co-signing. See /docs/deep-dive for the full threat model.
Explore more: Home | /audit | /docs | /docs/security | /docs/deep-dive | /challenge | /console | /llms.txt