Learning track · 5 practical lessons
How to build your own agent harness
Start with one task and a checkable result. Build a small loop around the model, connect only the tools it needs, and keep the whole system within explicit limits. Then evaluate it on repeatable work before adding memory or more autonomy.
Read in order · About 34 minutes · Python examples · No API key needed for the first exercises
Build sequence
LESSON 01 · 5 min
Scope one task before you build
Write a task contract with observable success, allowed actions, and reasons to stop.
LESSON 02 · 8 min
Implement the agent loop
Build a provider-neutral Python loop and test its state transitions with a fake model.
LESSON 03 · 7 min
Connect tools with MCP
Place the MCP client and server correctly, design a bounded tool, and test the trust boundary.
LESSON 04 · 6 min
Manage context and memory
Choose what belongs in a model turn and define a safe lifecycle for information that persists.
LESSON 05 · 8 min
Test and improve your harness
Create repeatable evaluations, inspect traces, and change one component at a time.
Start by understanding the system you’re building around. Why the harness matters →
Lessons use primary engineering and research sources. Keep the agent harness field guide handy as you work.