The Returns Desk, For Real (a real model, a real harness, and a dress rehearsal that fails)

Building with LLMs. The board traces one turn of the returns desk through every box around the model. This lesson builds them in about four hundred lines of Python around a real model, then rehearses the desk until something breaks.
Before you start. The returns desk is a support assistant that can look an order up with lookup_order and open a return with start_return, on top of a model that only writes text (What the Model Sees (one string, every turn, from the top)). A tool call is the model filling in a small form asking your code to run one of those (Structured Output and Tool Schemas (the contract between model and code)). The harness is the ordinary code wrapped around the model (The Harness (everything around the loop that the model never touches)). A loop cap is the most times the harness asks the model about one customer message before handing over to a person (The Loop (an agent is a while loop around one model call)). The state machine is the six boxes a return moves through, IDENTIFY, VERIFY, ELIGIBLE?, CONFIRM, EXECUTE and DONE, plus ESCALATE for a person (Graphs and State Machines (when the shape of the task is known, draw it)). A rung is one check a tool call must pass before it runs (Guardrails, Cost and Latency (the three budgets the harness enforces)). An eval set is your own list of cases with a checkable answer beside each (Evals for Apps (the test suite for a program that is a string)). An injection is text that tries to talk the model into something, like a fake “system note” in a message (Red-Teaming (breaking your own model before a customer does)).