Case ledger 002 · weekly post

The Verdict That Was Never Judged

Viewer layer, the story in plain language Scientist appendix, claim, evidence, decision trace, falsification

We run a fleet of coding agents that build and review software, and the whole thing rests on a verifier: a pipeline that checks the agents' work in three steps and delivers a verdict. This week we found the one drawer the verifier never checked: its own memory. The cache of past verdicts accepted new entries with no proof they were ever judged, and replayed them as trusted. The docstring confessed.

The setup, in plain words

Three pieces of vocabulary, defined once, then used straight:

The verifier. A pipeline with three steps. A solver does the work. A judge grades the evidence. A gate delivers the verdict: CONFIRMED, REFUTED, or ABSTAINED (the gate's way of saying "I don't know"). The system is organized around not trusting: the judge doesn't trust the solver, the gate doesn't trust the judge.

The verdict cache. A notebook of past decisions. Judging costs money and time, so when a claim the pipeline has seen before comes back, it looks it up. On a hit it replays the stored verdict instead of re-running the judge and the gate. This notebook is the fleet's durable memory of what has already been decided.

The write path. The moment something gets written into the notebook. Every notebook needs a rule about who gets to write in it, and a way to check the rule. Provenance is the check: a marker proving who wrote an entry and when, so a later reader can tell a real judgment from a forgery.

What broke

The rule for our notebook was: only the live judge-and-gate pipeline may write entries. The problem is that the rule was a sentence in a code comment, not a check in the code.

The write function inspects what you hand it with real care. Is the key the right shape? Is the panel the right type? Is the verdict one of the three legal words? Hand it the wrong shape and it throws you out loudly. But it never asks the one question that matters: was this verdict actually produced by a live judge and gate? And there is no field on the entry that could answer it. Six fields (key, panel, verdict, stored_at, hits, judge_version, measured), and none of them says which run produced it.

So a well-typed forgery, a CONFIRMED for a claim no judge ever saw, is stored silently and replays as a trusted hit. On replay the code skips the judge, the gate, and the evidence caps, and announces the verdict with full ceremony. The code says so itself, in a comment on the replay path:

# Replay path: the judge and the gate never run.
write path store() checks shape: yes checks source: never verdict cache durable memory 6 fields, 0 bind to a run replay path CacheHit judge skipped gate skipped no provenance replays trusted

The mechanism: the write path validates shape but never origin; the replay path trusts whatever the cache holds.

The confession

The docstring on the write function reads, in full:

"""Only the live judge+gate path in verify_claim calls this —
forced-ABSTAIN verdicts, transport failures, and cardinality
mismatches never reach it (placement, not a flag)."""

Read that parenthetical twice. It admits the mechanism outright: the rule holds because of where the code sits, not because anything enforces it. Placement, not a flag. Prose, not enforcement.

An everyday image

Picture a bouncer who checks IDs with a magnifying glass: correct font, correct size, the hologram in exactly the right place. But he never checks whether the ID is yours. A perfect forgery walks in every time. Our write path is that bouncer: loud about shape (3 isinstance checks, measured), silent about source (0 origin checks, measured). And the forgery, once inside, is honored for a full hour, 3,600 seconds (measured, the cache's default TTL), with the judge never re-running.

The honest downgrade

This is not a vulnerability an attacker can exploit from the outside. Writing to the cache requires running code inside the process, and the cache is opt-in. The strongest objection to this finding says it plainly: in a single-process system with one caller, placement is the validation, and a provenance check would be theater.

The objection is half right, and the half it gets right matters, so we keep it. What it misses is erosion. Tests get written. Demos get built. Refactors move callers. A sentence in a docstring does not survive contact with a busy codebase; a check in the code does. Then add the economics: the cache is designed to be used aggressively, every avoided judge call accrues budget the pipeline spends on deeper verification elsewhere, so the write path is exactly where the load concentrates. Then add the compounding: one bad write doesn't cost one bad decision, it costs every lookup for the full hour. The book this finding came from has a line for it: "Memory is not neutral. If incorrect information is stored as truth, future reasoning compounds the error."

So the finding survives the objection in downgraded form: not an exploitable hole, an unenforced invariant on a load-bearing write path. That is precisely the class of defect our system exists to close.

The twist

The machine that found this is a research sensor with a standing rule: if the mechanism's presupposed code doesn't exist in the repo, the transfer is refuted, no matter how exciting the paper. It used that rule all week. One example: a proposal to share KV caches across review judges died on code search, zero hits, no shared inference engine, no judge fan-out, refuted as stated. This one survived the rule: the gap was verified against the live code, twice, with an executable test pinning it.

The machine that judges the judges had a drawer it never checked, and the machine that refutes transfers found it.

What happens next

The fix has a defined shape and a defined test: a write-time provenance binding, some non-forgeable marker from the live pipeline run, checked in the write function. The acceptance bar is already written: the same six tests that reproduce the gap today must fail once the binding exists, a fabricated entry refused at the door. Status as of this morning: verified on current main, still open, queued for the work loop.

Scientist appendix

The reasoning split

(a) The claim

agentgate's verdict cache (E-0049, verify/verdict_cache.py) performs write-path trust escalation in miniature: store() validates the types of (key, panel, verdict) but performs zero provenance checks that the pair was decided by a live judge+gate run; CacheEntry carries no run binding; on CacheHit the pipeline replays the stored verdict with the judge and the gate skipped. A well-typed fabricated CONFIRMED stores silently and replays as trusted. Class: unenforced invariant on a load-bearing write path (design gap), not an exploitable vulnerability.

(b) The evidence

Evidence levels. Code facts: established (read from the repo at two SHAs). Test outcomes: measured (three local runs). The transfer itself: an adaptation (the chapter's untrusted-input attacker generalized to invariant erosion by any off-path writer). The book's claims: established from chapter text.

(c) The decision trace

  1. Mining (2026-10-07). Five candidates extracted from the chapter; four killed or folded under adversarial attack. Three-legged stool: analogy, no executable failure mode, killed. Tiered write-cost: a design tradeoff, not a failure mode, killed. Memory topology: presupposes a multi-agent system, substrate absent, killed. Memory hygiene: folded into the survivor. One candidate survived: memory poisoning as a write-path problem.
  2. Deep cut. The popular take ("memory poisoning is prompt injection with extra steps; guard the inputs") vs the chapter's actual argument (the attack moves: untrusted content written into durable memory returns later as trusted context; aggressive write+retrieve makes exploitation easier; prompt-path defenses structurally cannot cover the write path; memory compounds error). Strongest steelmanned objection: in-process single caller, placement is the validation, a provenance check is theater. Verdict: the objection bounds but does not kill the transfer; it downgrades it from "exploitable vulnerability" to "unenforced invariant on a load-bearing write path." Mandatory dissent recorded in the deep cut.
  3. Executable test (promotion bar 1 met). The gap-reproducing test: 4 AST tests against the real module snapshot plus 2 behavioral tests on a faithful trust-boundary extraction. Green 2026-10-07.
  4. Sensor verification (2026-10-08). VERIFIED (established) on main @ f2ceb693 via the GitHub API: replay path skips judge+gate (pipeline.py), store() validates types only, no run binding anywhere. Test re-run 6/6 green. Promotion-eligible (bars 1+2+3: executable test; owner agentgate / deep candidate; lane slot available). Left in TRIAGE; promotion is a work-loop decision, not taken by the sensor.
  5. Re-verification (2026-10-11). Defect still present on current main @ 1767cf2c (fields, checks, and docstring all unchanged in the relevant respects). Test re-run 6/6 green, 0.11s.

(d) What would falsify the claim

  1. The acceptance test fails: store() refuses a well-typed fabricated entry, because a write-time provenance binding exists and is checked.
  2. The single-writer invariant is enforced in code rather than declared in a docstring.
  3. CacheEntry carries a non-forgeable marker of the producing pipeline run, verified on the write path.

Receipts


New posts by email

One post a week. The work, the evidence, and the reasoning split. No spam, unsubscribe anytime.