2026-11-27 16:21 UTC

270-run coding-agent test finds guardrails changed leftovers more than pass rates

state: expiredheat: lowuncertainty: mediumrelevance: mediumcoding-agent-guardrails agent-evaluationRakesh Menon

What is this?

On 15 October 2026, Rakesh Menon reported an author-run experiment of 270 unattended Claude Code runs: three models, seven tasks and three setups—no guardrails, an instruction file, or that file plus hooks and gates. First-pass hidden-test results were nearly identical (90/90, 89/90 and 88/90). On four later tasks, defects left at completion numbered 15/60, 14/60 and 9/60 respectively, a difference Menon says is too small to establish a clear effect. A read-only-tests rule also caused some runs to stop and request human help. The small study used one codebase and one agent, with five runs per task, model and condition; its author designed the tasks and harness. The article links to run records and reproduction code.

Why it matters

The experiment highlights a practical evaluation gap for coding agents: passing task tests may not reveal defects or rule violations left behind. Menon’s results suggest guardrails can alter those outcomes, but also create human handoffs when rules block work. This matters as teams decide whether to deploy agents unattended and how to measure reliability; the small, author-designed study is suggestive, not general proof.

Current assessment

New: Rakesh Menon’s 15 October 2026 post reports 270 unattended Claude Code runs across three models, seven tasks and three conditions: no guardrails, an instruction file, and the file plus gates/hooks. First-pass hidden-test results were close—90/90, 89/90 and 88/90—and the author reports no clear statistical difference. On four later tasks, defects at completion were 15/60, 14/60 and 9/60, a gap Menon says is too small in this sample to establish an effect. A rule against editing tests also left runs waiting for human intervention on a task requiring a test change. The useful implication is that evaluation should track what agents leave behind and when they escalate, not just test-pass rates; guardrails may trade some autonomous completion for policy compliance and oversight. Evidence is limited to five runs per cell, one codebase and agent, and tasks and harness designed by the author. The post links run records and reproduction code; no independent validation or adoption evidence is supplied.

Measured heat

no measured readings yet — the hourly heat pass fills this in

How the heat travelled

10-14 13:00⭐ origin echo-reconstructedThe author reports 270 unattended coding-agent runs across three models, seven tasks, and three conditions (no guardrails, rules, and gates)
Rakesh Menon on blog (echo) · attributed from hn.story.50268368
—
10-28 01:46first on hacker news · published · +324.8hDo Guardrails Make AI Coding Agents Better? What 270 Runs Showed
Bootstrapper909
—
10-28 01:46amplified on hacker news 👑hn.story.50268368
Bootstrapper909
peak 2 · 0 comments · 97% of case engagement
10-28 02:28our radar first saw it · +325.5hdiscovery anchor: hn.story.50268368—

Evidence (2) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnDo Guardrails Make AI Coding Agents Better? What 270 Runs Showed
Retrieved article excerpt

Open article · Retrieved 2026-10-28T02:30:28.754582+00:00

From the blog

# Do Guardrails Make AI Coding Agents Better? What 270 Runs Showed

