Skip to content

guidelines: four lessons from auditing a production agent fleet - #26

Closed
pallaoro wants to merge 1 commit into
mainfrom
greybeard-lessons-from-agent-audit
Closed

guidelines: four lessons from auditing a production agent fleet#26
pallaoro wants to merge 1 commit into
mainfrom
greybeard-lessons-from-agent-audit

Conversation

@pallaoro

@pallaoro pallaoro commented Aug 7, 2026

Copy link
Copy Markdown
Member

Four additions to the guidelines, all from a single debugging session on a live multi-agent system. Worth stating the common shape up front, because it's what makes them worth adding: a customer-visible failure turned out to be three separate instances of the same problem — a correct rule that existed, was read in the same session, and wasn't followed. None of them was a missing rule.

§4 — A test that has never failed is not a regression test

Writing the test after the fix is the normal order when the bug came from production, but a green test proves only that the implementation does what it does. Revert the fix, watch it fail with the signature you expect, restore.

In the session behind this, doing exactly that turned 7 passing tests into 5 failures — the headline one reproducing the incident's signature verbatim. Without that step I'd have shipped tests that asserted my own implementation.

§6 — The DRY test applies to rules, not just skills

An instruction duplicated across a prompt, a config file and a skill is three copies that drift, and the agent reading all three can't tell which is current. One banned construct in that system was specified in three places that disagreed with each other, including one that endorsed the opposite. When a rule is being violated, the first move is to count the copies — not to write a clearer one.

§6 — A rule that isn't enforced isn't a rule

If an instruction is written down, read in the very session that broke it, and still ignored, more prose won't change that. Either something else the agent reads contradicts it, or it needs a mechanical guard instead of a sentence.

§6 — Examples outrank rules; audit them against each other

The observed cause of the above. A skill banned a construct in a rule near the bottom of an 18KB file while demonstrating it 44 times in the examples above — including inside the "good examples" it told the agent to emulate. The examples won, because they're concrete. Hard rules go before examples, and every example gets checked against the rule it illustrates.

§7 — A working copy is a cache, not the source

Refresh before reasoning about repo state. A local clone goes stale silently, and faster when platform tooling commits on your behalf. I read a three-days-stale clone during that session and reported its contents as current — a confident, well-grounded answer about a file nobody had anymore.


Mechanics: CLAUDE.md is the source; ran npm run build to regenerate the six fanned-out rule files. npm run check-sync (what CI runs) passes, and all four additions verified present in each of the six copies.

Scope note: these are sub-rules inside existing principles, not new principles, so the README's "Seven Principles" table and detail sections stay accurate and are untouched. Say the word if you'd rather the detail sections mention the new material too.

…§6, §7)

All four come from one debugging session on a live multi-agent system, where a
customer-visible failure turned out to be three separate instances of the same
shape: a correct rule that existed, was read, and wasn't followed.

§4 — A test that has never failed is not a regression test.
Writing the test after the fix is normal when the bug came from production, but
a green test only proves the implementation does what it does. Revert the fix,
watch it fail with the expected signature, restore. Anchor the assertion on the
real failure so the next reader knows why the guard exists.

§6 — The DRY test applies to rules, not just skills.
An instruction duplicated across a prompt, a config and a skill is three copies
that drift, and the agent can't tell which is current. In the session behind
this, one banned construct was specified in three places that disagreed. When a
rule is being violated, count the copies before writing a clearer one.

§6 — A rule that isn't enforced isn't a rule.
If an instruction is written down, read in the very session that broke it, and
still ignored, more prose won't help. Either something else contradicts it, or
it needs a mechanical guard rather than a sentence.

§6 — Examples outrank rules; audit them against each other.
The observed cause of the above: a document banned a construct in a rule near
the bottom while demonstrating it 44 times in the examples above. The examples
won. Hard rules go before examples, and every example gets checked against the
rule it illustrates.

§7 — A working copy is a cache, not the source.
Refresh before reasoning about repo state. A local clone goes stale silently,
faster when platform tooling commits on your behalf, and reporting a stale
snapshot as current produces a confident answer about a file nobody has.

Regenerated the six fanned-out rule files; `npm run check-sync` passes.
@pallaoro

pallaoro commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

Closing: this was a misread on my part. The ask was to update the installed plugin, not to propose guideline changes.

@pallaoro pallaoro closed this Aug 7, 2026
@pallaoro
pallaoro deleted the greybeard-lessons-from-agent-audit branch August 7, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant