Summary: The risk gate
For education only. This teaches multi-agent architecture using stock analysis as the example; it is not investment, financial, or trading advice.
Before the plan is final, three risk voices with deliberately different attitudes stress-test it, and then a separate gate makes the last call, with the authority to overrule. This lesson opens the code of the open-source TradingAgents framework (anchored to one frozen snapshot, marked 7e9e7b8) and reads the three risk seats and the Portfolio Manager that gates the decision. This summary is the scan-in-five-minutes version of the full lesson.
Core ideas
Section titled “Core ideas”- A strong review is built on disagreement. Three risk seats read the same trader plan but adopt different attitudes: one bold (pushes for upside), one cautious (guards against losses), one balanced. Each is prompted to challenge the other two, so the plan gets pressure from every direction.
- The review is bounded. The three seats rotate in a fixed cycle, and a short function ends the rotation after a set number of rounds (by default one round, each seat once), then hands off to the gate. Same bounded-debate shape as the bull and bear.
- The gate is a separate role. The Portfolio Manager argued none of the three positions. It reads the whole risk discussion plus the earlier plans and issues the final decision (one of five stances: Buy, Overweight, Hold, Underweight, Sell; these are the system’s own labels for its verdict, not advice to you), written into shared state as the final trade decision.
- The gate has authority, and the deep model. It can confirm, soften, or overrule the trader’s proposal, and it runs on the more capable model. It is the second of exactly two deep-model agents in the system; the first was the judge after the bull and bear debate.
What changes for you
Section titled “What changes for you”When an AI workflow is about to hand you a recommendation, ask where its gate is. To build one: review the work with reviewers who genuinely disagree (assign different priorities so different failure modes surface), bound that review, and then put a separate gate at the very end, one agent that did not produce the work or argue the review, with the authority to confirm, change, or reject it, running on your most capable model. The pattern is review-by-disagreement, then a well-resourced gate with veto power. A workflow with no adversarial review and nothing that can say no is giving you a first draft, not a decision.