By [Rakesh Menon](https://secondtimeisabug.com/#author-h)15 October 20266 min read

Every team that works with a coding agent ends up having the same argument. Someone has built the scaffolding: an instruction file, a pre-commit gate, a hook that refuses “done” until the tests have run. Someone else notices that the agent passes the tests anyway.

Then the gate refuses the agent six times in one morning, and someone asks out loud: do the guardrails pay, or are they ceremony? It usually gets settled by conviction, because the costs arrive as waiting and the benefits as problems that never happened.

So for the book I ran an experiment.

> In 270 unattended runs of a coding agent, across three models and seven tasks, every change was eventually accepted, and the guardrails did not raise first-pass rates. They showed up in what runs left behind at “done”: on the four later tasks, 9 of 60 runs with gates left a defect against 15 of 60 with none, a gap too small in this sample to call.

## One run that passed every test

The task, T7, asked for recurring invoices. One run, with no instruction file and no hooks, passed the hidden acceptance tests at the first attempt. Then the project’s own checks ran on what it left behind, and one failed: it had changed the database schema without the test the team’s rule requires for every schema change, a rule this run never saw.

## How the experiment was set up

I ran them on 13 and 14 October 2026 with Claude Code 2.1.296, five runs per task, condition and model, interleaved: Sonnet and Opus on three everyday features (T1 to T3), then Haiku, Sonnet and Opus on four harder tasks (T4 to T7). As the diagram below shows, **none** got the task and the code, **rules** added an instruction file, and **gates** added a pre-commit gate and a hook that refuses “done” without fresh test evidence. The acceptance tests were hidden; on T4 to T7, any failure of the project’s own checks counted as a **defect at done**.

Three conditions, one layer apart
A staircase chart of what the agent gets in each condition. All three conditions (none, rules, gates) get a fresh copy of the codebase, without the hidden tests or git history, and the task text. Rules and gates also get an instruction file, AGENTS.md. Only gates also gets the instruction to run the gate and show test evidence, plus a pre-commit gate, a stop hook and a hook that blocks destructive commands. Each condition runs seven tasks, five times per task and model, interleaved, and a bracket marks the cross comparison: a cheaper model with gates against a stronger model with none.

none
rules
gates








pre-commit gate, stop hook and
a hook on destructive commands
instruction to run the gate
and show test evidence first
an instruction file, AGENTS.md
the task text
a fresh copy of the codebase,
no hidden tests, no git history







each condition: seven tasks,
5 runs per task and model, interleaved

cheaper model with gates against
stronger model with none

Neighbours differ by exactly one layer; the bracket marks the comparison across models.

## Did guardrails raise the pass rate?

No. All 270 runs were accepted, and 267 passed the hidden tests at the first “done”: none 90 of 90, rules 89 of 90, gates 88 of 90. The statistical tests I wrote down in advance found no clear difference between conditions for any model.

## Where the harness did show up

Back to T7. Without the instruction file, 14 of 15 T7 runs changed the schema without its test, whichever model ran; with the rule, none of 30 did. The rule says a migration and its database test change together: the Also-Update List (P04), Chapter 3, measured ([more on such files](https://secondtimeisabug.com/blog/agents-md-best-practices/)).

Pooled over T4 to T7, defects at done were 15 of 60 with none, 14 of 60 with rules and 9 of 60 with gates. Sonnet showed the widest gap, 1 against 5, and even that gave p = 0.18: a lead, not proof.

One caveat: T4 cannot be done without changing an existing test, and the instruction file says tests are read-only for agents. Under that rule, 23 of 30 runs built the feature, left the old test failing and asked a person to change it, which accounts for every defect under rules and gates. The rule was right ([why it exists](https://secondtimeisabug.com/blog/stop-ai-agent-deleting-tests/) is Chapter 6, a free [sample chapter](https://secondtimeisabug.com/sample/the-second-time-is-a-bug-chapter-6.pdf)), but nobody came, and “asked a person” counted the same as “left a bug”.

What the three conditions changed
Counts of runs in each condition: none, rules and gates. Passed the hidden tests at the first done, all tasks, 90 runs each: 90, 89 and 88. What the run left behind: a migration without its test, task T7, 15 runs each: 14, 0 and 0. Files changed outside the task by the large model, both batches, 35 runs each: 10, 2 and 1. An existing test left failing for a person, task T4, 15 runs each: 0, 14 and 9; these two bars are marked as the rule that stopped the change.
none
rules
gates

the task
Passed at the first done
all tasks, 90 runs each


90 of 90


89 of 90


88 of 90

what the run left behind
Migration without its test
T7, 15 runs each


14 of 15

0 of 15

0 of 15
Files changed outside the task
large model, 35 runs each


10 of 35


2 of 35


1 of 35
Test left failing for a person
T4, 15 runs each

0 of 15


14 of 15


9 of 15

The pass rate hardly moved; what the runs left behind did, and the read-only test rule cut the other way. Data: the author’s 270 runs.

## What did each accepted change cost?

The Cost per Accepted Change (P32), Chapter 12, divides the cost of every run, failed ones included, by the changes accepted. On T4 to T7, 20 runs per cell:

| Model | none | rules | gates |
| --- | --- | --- | --- |
| Haiku | $0.06 | $0.04 | $0.05 |
| Sonnet | $0.27 | $0.28 | $0.30 |
| Opus | $0.97 | $0.84 | $0.82 |

The harness barely moved the cost; the model moved it more than tenfold. All 270 runs together cost an estimated $115.58, the agent tool’s own estimate at list prices, not a bill.

This post is the short version. The book gives you the full analysis per model and task, and how to price every guard and retire the ones that stop paying (Chapters 12 and 13).

[Buy the book (opens in a new tab)](https://leanpub.com/secondtimeisabug)[Read Chapter 6 free](https://secondtimeisabug.com/sample/the-second-time-is-a-bug-chapter-6.pdf)

## Which guards are still paying their way?

Every guard is a bet, placed [the second time a mistake happens](https://secondtimeisabug.com/blog/ai-coding-agent-same-mistake/), that the model will make it again. Guards Pay Rent (P33), Chapter 12, prices each one: wait, noise and upkeep against real catches.

## What these runs cannot tell you

Five runs per cell is the protocol’s minimum, on seven tasks, one small codebase, one agent and three models from one vendor, as they were in October 2026. I wrote the tasks, tests and harness, which could favour the harness, and the defect measure uses its own guards.

## Check it yourself

Everything is in the [companion repository (opens in a new tab)](https://github.com/second-time-is-a-bug-book/book-companion): the run records in [`experiment/results/` (opens in a new tab)](https://github.com/second-time-is-a-bug-book/book-companion/tree/v1.0.0/experiment/results), the plan for T4 to T7 in [`BATCH-2.md` (opens in a new tab)](https://github.com/second-time-is-a-bug-book/book-companion/blob/v1.0.0/experiment/tasks/BATCH-2.md), written before any of those runs, and [`reproduce.ts` (opens in a new tab)](https://github.com/second-time-is-a-bug-book/book-companion/blob/v1.0.0/experiment/results/reproduce.ts), which recomputes every number the book quotes:

```
node experiment/results/reproduce.ts
```

And the T7 run? Count passes and it was perfect; count what it left behind and it was one of fourteen that handed on a schema change with no test. Which answer you get depends on what you measure, and so does the argument about ceremony.

## Questions people ask

### Was the harness worth it?

Not in pass rate or cost: first passes were 88 to 90 of 90 in every condition, and cost per accepted change sat within 15 cents for each model. It showed up in what runs left behind, at the price of runs that stopped for an absent person; whether that pays is a judgement call.

### Which model gave the cheapest accepted change?

Haiku: $0.04 to $0.06 per accepted change on T4 to T7, against $0.27 to $0.30 for Sonnet and $0.82 to $0.97 for Opus, with all 60 runs passing at the first “done”. It was enough for small, fully specified tasks, which says nothing about larger work.

### Can I run the same experiment on my own code?

Yes: the repository holds the protocol, seven tasks with hidden acceptance tests and a scorer that counts failed runs in the cost per accepted change. Swap in tasks from your own backlog, run each condition at least five times, interleaved, and report the spread as well as the mean.
Bootstrapper90920
🟧 echo.blog ⭐The author reports 270 unattended coding-agent runs across three models, seven tasks, and three conditions (no guardrails, rules, and gates)Rakesh Menon——

Interpretation history

Decision trace