Contents1 of 15Download the PDF (892 KB)

Before You Blame the ModelStart here

Introduction

Before we start

Why I wrote this, where every number comes from, and the map the rest of the book follows.

4 min read

#Why I wrote this

Every agent I've built has failed in a way that looked like the model's fault.

It looped. It forgot a file it read four turns ago. It said "done" with the tests still red. Every time, my first instinct was the one you probably have too: I need a bigger model.

I was wrong almost every time.

Not always. Some tasks really do need more brains. But when I went back through my failures with a magnifying glass, most of them traced back to something I built. A request that never got sent. A fact my code knew and dropped on the floor. A check the model was allowed to grade for itself. A fix I was sure was running that had never switched on.

That code around the model has a name: the harness. It's everything that isn't the model. What it sees, what it's allowed to do, how its work gets checked, and what happens when it's wrong. Most of the wins I've been able to measure came from there. In my experience, it's also where people look last.

This book is my field notes. Twelve chapters, each one a failure I lived through, what was actually going on, and the rule I follow now so it doesn't happen twice. Every chapter ends with something you can try on your own agent tonight, and most include a few lines of code worth stealing.

Some of my favorite ideas lost to a placebo. You'll get those stories too, because they taught me more than the wins did.

If you build agents, I hope this saves you a few of the weekends it cost me.

#My lab, in one page

You don't need my setup to use anything in here. But every number comes from somewhere, so here's where.

#What I build

Long-running agents. Coding agents that fix bugs and build features in real repositories, and research agents that read hundreds of sources and write up what they found. Every failure in this book happened in an agent harness I built and run every day.

#The model, on purpose

Most experiments use one small open model: Qwen3.6-35B-A3B, a mixture-of-experts model with about 3 billion parameters active per token, served with llama.cpp. Sometimes I swap in a hosted model, and the chapter says when. I test on a small model on purpose. It's an honest instrument. It fails loudly at everything a frontier model quietly papers over, so harness bugs show up fast.

My bar for any trick: if it helps a small model, it has to be neutral or better for a big one. If it only helps the small one, it's a crutch, and I'll say so.

#The hardware, which is nothing special

The models mostly run on rented cloud GPUs, usually a single 48 GB card rented by the hour. Everything around the model, meaning the sandboxes, the copies of the code, the test runs and the grading, started out on a 36 GB MacBook that I crashed seven times by running too many agents at once. It now lives on two old servers I dusted off from a rack in my basement, one from 2012 and one from 2014.

If you have a laptop and a credit card for a rented GPU, you can reproduce the shape of everything in here. When a number depends on the hardware, I say so.

#How the chapters work

Every chapter starts with a mystery, follows the investigation, and lands on one rule in a black box, the sentence worth taping to your monitor. Then there's a dark Steal this box with a few lines of plain Python that aren't tied to any framework, and a blue Try this tonight box with steps you can run on your own agent in under an hour. Two words come up constantly: a turn is one trip around the agent's loop (the model picks an action, your code runs it, the result goes back in), and a run is one start-to-finish attempt at a task.

Sample sizes are small in places, and I label those as pilots. Conditions sit next to every number, in the figure captions and in the methods notes at the back.

#Everything that isn't the model

An agent is a model sitting inside a harness. The model makes decisions. The harness decides what the model sees, what it can do, and whether its work counts.

Map of an agent harness
Fig. 00. The six parts of a harness, plus the instruments you watch them with. Every chapter header carries a small locator so you know which part you're in.

Frameworks hand you some of these parts. I haven't found one that hands you all of them, or tells you which part is broken. That's the job this book is about.

Before You Blame the Model1 / 15