Skip to content
Ali Zarreh
Live demo Finance

Trade Surveillance Agent

An insider-trading investigator that refuses to publish what it cannot prove.

An AI investigator for SEC Form 4 insider filings. It gathers evidence, drafts a finding, checks every claim against what it actually retrieved, and hands a clear, flag or escalate outcome to a human — while openly reporting where its accuracy still falls short.

live runs failing the process audit (of 10)
8 → 0
disposition accuracy, reported openly
5 / 10
claims grounded in the sample case — so it escalated
2 of 4
Trade Surveillance Agent sample case: a synthetic Chief Financial Officer sale two days before earnings, with a research-prototype notice

Why it exists

Executives, directors and large shareholders must publicly report their own trades within two business days, and a compliance team then has to decide which filings deserve a closer look.

A filing on its own cannot show whether an insider knew anything. A sale just before earnings is a classic warning sign — but it may also be a pre-planned trade or a routine tax disposition. Reviewers need an assistant that surfaces concerns and mitigating factors together, cites its sources, and is honest when its evidence is thin. A fluent paragraph that sounds right but is not grounded in the record is worse than no assistant at all, because it creates false confidence.

How it works

  1. 01 Input Form 4 filing
  2. 02 Model / AI Plan the evidence
  3. 03 Code Validate the plan
  4. 04 Model / AI Investigate & draft read-only tools
  5. 05 Check Claim-by-claim grounding
  6. 06 Code Publish clear / flag / escalate
  7. 07 Human Analyst accepts or overrides
In order · Model / AI Code Independent check Human

The pipeline is a LangGraph state machine: plan the evidence needed, check the plan in code, investigate with read-only tools over the insider’s trading history and a firm-policy database, draft a finding, extract claims, judge grounding — and only then publish.

  • The grounding loop is the centerpiece. The draft is decomposed into individual claims and each is checked against the evidence actually gathered. If a claim fails, the investigation goes back for more evidence rather than quietly rewriting the answer.
  • Publication is deterministic. Once grounding is evaluated, code assembles the result, so the model cannot re-word its way around a failed check.
  • Concerns and exculpatory factors sit side by side. A blackout-window sale appears next to factors that may explain it, such as an on-time filing below firm limits.

What a model judges, and what is plain code

Whether a claim is supported is judged by an LLM. Everything around that judgment is deterministic: the plan check, the exculpatory factors, and a process audit — was the required evidence gathered, in a sensible order, with real citations and supported exemptions? An included Gymnasium environment uses the same signal, and in its CI gate shortcut strategies score far below a proper investigation. That makes “did the agent actually do the work?” measurable.

A review queue lets an analyst accept or override the agent’s disposition. The decision is recorded against the run and never changes the agent’s finding, so the audit trail keeps both views.

Results and honest limits

  • The grounding check catches weak output. In the sample case, the agent escalated a synthetic CFO sale two days before earnings because only 2 of 4 claims were supported; two cited no evidence, so human review is required.
  • The process audit improved from a real finding. It exposed a claim-extractor problem; after the fix, live runs scoring zero on the audit fell from 8 of 10 to 0 of 10.
  • Evaluation design: a canonical set gates every pull request; recorded live-model runs are shown next to scripted policies but are not gated.

Engineering decisions

  • Plan once, validate in code, rather than trusting the model’s own plan.
  • Vocabulary discipline: the interface says “flag” and “escalate”, never accuses, so the wording does not overclaim what the evidence supports.
  • No vector store — a deliberate, documented decision rather than a default RAG setup.
  • Quality gates: lint, strict typing, import contracts, tests, an evaluation harness, a documentation build and Playwright browser tests.

Who it’s for

For compliance and RegTech teams, it is a pattern for AI-assisted review that is explainable and honest about uncertainty. For AI engineering leaders, it shows how to evaluate an agent on how it worked as well as on what it concluded.

All case studies
Credit Decisioning review page showing the model's reasons and the eight notice-verification checks
Live demo Finance

Credit Decisioning

A calibrated credit model, notices written by code from a reviewed template, an independent eight-check verifier proven by mutation testing, and a human who makes the call. A read-only AI analyst explains cases — and code checks every number it states.

  • Evaluation & guardrails
  • Fairness & explainability
  • Machine learning
DualLens Analytics financial dashboard comparing stock-price trends for GOOGL, MSFT, IBM, NVDA and AMZN
Live demo Finance

DualLens Analytics

An investment-research prototype that pairs Yahoo Finance metrics with AI-strategy insights retrieved from company reports through RAG. Every answer is scored for groundedness and relevance by an LLM judge, and companies can be compared and ranked on both lenses.

  • RAG & retrieval
  • Evaluation & guardrails
Cohort Risk & Review Lab home page showing the four-step flow from risk model to fairness audit to AI evidence agent to clinician decision
Live demo Healthcare

Cohort Risk & Review Lab

A calibrated risk model decides who is flagged, fairness is audited for every subgroup, an AI agent assembles the evidence, and a clinician makes every enrolment decision. It also reproduces how training on cost instead of illness burden skews who gets care.

  • Fairness & explainability
  • Agentic AI
  • Machine learning

Open to consulting, advisory roles and select projects.

Building AI that has to be right?

I help teams design systems with verifiers, guardrails and human review built in from the start — not bolted on after the demo.

Search zarreh.ai