← Back

regwatch

An AI wrote a trading signal. Who checks it before money moves?

A compliance gate that sits between a strategy and the broker. Every proposed trade is checked against a rule engine before it can execute — and every check, pass or fail, lands in an audit trail that can't be edited later.

PythonOllamaSEC EDGARSQLiteStreamlitpytest
GitHub →

// why this exists

This stopped being hypothetical

The EU AI Act now requires “meaningful human oversight” for high-impact AI decisions, and trading is explicitly in scope. The SEC has enforcement actions in flight over AI-washing — firms claiming AI-driven strategies with no controls to prove it.

Meanwhile, the actual pattern at most shops is: model produces signal → signal goes to broker → someone finds out about the problem from the P&L. The missing piece isn't a report after the fact. It's a gate before execution. That's what regwatch is.

$ python scripts/check_trade.py --symbol AAPL --side buy --qty 100 --price 150 \

  --rationale "Momentum signal, top decile" --llm-confidence 0.85

✗ BLOCKED

  [HARD] AI Governance: AI-generated trade executed without human approval.

  High-impact AI systems require human-in-the-loop per EU AI Act Art. 14.

  audit_id: 4f2c…91aa — written to the trail either way.

What this shows

  • • I understand where AI regulation meets running code, not just headlines
  • • I design for auditability from the start, not as a bolt-on
  • • I know when not to let an LLM act — and can build the gate that enforces it

The part I like most

New regulations arrive as 80-page PDFs, not code. So regwatch pulls fresh SEC filings, has a local LLM draft candidate rules — and puts them in a review queue. The AI proposes, the compliance officer disposes. Which is exactly what the AI governance rule demands of everyone else.

// the gate

Five rules, two speeds

Position limit

hard block

A trade that would put more than 10% of the book in one name doesn't execute.

Restricted list

hard block

Securities the firm can't touch — insider windows, underwriting, watchlists.

Wash trade

hard block

Buy and sell of the same name within five minutes. A classic manipulation pattern.

Concentration

soft flag

Portfolio-level Herfindahl index or top-5 weight drifting too high. Review, don't block.

AI governance

hard block

LLM-generated trades need human approval, minimum model confidence, and a written rationale.

Hard rules run first and short-circuit. Soft rules flag and notify. A broken alert handler can't crash the engine — and a compliance record that can be edited isn't a compliance record, so every model is frozen.

// the trail

Six months later, “why did this trade go through?” is a query, not an archaeology project

Every check writes an append-only row: what was proposed, which rules ran, what they found, when. Indexed by decision ID. The Streamlit dashboard browses it — checks by day, violations by rule, the full trail.