Skip to content

The risk gate, in brief

About this track: Clawdemy uses the open-source TradingAgents framework (by TauricResearch; Yijia Xiao, Edward Sun, Di Luo, and Wei Wang; arXiv:2412.20138; Apache-2.0) as a real-world example of how an agentic AI system is structured. Our goal is to teach the architecture: how specialist agents, a research debate, a trader role, and a risk layer are coordinated by an orchestrator. We are not teaching you how to invest, trade, or pick stocks, and we make no claim that this or any AI system is profitable or predicts markets. This content is for education only and is not investment, financial, or trading advice. Rules vary by country, and this is not advice anywhere. The Trading Agents Lab capstone is a simulation you explore yourself with your own AI provider key; it does not place real trades. The framework’s own authors state it plainly: “It is not intended as financial, investment, or trading advice.”

Lesson 4 ended with the trader’s concrete proposal. This lesson is about what stands between that proposal and the team’s final answer: a risk review, and a gate with the authority to overrule.

Reading the real code, you will see two ideas made concrete. First, a strong review is built on disagreement: three risk seats with deliberately different attitudes (one bold, one cautious, one balanced) stress-test the same plan, each prompted to challenge the other two, and they rotate in a bounded cycle just like the earlier debate. Second, the review produces opinions, but a separate manager (the Portfolio Manager) holds the gate: it reads the whole discussion plus the earlier plans, issues the final decision from a fixed set of stances, and can confirm, soften, or overrule what came before. The gate runs on the deep model, the same one the first judge used, and seeing that lets you read the shape of the whole system: capability and authority sit at exactly two points, the judge after the bull and bear debate and this final gate. The throughline is transferable: review real work with reviewers who disagree, then put a separate, well-resourced gate with veto power at the end.

Everything is anchored to one snapshot of the framework (a frozen version marked 7e9e7b8), and every code claim is checked against that source.

This is the fifth lesson of the track and the last of the role-by-role walk. Lessons 1 through 4 introduced the team and followed a decision from gathering through debate, judgment, and planning; this lesson closes the loop with the risk review and the final gate. Next, lesson 6 zooms out to the orchestrator and the shared state that have been quietly connecting every role, and the track finishes with memory and the hands-on capstone.

Prerequisites: lesson 4 of this track (the trader), which builds on the debate and judge of lesson 3. You do not need to install or run anything; the project can be read in your browser, and every excerpt is quoted in the lesson.

  • Explain why a strong review uses reviewers with deliberately different priorities
  • Describe how the three risk seats stress-test the trader’s plan and rotate in a bounded cycle
  • Identify the gate, a separate Portfolio Manager that issues the final decision and can overrule
  • Analyze why capability and authority are concentrated at the system’s two judgment points
  • Apply the review-and-gate pattern to the end of your own agent system
  • Read time: about 10 minutes
  • Practice time: about 15 minutes (a self-check, a design exercise, and flashcards)
  • Difficulty: deep (this track is the advanced end of the catalog; the foundational agent tracks are the on-ramp)