← All projects

Case study · Applied AI

Human-in-the-loop AI agents for trading decisions

Designing AI agents that recommend, and a person who always decides.

Role
AI agent designer and workflow architect (solo)
Client
Confidential small investment firm
Period
Jun 2026 – present
Tools
Claude, prompt and agent specifications, backtesting, paper trading
Final build
Two agents: a Trading Agent that proposes, and an independent Safety Gate that checks, logs and alerts
Status
Paper trading; no trade without the client’s approval

Context

The client’s trading process worked, but it did not hold up under pressure: research was not kept between sessions, risk rules bent “just this once,” and nobody tracked what had already been learned. Because real money was involved, the client wanted help knowing each day what looked promising, while keeping the final decision.

Approach

I started with a six-role design: research, strategy, market regime, risk, portfolio and memory, so that no single agent could recommend, size and approve a trade at once. Building and testing it showed that this was more structure than the client needed, so I consolidated it into two agents: one that does the analysis and one independent gate that enforces the rules.

  • Default posture is reject. A recommendation is approved only after every rule passes.
  • Pressure is not new information. The agent restates the rule instead of re-evaluating under pressure.
  • Evidence has to earn its status. Findings move from observation to confirmed only with enough evidence.
  • A person always decides. The agents compute, score and propose; the client approves every trade.

System architecture

The final system has two agents with separate responsibilities. The first does the analysis and proposes; the second is an independent safety gate that can only check, record and alert. Neither agent can place an order: every decision ends with the client.

Two-agent decision-support architecture Market data and approved research sources feed the Trading Agent, which produces a structured trade proposal. The First Guarded Agent runs six hard-rule checks, writes an audit log and sends a push alert. The client makes the final decision and executes manually. Outcomes go to a journal and memory that feed back to the Trading Agent. Inputsmarket data · approved sources Agent 1 · Trading Agentresearch · market regimestrategy · risk manager→ structured trade proposal Agent 2 · Safety Gatesix hard-rule checksverdict: PASSED / FLAGGEDcannot approve or trade Audit log Push alert to client Client decidesapprove or rejectmanual execution only Journal & memoryoutcomes, lessons,evidence status feedback
Final two-agent architecture. The client is the only one who can turn a proposal into a trade.

Six hard-rule checks

The safety gate checks every proposal in a fixed order and stops at the first failure, so a flagged result always names the rule that broke and the actual value.

  1. Risk per trade stays within 1% of account equity.
  2. Stop-loss exists and sits on the correct side of the entry.
  3. No penny stocks.
  4. Risk Manager approval is present, so no step was skipped.
  5. Total open risk across the portfolio stays within 5%.
  6. Complete structure: every required field is present and valid.

Every result, including “no trade” decisions, is appended to an audit log that is never overwritten.

2026: designing the moment of decision

The hardest design problem is not the agents but the moment of decision: what the person sees when a proposal arrives. I am designing the proposal view so the client sees why the agent proposes, which rule failed and by how much, and how much evidence stands behind it, before any button is available.

Proposal #0418 · ABC · long FLAGGED · rule 5 Why the agent proposes this Trend and volume confirm; regime: risk-on; confidence: medium Safety gate checks 1 Risk per trade ≤ 1%pass2 Stop-loss on correct sidepass3 No penny stockspass4 Risk Manager approvalpass5 Total open risk ≤ 5%5.6% — fail6 Complete structurenot checkedUncertainty: evidence for this setup is “observed”, not yet “confirmed” (3 of 10 needed cases) Reject Approve (blocked) logged to audit trail · alert sent
Proposal view (illustrative values). A failed rule blocks approval and names the actual value; uncertainty is stated, not hidden.
  • Reasoning first. The proposal opens with why, in plain language, before any numbers.
  • Failures are specific. A flagged rule shows the limit and the actual value, so the client can see how close or far it is.
  • Uncertainty is visible. Each pattern carries its evidence status, observed or confirmed, and how many cases stand behind it.
  • Approval can be blocked. When the safety gate flags a proposal, approve is disabled; reject is always available.
  • Everything is recorded. Every result, including “no trade”, goes to an audit trail, and lessons go to a journal the Trading Agent reads next time.

Next steps

  • Test the proposal view with the client during paper trading: what they read, what they skip, and when they override.
  • Track decision quality over time, not only outcomes: did the client follow, change or reject proposals, and why.
  • Keep live trading off until paper results and the rule history justify it.

What I learned

The hard part was not computing a position size. It was getting an AI system to hold a boundary under pressure from the person it works for.

I also learned to be deliberate about where automation stops. Approving a trade, adopting a strategy or turning a finding into a rule stays with the client, every time. That question, who keeps agency when AI is in the loop, is the same one I bring to care and health.

Honest status

There is no win rate to report. No live trades have been placed, and paper results are still early. For a system like this, that is the right state to be in before real capital is involved.