The Course¶
Eighteen lessons in nine parts, from how an agent works to running a harness in production. Each lesson tells you up front what you will learn, then ends with questions to check yourself, a hands-on exercise and the primary sources worth reading next.
Reading takes about 14 hours. With all eleven projects, plan on 30 to 40 hours.
Part 1: Foundations¶
- What Harness Engineering Is · 35 min · try the offline
harnesslabdemo - How an AI Agent Works · 40 min · project: build an agent loop
- From Prompt Engineering to Harness Engineering · 25 min
Part 2: Guidance¶
- Instructions and AGENTS.md · 40 min · AGENTS.md template
- Context Engineering for Harnesses · 45 min
Part 3: Capability¶
- Tools, MCP and Agent Skills · 50 min · project: tool design
Part 4: Boundaries¶
- Sandboxes, Permissions and Security · 60 min · project: permissions and a sandbox
Part 5: Continuity¶
- State, Memory and Long-Running Work · 50 min · project: long-running state
Part 6: Checking and Visibility¶
- Guardrails, Tests and Evals · 60 min · project: an eval kit
- Logs, Traces and Observability · 45 min · project: traces and diagnosis
Part 7: Correction¶
- Feedback, Verification and the Steering Loop · 50 min · project: guides and sensors
Part 8: Control Flow¶
- Loop Engineering · 50 min · project: loop controls
- Graphs and Multi-Agent Systems · 60 min · project: a graph workflow
Part 9: Putting It Together¶
- Build a Complete Harness · 75 min · project: the capstone
- Diagnosing Agent Failures · 50 min · failure diagnosis table
- Harness Engineering in Production · 60 min · production checklist
- Harnesses Beyond Coding · 40 min · project: a support agent harness
- Case Studies from Real Teams · 45 min
Three ways through¶
I use Claude Code, Codex or Cursor every day and want better results this week. Read lessons 1, 4, 7, 11 and 15. Write a short AGENTS.md from the template, turn on your agent's sandbox, add one lint rule whose message explains the fix, and use the failure table the next time the agent goes wrong.
I build agents and want to understand every layer. Go in order. Do every project. By Project 10 you will have built, tested and ablated a complete harness.
I lead a team adopting agents. Read lessons 1, 3, 9, 13, 15 and 16, then the harness checklist. The ablation in Project 10 is a good team exercise.
Setup¶
You need Python 3.10 or newer. Nothing else is required for the lessons, the demo or the projects.
git clone https://github.com/AbhishekAshtekarDev/harness-engineering.git
cd harness-engineering
python -m pip install -e "harnesslab[dev]"
cd harnesslab && python -m harnesslab demo
Every project runs offline with a scripted model, so you can see exact harness behavior without an API key. To use a real model, install anthropic or openai, set ANTHROPIC_API_KEY or OPENAI_API_KEY, and set HARNESSLAB_MODEL to a current model name. OPENAI_BASE_URL points the OpenAI adapter at any compatible server, including local ones.
How each project works¶
Each project has an exercise/ folder with the parts you write marked TODO, a solution/ folder, and tests:
cd projects/03-permissions-and-sandbox
python -m pytest -q # tests your exercise/ code (fails until you finish)
SOLUTION=1 python -m pytest -q # tests the reference solution
On Windows PowerShell, use $env:SOLUTION=1; python -m pytest -q.