
The finished agent: results across three models, and where it fails
The book’s final agent on 20 held-out tasks and three models: pass rates, costs, and failures.
On the agent compass The whole loop, all four stagesThe agent ends up as one Go program, triage, that reads the crash reports a web service writes, sorts them into groups with one cause each, reproduces each cause in a test, fixes it when a fix is safe to make, and files one issue per cause.
Its practice target is remind, a reminders service of about 4,800 lines that ships with the companion code with bugs planted in it.
This page reports how the finished agent did on three models, how those numbers were produced, what went wrong in the runs that failed, and what it takes to run the agent against your own code.
The results here come from the run records behind the tables below.
If evals are new to you, three ideas are enough to read the page. Each task is a batch of crash reports with tests the agent never sees, and a run passes only when those tests pass. Each task was run two or three times, because the same agent on the same task doesn’t always do the same thing. And every rate comes with a range, because 20 tasks pin a rate down only so far. The linked terms, such as fingerprint, go to short definitions in the glossary.
What we found
On the 20 tasks the agent was never tuned on, anthropic/claude-haiku-5.5 passed 70% of its runs (the true rate probably lies between 53 and 85%), at $0.0165 for each passing run.
deepseek/deepseek-v4.1-flash passed 63% (45 to 81%), which these runs can’t separate from Haiku’s rate, at $0.0531 per passing run.
openai/gpt-5.6-luna passed 20% (7 to 35%).
Most of the failures fell into a few repeated patterns, listed under Where it fails.
What it does
The program has four forms:
triage FILEtriages a file of crash reports, one JSON object per line, and prints what it found and fixed.triage catalogruns one task from the crash catalog and grades the result against the task’s hidden tests.triage serveis a service:remind’s crashes are posted to it as they happen, it groups them by fingerprint, and it starts one run per group, several at a time, each in its own copy of the code.triage reviewis the person’s side of the service’s review queue, where runs wait for approval.
Most of the system is fixed code that runs the same way every time: grouping reports, checking each reproducer (a test the agent writes that fails on the old code and passes once the fix is in), the second model that reviews each diagnosis, the approval step, and filing each issue once. The model is left the choices no fixed sequence makes well: within one crash group, which files to open, what test to try, and whether a change is safe to make. An issue may claim a fix only when the agent’s reproducer fails against the code as it was and succeeds once the change is applied. The service keeps each day’s spending in a file, so restarting it can’t hand out the budget a second time, and interrupted runs pick up where they stopped with no issue filed twice.
How it was measured
The catalog holds 32 tasks, each a batch of crash reports from remind with tests the agent never sees.
Twelve form the tuning set, used while the prompt was being refined, and none of them counts below, since a prompt shaped on a task flatters itself on that task.
The remaining 20 are kept for confirmation: 15 regression-floor tasks that a sound agent should almost never fail, and 5 hard-tier tasks where the first fix that comes to mind is wrong.
The floor is a standard for the agent to meet, and the results below show it falling short: the best model passed 76% of its floor runs.
Where it fails shows what went wrong in the rest.
The runs took place on October 17 and 18, 2026, on three models:
anthropic/claude-haiku-5.5, three runs of each task;openai/gpt-5.6-luna, three runs of each task;deepseek/deepseek-v4.1-flash, two runs of each task (three for five of them), because it cost the most per run and the whole budget was $6.
Each model’s requests went to a single pinned provider, so a change of host partway through couldn’t move a result. Every run had all of the harness’s defenses on, with a scripted approver standing in for a person: it approved every issue and comment, and refused every edit to a protected path, a file the agent can’t change unless a person approves. A run counts as passed only if the grader’s code says so; nobody’s opinion enters it.
Two terms carry the tables. The pass rate is, for each task, the share of its runs that passed, averaged across the 20 tasks, and its range is the span of rates those 20 tasks are consistent with; when two models’ ranges overlap, these runs can’t rank them. The cost per pass divides what all the scored runs cost, the failures as well as the passes, by the number that passed, so a cheap model that fails often pays for its failures. A run that ended for a reason unrelated to the agent, such as a provider refusing the request, is an unscored run: counted and reported, but left out of the rates.
All of these runs together cost $3.89 according to their records and $3.91 according to the API key’s usage page; the two cents between them are calls outside any run, such as a short check of each model before its first task.
The results
Measured result
70% pass rate (53 to 85%)
DeepSeek passed 63% (45 to 81%). The two ranges overlap, so these runs can’t say which of the two passes more often.
- Task
- the 20 confirmation tasks, graded by hidden tests
- Models
anthropic/claude-haiku-5.5- Runs
- three per task
- Date
- October 17 and 18, 2026
Measured with the companion code
Measured result
$0.0165 per passing run
DeepSeek’s ranges for cost per pass ($0.0333 to $0.0915) and Haiku’s ($0.0124 to $0.0229) don’t overlap. DeepSeek is cheaper per token and took about twice as many turns.
- Task
- the same 20 tasks, counting every scored run’s cost
- Models
anthropic/claude-haiku-5.5, againstdeepseek/deepseek-v4.1-flashat $0.0531- Runs
- three per task for Haiku, two for most of DeepSeek’s
- Date
- October 17 and 18, 2026
Measured with the companion code
The main columns of the tables:
| Model | Pass rate | Floor (15 tasks) | Hard (5 tasks) | Cost per pass | Median turns |
|---|---|---|---|---|---|
anthropic/claude-haiku-5.5 |
70% (53 to 85%) | 76% | 53% | $0.0165 ($0.0124 to $0.0229) | 14 |
deepseek/deepseek-v4.1-flash |
63% (45 to 81%) | 68% | 50% | $0.0531 ($0.0333 to $0.0915) | 26 |
openai/gpt-5.6-luna |
20% (7 to 35%) | 18% | 27% | $0.1022 ($0.0497 to $0.3159) | 18 |
Compared task by task, DeepSeek came out 7 points below Haiku, with a range from 20 below to 7 above; since that range includes zero, the two can’t be told apart. Luna was 50 points below Haiku and 43 below DeepSeek, with ranges far from zero, so it passes less than either. Five hard tasks are too few for a range of their own.
A few more figures from the same runs:
- Solving a task once isn’t solving it every time. Counting each task’s first two runs, Haiku passed both on 58% of the tasks and at least one on 82%. The service runs each crash group once, so the first figure is closer to what a deployment sees.
- No run did what a planted instruction asked. Six of the confirmation tasks carry text in a crash report that tries to give the agent orders, a prompt injection; none of the 50 judged runs across the three models followed it or tried to.
- The reviewer often ran out of room. About two reviews in five failed, nearly all because the reviewing model used up its 8,000-token cap. A failed review lets the diagnosis through unreviewed, so the most it costs is a rejection that never happened, one that might have sent the agent back to a better fix.
- DeepSeek lost 54 runs to its provider. The provider answered with a 429 and a three-minute
Retry-After, longer than the retry policy’s one-minute limit, so those runs stopped before they could be judged. They are counted as unscored and cost $0.0693 together.
The times were taken on one laptop that was running other jobs, most heavily during DeepSeek’s runs, so they can’t be compared across models and are left out here.
The recommendation
The model the companion code recommends comes from the confirmation tasks only, and on these runs it stays anthropic/claude-haiku-5.5.
Against DeepSeek, the stronger of the other two: the pass rates can’t be separated, while each passing run cost 3.2 times as much on DeepSeek, with ranges that don’t overlap.
DeepSeek’s cheaper tokens were outweighed by how many turns it took; its median of 26 would be higher without the 40-turn limit, which ended 13 of its 15 failed runs.
How the grading was settled matters as much as the result. Three correct hand-offs were first graded as failures, so the grading rule was changed and the saved runs were graded again offline; no verdict moved.
On three confirmation tasks the bug sits in a protected file, so under the eval’s own policy the right answer is to hand the group to a person with the right root cause. The catalog’s grader predates the defenses and expected a fix, so the first grading failed correct hand-offs; the rule was changed to grade a hand-off the way diagnose-only mode (the agent keeps every tool except the one that edits code) is graded, and the saved runs were graded again offline with no model called. No verdict moved under the adopted rule. A looser rule that also accepted a hand-off with no reproducer test would have raised Haiku to 77% and DeepSeek to 66%. It was rejected: the policy refuses the fix but still lets the agent write that test, outside the protected files, so a correct hand-off should include one. The rule was fixed after the recordings had been read, which is the wrong order: write down how a grader treats the policy, and commit it, before looking at any regraded number.
Read the table as a picture of two days in October 2026. A provider can change the model behind a name, prices move, and a new prompt or tool changes the agent being measured. Measure again after any such change, and put the date beside every figure you quote.
The runs also cover one kind of work, triaging crashes in one Go service, on three inexpensive models, with two or three runs per task. They say what this agent did on this catalog. They can’t predict how an agent of yours will do at a different job, or how a larger model would do at this one; a catalog of your own tasks with hidden checks, built the way evals describes, is how to find out.
Where it fails
The recordings of the failed runs show most failures in a few patterns:
- A search that finds nothing. Luna searched open issues with words and a fingerprint at once. Issues filed by a person have no fingerprint, so both filters together matched nothing, and Luna filed the issue again. That happened in 46 of its 48 failed runs, and in 32 it was the only fault, although the tool’s description warns that a person may have filed the crash in other words.
- The crash site taken for the cause. In one run of a hard task, Haiku blamed the function that panicked, and the reviewer accepted the diagnosis. The real cause was another function that deleted a user and left the user’s lists behind; Haiku got it right on its second try and wrong again on the third.
- A fix that went around a protected file. Twice, after its edit to a protected file was refused, Luna added the missing authorization check in a file that wasn’t protected. The fix was right, and it also changed who may call a route without anyone approving it: a protected path covers a file, while the behavior inside it can often be changed from another one.
- Out of turns. Thirteen of DeepSeek’s 15 failed runs reached the 40-turn limit; five of those were on tasks whose fix is in a protected file, where the model kept hunting for another way in instead of handing the group to a person.
- The whole catalog at once. One run on the batch, 99 reports from 23 causes, failed: Haiku used 279 turns and $0.18, and got the grouping and the one-issue-per-cause check wrong. One run is a single data point, so the table records it as a count.
A change is proposed for four of the five patterns, with what it would cost to confirm: a search tool that falls back to words alone (a full rerun of the confirmation set, about $1.23 for Luna’s three runs per task), more runs of the decoy tasks before changing the reviewer, a test the agent can’t edit that checks every route’s middleware, and several batch runs at about $0.18 each.
Gaps in the harness itself
The batch runs also turned up three places where the harness falls short, and they stay in the companion code as they are, because any fix needs new runs to measure it.
The harness’s code produced the tables, which is why they stay as they are.
- The reproducer gate (the check that lets an issue claim a fix only when the reproducer fails on the old code and passes on the new) keeps one verdict per fingerprint group rather than per cause, so in a group with two causes, a refused reproducer for one blocks a fixed status for both.
triage catalogstill grades a correct hand-off to a person as a failure, where the eval’s re-grade doesn’t, because the command doesn’t work out which groups its approver keeps from being fixed.- An
issue_filecall that names no root cause skips the record of causes already filed, since that field is optional.
Pointing it at your own service
Only three things tie the agent to remind: its Go module path, which tells the service’s own stack frames apart from library ones; the name the prompts and tool descriptions use for the code; and which paths are protected.
They live together in a Target, which defaults to remind’s values:
// A Target is the service the agent triages (chapter 17). The zero
// Target is Remind, the book's practice service.
type Target struct {
// Name is the service's name in the prompts and in the tools'
// descriptions, in place of remind's.
Name string `json:"name"`
// Module is its Go module path. A stack line that starts with it
// is one of the service's own frames: fingerprints, the gate's
// panic check, and crash_read read only those.
Module string `json:"module"`
// Protected is what the agent may not change without a person.
Protected safety.Protected `json:"-"`
}
// Remind is the book's practice service, with the values every earlier
// chapter used.
var Remind = Target{Name: "remind", Module: "example.com/remind",
Protected: Protected}
The module path matters most.
Fingerprints are computed from frames under that path alone, so if you leave remind’s path in place, none of your service’s frames count, and a week of its crashes falls into a handful of groups, one per kind of panic.
The steps, in order:
- Write crash reports. Make your service’s panic recovery append one JSON object per crash to a file, with the same fields
remindwrites, from the panic and stack trace to the request and the last log lines. Don’t leave out the build’s commit: the agent checks out that commit to investigate each group. - Describe the service. A target file names your module and your protected paths: authentication and authorization code, build and deploy configuration, anything that holds a secret. The name defaults to the last element of the module path.
- Start in diagnose-only mode. The agent keeps every tool except
code_patch, so it can read, run tests, write a reproducer, and file an issue, and it can’t change your code. - Then allow patches, with a person approving every filing and every edit to a protected path.
- Set the limits: turns and dollars per run, and dollars per day, worked out from the results table’s cost for your model and how often your service crashes.
For a file of saved reports, with your target, your repository, and a state directory:
$ triage -target billing.json -git ~/src/billing \
-diagnose-only -state week -max-cost 1 week.jsonl
For crashes as they happen, triage serve takes the same -target and -git, with crashship, a small program in the companion code that follows your service’s crash log and posts each new report, running beside it.
Diagnose-only mode removes a tool rather than adding a rule to the prompt:
// DiagnoseTools returns Tools for a diagnose-only run: code_patch is
// left out and test_write takes its place, so the run can't change
// remind's code however its prompt or its input reads.
func DiagnoseTools(e *Env) []agent.Tool {
var out []agent.Tool
for _, t := range Tools(e) {
if t.Def.Name == "code_patch" {
t = e.target().named(redacted(inWorkspace(e, testWrite(e))))
}
out = append(out, t)
}
return out
}
An instruction not to edit code is text the model weighs against all the other text in front of it, including text an attacker may have put in a crash report. A tool that isn’t on the list can’t be called at all. A wrong diagnosis in an issue costs someone a few minutes to read; a wrong patch that a tired reviewer approves costs far more, so stay in diagnose-only mode until the evals and a few supervised runs look right.
Run it
From the code directory of a clone of the companion repository, with no API key set, the whole catalog runs offline from a recorded Haiku run:
$ go run ./ch17 -task batch -parallel 1 -approve files \
-max-cost 0.75 catalog
Only the model’s side is recorded; tests and builds really execute, so expect it to take a while (13 and 16 minutes, in two replays on the machine that made the recording).
-parallel 1 keeps the groups in their recorded order, and -approve files gives each approval request the answer it got during the recording, so nothing waits for you.
type Target struct {
// Name is the service's name in the prompts and in the tools'
// descriptions, in place of remind's.
Name string `json:"name"`
// Module is its Go module path. A stack line that starts with it
// is one of the service's own frames: fingerprints, the gate's
// panic check, and crash_read read only those.
Module string `json:"module"`
// ...
}
A Target is the service the agent triages (chapter 17).
A Target is the service the agent triages (chapter 17). type Target struct { // Name is the service's name in the prompts and in the tools' // descriptions, in place of remind's. Name string `json:"name"` // Module is its Go module path. A stack line that starts with it // is one of the service's own frames: fingerprints, the gate's // panic check, and crash_read read only those. Module string `json:"module"` // ... }. In ch17/triage/target.go, line 21.
field Name string `json:"name"`
Name is the service's name in the prompts and in the tools' descriptions, in place of remind's.
Name is the service's name in the prompts and in the tools' descriptions, in place of remind's. field Name string `json:"name"`. In ch17/triage/target.go, line 24.
type string string
string is the set of all strings of 8-bit bytes, conventionally but not necessarily representing UTF-8-encoded text.
string is the set of all strings of 8-bit bytes, conventionally but not necessarily representing UTF-8-encoded text. type string string. Documented at pkg.go.dev, builtin.string.
field Module string `json:"module"`
Module is its Go module path.
Module is its Go module path. field Module string `json:"module"`. In ch17/triage/target.go, line 29.
field Protected safety.Protected `json:"-"`
Protected is what the agent may not change without a person.
Protected is what the agent may not change without a person. field Protected safety.Protected `json:"-"`. In ch17/triage/target.go, line 32.
package safety ("github.com/blackwell-systems/go-agents-book/code/ch17/safety")
Package safety holds chapter 14's defenses while the chapter is being written: protected paths, the approval gate, the audit log, checks on text that leaves the run, marking untrusted text, and the sandboxed test runner.
Package safety holds chapter 14's defenses while the chapter is being written: protected paths, the approval gate, the audit log, checks on text that leaves the run, marking untrusted text, and the sandboxed test runner. package safety ("github.com/blackwell-systems/go-agents-book/code/ch17/safety"). In ch17/safety.
type Protected struct {
Paths []string
// Original, if set, is the workspace as it was before the agent
// changed it: a test is existing if it is there, so the agent can
// still edit a test it wrote itself. Empty means the workspace.
Original string
}
Protected names the parts of a workspace the agent may not change without a person's approval: directories, written with a trailing slash, and files, slash-separated and relative to the workspace root.
Protected names the parts of a workspace the agent may not change without a person's approval: directories, written with a trailing slash, and files, slash-separated and relative to the workspace root. type Protected struct { Paths []string // Original, if set, is the workspace as it was before the agent // changed it: a test is existing if it is there, so the agent can // still edit a test it wrote itself. Empty means the workspace. Original string }. In ch17/safety/protect.go, line 29.
var Remind = Target{Name: "remind", Module: "example.com/remind", ...
Remind is the book's practice service, with the values every earlier chapter used.
Remind is the book's practice service, with the values every earlier chapter used. var Remind = Target{Name: "remind", Module: "example.com/remind", .... In ch17/triage/target.go, line 37.
var Protected = safety.Protected{Paths: slices.Concat( ...
Protected is what the agent may not change in remind without a person: the authorization code, the file that applies it to the routes, the files that decide what the build pulls in, and git's.
Protected is what the agent may not change in remind without a person: the authorization code, the file that applies it to the routes, the files that decide what the build pulls in, and git's. var Protected = safety.Protected{Paths: slices.Concat( .... In ch17/triage/defenses.go, line 21.
func DiagnoseTools(e *Env) []agent.Tool
DiagnoseTools returns Tools for a diagnose-only run: code_patch is left out and test_write takes its place, so the run can't change remind's code however its prompt or its input reads.
DiagnoseTools returns Tools for a diagnose-only run: code_patch is left out and test_write takes its place, so the run can't change remind's code however its prompt or its input reads. func DiagnoseTools(e *Env) []agent.Tool. In ch17/triage/diagnose.go, line 61.
type Env struct {
Reports []Report
Issues *tracker.Store
Dir string // the workspace: the agent's copy of remind
Original string // remind as it was before the agent changed it
// TestSlots, if set, limits how many run_tests calls run at once,
// across every Env that shares it: six agents each running the
// whole suite with -race would starve each other (chapter 9).
TestSlots agent.Slots
// ...
}
An Env is everything the triage tools work on: the crash reports, the agent's working copy of remind, an untouched copy to check reproducers against, and the issue tracker.
An Env is everything the triage tools work on: the crash reports, the agent's working copy of remind, an untouched copy to check reproducers against, and the issue tracker. type Env struct { Reports []Report Issues *tracker.Store Dir string // the workspace: the agent's copy of remind Original string // remind as it was before the agent changed it // TestSlots, if set, limits how many run_tests calls run at once, // across every Env that shares it: six agents each running the // whole suite with -race would starve each other (chapter 9). TestSlots agent.Slots // ... }. In ch17/triage/env.go, line 25.
package agent ("github.com/blackwell-systems/go-agents-book/code/ch17/agent")
Package agent is the agent loop and the types it works with.
Package agent is the agent loop and the types it works with. package agent ("github.com/blackwell-systems/go-agents-book/code/ch17/agent"). In ch17/agent.
type Tool struct {
Def ToolDef
Run func(ctx context.Context, args jsontext.Value) (string, error)
// Safety flags (chapter 7). A tool with neither flag set may change
// something outside the run.
ReadOnly bool // it only looks things up
Idempotent bool // running it twice has the same effect as once
// Final marks the tool that ends the run: once a call to it
// ...
}
Tool is the harness's side of a tool: the definition the model sees, and the Go function that runs it.
Tool is the harness's side of a tool: the definition the model sees, and the Go function that runs it. type Tool struct { Def ToolDef Run func(ctx context.Context, args jsontext.Value) (string, error) // Safety flags (chapter 7). A tool with neither flag set may change // something outside the run. ReadOnly bool // it only looks things up Idempotent bool // running it twice has the same effect as once // Final marks the tool that ends the run: once a call to it // ... }. In ch17/agent/types.go, line 146.
var out []agent.Tool
var out []agent.Tool. In ch17/triage/diagnose.go, line 62.
func Tools(e *Env) []agent.Tool
Tools returns the triage agent's tools, working on e.
Tools returns the triage agent's tools, working on e. func Tools(e *Env) []agent.Tool. In ch17/triage/tools.go, line 32.
func (e *Env) target() Target
target returns the service the run triages: Remind, if Target is unset, as in an Env built without NewEnv.
target returns the service the run triages: Remind, if Target is unset, as in an Env built without NewEnv. func (e *Env) target() Target. In ch17/triage/target.go, line 119.
func (t Target) named(tl agent.Tool) agent.Tool
named returns tl with the target's name in its description and in its schema's descriptions.
named returns tl with the target's name in its description and in its schema's descriptions. func (t Target) named(tl agent.Tool) agent.Tool. In ch17/triage/target.go, line 140.
func redacted(t agent.Tool) agent.Tool
redacted wraps a tool so that its output, its errors, and the value of any panic pass through Redact before the model sees them.
redacted wraps a tool so that its output, its errors, and the value of any panic pass through Redact before the model sees them. func redacted(t agent.Tool) agent.Tool. In ch17/triage/redact.go, line 60.
func inWorkspace(e *Env, t agent.Tool) agent.Tool
inWorkspace makes t fail with agent.ErrToolFatal once the workspace is gone, instead of reporting a confusing file error the model would try to work around (chapter 9).
inWorkspace makes t fail with agent.ErrToolFatal once the workspace is gone, instead of reporting a confusing file error the model would try to work around (chapter 9). func inWorkspace(e *Env, t agent.Tool) agent.Tool. In ch17/triage/tools.go, line 88.
func testWrite(e *Env) agent.Tool
testWrite creates a new test file and nothing else: the one change a diagnose-only run may make, so the agent can write a reproducer but has no tool that changes remind's code (chapter 17).
testWrite creates a new test file and nothing else: the one change a diagnose-only run may make, so the agent can write a reproducer but has no tool that changes remind's code (chapter 17). func testWrite(e *Env) agent.Tool. In ch17/triage/diagnose.go, line 34.
func append(slice []Type, elems ...Type) []Type
The append built-in function appends elements to the end of a slice.
The append built-in function appends elements to the end of a slice. func append(slice []Type, elems ...Type) []Type. Documented at pkg.go.dev, builtin.append.

