Lab: Typed triage, five tools and their guards
Module 6 · Lab · About 75 minutes · Needs: lessons 1 to 3 of this module, and the Module 1 lab (or the cells in Step 1)
What you are building
It is Friday 10 July 2026, the end of week 6. This week you made triage return a checked Triage, gave the model five tools and put code between the model and the billing system. All of it lives in notebook cells. This lab moves it into three files that Module 8's agent and MCP server will import. supportdesk/schemas.py holds Triage, DraftReply, the parser, the repair loop, salvage and one triage function that tries them in order. supportdesk/tools.py holds the five tools with their fixed names and the executor that never raises. supportdesk/guards.py holds the scopes, the pre-check on the records, the audit log and the loop that sets tool_choice each turn. Thirteen tests check it with no key. Two cells call the hosted model; everything else is offline.