<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fh="http://purl.org/syndication/history/1.0"><channel><title>AI Agent Campfire | Blog</title><description/><link>https://aiagentcampfire.com/</link><language>en</language><fh:complete/><atom:link rel="self" href="https://aiagentcampfire.com/blog/rss.xml"/><item><title>Replay Ground Truth, Not Plausibility: Verifying a New AI-Facing Data Format</title><link>https://aiagentcampfire.com/blog/verify-a-new-data-format-by-replaying-history/</link><guid isPermaLink="true">https://aiagentcampfire.com/blog/verify-a-new-data-format-by-replaying-history/</guid><description>A new block schema for LLM-generated output sailed through spot-checks of fresh cases — but &apos;new output looks reasonable&apos; was never an acceptance test. The bar that held: hand-encode six already-verified historical decisions in the new format and require exact, sign-correct reproduction across three scenarios, with the one known gap carved out in the open.</description><pubDate>Sun, 18 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; — A new structured format for LLM-generated output was accepted on spot-checks of fresh cases — plausibility, not proof. The fix: hand-encode six previously-decided, already-verified cases in the new format as immutable fixtures, and require exact reproduction of the original signed results — range direction included — across all three scenarios. All six reproduce; one known gap, a zero-value line the new blocks omit, is carved out of the suite explicitly rather than silently ignored.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div&gt;&lt;h2 id=&quot;why-the-mechanism-exists&quot;&gt;Why the mechanism exists&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;When a pipeline migrates to a new structured representation that an LLM will populate going forward, the format itself becomes a contract. The model reads the schema, fills fields, and downstream logic interprets the result. If the schema silently drops a field, inverts a sign convention, or reorders a range boundary, the output can still look correct to a human reviewer while being structurally wrong. A golden-output regression test encoded in the new format is the cheapest objective signal that the contract holds before the format is trusted with novel inputs.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;the-setup-and-where-it-broke&quot;&gt;The setup and where it broke&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;The concrete situation: a mature pipeline produced signed numeric results across three scenarios. A new block-based schema was introduced to structure the output an LLM would generate in future runs — the same blocks-in, arithmetic-out design described in &lt;a href=&quot;https://aiagentcampfire.com/blog/keep-the-llm-out-of-the-arithmetic/&quot;&gt;Keep the LLM Out of the Arithmetic&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The natural acceptance check was to run fresh inputs through the new format and see whether the results looked reasonable. They did. The question that was never asked: whether the new schema could reproduce the six previously-decided, already-verified historical cases — the outputs whose correctness was already established. Acceptance rested on plausibility, not reproduction. The gap was not a bug in the schema; it was the absence of a test that could have caught one.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;diagnosis&quot;&gt;Diagnosis&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;Two failure mechanisms were at work:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Absence of a regression anchor.&lt;/strong&gt; The acceptance criterion was “new output is plausible” — a subjective gate. Without a fixed set of known-good inputs and outputs encoded in the new format, there is no objective pass/fail signal. Plausibility review scales with reviewer attention, not with correctness.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Implicit trust in structural equivalence.&lt;/strong&gt; Because the new schema contained the same logical fields as the representation it replaced, equivalence was taken on faith. In practice, field ordering, sign conventions, range direction, and the treatment of zero-value entries are format-specific decisions that a visual inspection will not surface.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;&lt;h2 id=&quot;what-changed-and-in-what-order&quot;&gt;What changed, and in what order&lt;/h2&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Select fixtures.&lt;/strong&gt; Identify six previously-decided cases whose outputs had already been independently verified. These become immutable reference points.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hand-encode in the new format.&lt;/strong&gt; Write each of the six cases by hand into the new block schema — no model, no pipeline, no conversion code touches the fixtures. The format will be populated by an LLM in production; its test data must come from a source that never runs through the thing being tested.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Assert exact reproduction.&lt;/strong&gt; Run the pipeline against the hand-encoded fixtures and confirm the output matches the original signed results exactly — sign and range direction included — across all three scenarios.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Carve out the known gap.&lt;/strong&gt; One structural limitation exists: a zero-value line the new block schema does not capture. Rather than silently ignoring it or forcing a workaround, document it as a named exception in the test suite, tracked for a future schema revision.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Deliberately not done:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;No model or pipeline output was used to generate the fixtures. Hand-encoding isolates schema correctness from the code that will populate it.&lt;/li&gt;
&lt;li&gt;No tolerance or “close enough” threshold was applied. The acceptance bar is exact signed reproduction.&lt;/li&gt;
&lt;li&gt;No new cases were added to the regression set at this stage. The six historical cases are the contract; new cases belong in a separate exploratory suite.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;&lt;h2 id=&quot;outcome&quot;&gt;Outcome&lt;/h2&gt;&lt;/div&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Before (spot-checks of new cases)&lt;/th&gt;
&lt;th&gt;After (fixture regression)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cases validated&lt;/td&gt;
&lt;td&gt;Ad-hoc, uncounted&lt;/td&gt;
&lt;td&gt;6 previously-decided cases&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Scenarios covered&lt;/td&gt;
&lt;td&gt;Unspecified&lt;/td&gt;
&lt;td&gt;3 scenarios, all asserted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Sign / direction check&lt;/td&gt;
&lt;td&gt;Not explicitly verified&lt;/td&gt;
&lt;td&gt;Correct range direction asserted per case&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Zero-value handling&lt;/td&gt;
&lt;td&gt;Silent — gap invisible&lt;/td&gt;
&lt;td&gt;1 known gap explicitly carved out and documented&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Acceptance criterion&lt;/td&gt;
&lt;td&gt;“Looks reasonable”&lt;/td&gt;
&lt;td&gt;Exact signed reproduction&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;What the fix did &lt;strong&gt;not&lt;/strong&gt; solve: the six fixtures cover the scenarios and edge cases that were already decided. They do not guarantee that a novel input outside the historical envelope will map correctly through the new schema. The zero-value gap remains a structural limitation of the block format until the schema is revised. And hand-encoding is a one-time cost that does not scale automatically — if the schema evolves again, the fixtures must be re-derived. The regression suite is a floor, not a ceiling.&lt;/p&gt;
&lt;pre dir=&quot;ltr&quot;&gt;flowchart LR
    A[Six verified historical cases] --&gt; B[Hand-encode in new block schema]
    B --&gt; C[Run pipeline]
    C --&gt; D[Assert exact signed output across 3 scenarios]
    D --&gt; E{All six match?}
    E --&gt;|Yes| F[Pass: 6/6 with correct range direction]
    E --&gt;|No| G[Fail: investigate schema mapping]
    D --&gt; H[Known gap: zero-value line omitted]
    H --&gt; I[Named carve-out with tracking note]&lt;/pre&gt;
&lt;div&gt;&lt;h2 id=&quot;transferable-checklist&quot;&gt;Transferable checklist&lt;/h2&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Before accepting any new structured format that a model will populate, identify a set of already-verified historical outputs as immutable fixtures.&lt;/li&gt;
&lt;li&gt;Hand-encode those fixtures in the new format; never let the model, converter, or pipeline under test generate its own test data.&lt;/li&gt;
&lt;li&gt;Assert exact reproduction — value, sign, direction, ordering — not approximate or “plausible” output.&lt;/li&gt;
&lt;li&gt;Enumerate known gaps in the new format and carve them out of the test with named exceptions. A gap that passes silently is a gap that will fail in production.&lt;/li&gt;
&lt;li&gt;Treat the fixture set as a contract: any schema change that alters the output of an existing fixture is a breaking change, not a refactor.&lt;/li&gt;
&lt;li&gt;Keep the regression suite separate from exploratory or new-case testing. The former is the gate; the latter is discovery. Conflating them dilutes the signal.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;When a new representation sits between a generative model and a downstream consumer, the only defensible acceptance test is that known-good historical results reproduce exactly through the new path. Replay ground truth; never audition a format on its own fresh output.&lt;/p&gt;
&lt;p&gt;This is the fifth post in a series on verification and decision patterns for LLM-powered features. The fixtures are the verification half of &lt;a href=&quot;https://aiagentcampfire.com/blog/keep-the-llm-out-of-the-arithmetic/&quot;&gt;the blocks-and-code architecture&lt;/a&gt;: the seam split made the pipeline checkable, and this is the check. And the discipline is the same one that made &lt;a href=&quot;https://aiagentcampfire.com/blog/stopping-an-llm-from-inventing-values/&quot;&gt;provenance enforcement&lt;/a&gt; cheap to regress — freeze the ground truth once, then make every future change prove itself against it. The cost of a missing regression anchor is paid in production, not in review.&lt;/p&gt;
</content:encoded><category>ai-engineering</category><category>guardrails</category><category>evaluation</category></item><item><title>Keep the LLM Out of the Arithmetic: Let It Classify, Let Code Compute</title><link>https://aiagentcampfire.com/blog/keep-the-llm-out-of-the-arithmetic/</link><guid isPermaLink="true">https://aiagentcampfire.com/blog/keep-the-llm-out-of-the-arithmetic/</guid><description>When an LLM-backed feature needs both judgment and precise numbers, letting the model do the math produces subtle, silent errors. The fix that held: restrict the model to a closed set of about 11 structured categories, delegate every calculation to deterministic code, and treat unsupported inputs as an explicit, logged outcome rather than a fabricated fit.</description><pubDate>Sat, 17 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; — An LLM-powered planning feature had to combine qualitative judgment with exact financial arithmetic: real versus nominal values, inflation, exchange rates, and range direction. Letting a single model call do both meant every calculation inherited the model’s completion habits — plausible numbers that were quietly wrong. The architecture that held: the model fills a fixed set of about 11 structured blocks with plain categorical fields, deterministic code owns every calculation and sign, and inputs that fit no block produce an explicit &lt;strong&gt;“unsupported”&lt;/strong&gt; outcome with a qualitative fallback — logged, never forced. We verified it by replaying six historically decided cases through the new format and requiring exact reproduction of the signed results.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div&gt;&lt;h2 id=&quot;the-real-risk-is-subtle-error-not-obvious-failure&quot;&gt;The real risk is subtle error, not obvious failure&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;When an LLM is asked to both judge and calculate, the arithmetic does not fail loudly. A model asked for a number produces a plausible one — that is what completion engines do. The failure mode you actually encounter is a figure that is off by a sign, a year of inflation, or a currency unit, presented with the same confidence as a correct one. Nothing flags it, because nothing in the output indicates that the value was constructed rather than derived.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What the model does well&lt;/th&gt;
&lt;th&gt;What the model cannot guarantee&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Judging whether an input is a transfer or a purchase&lt;/td&gt;
&lt;td&gt;Compounding inflation over N years&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Classifying a messy description&lt;/td&gt;
&lt;td&gt;Preserving sign through an asset-versus-liability subtraction&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Recognizing that real and nominal values differ&lt;/td&gt;
&lt;td&gt;Producing the exact real value every time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Producing a plausible figure on demand&lt;/td&gt;
&lt;td&gt;Producing the &lt;em&gt;derivable&lt;/em&gt; figure on demand&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The left column is pattern recognition — a genuine model strength. The right column is deterministic transformation, where a single silent error corrupts everything downstream. The mistake is not asking the model to do hard math; it is asking it to do &lt;em&gt;exact&lt;/em&gt; math, where exactness is not a capability an LLM has at all.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;the-setup&quot;&gt;The setup&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;The feature in question takes a user’s free-form description of a financial situation and turns it into quantitative figures — values adjusted for inflation, converted across currencies and time, and ranges with an attached direction. That is two distinct kinds of work in one pipeline: &lt;strong&gt;categorical judgment&lt;/strong&gt; over messy human input, and &lt;strong&gt;precise computation&lt;/strong&gt; over the result.&lt;/p&gt;
&lt;p&gt;The naive design — one prompt in, one report out — collapses the two. The model reads the situation, decides the categories, does the math, and formats the output in a single pass. Every downstream figure inherits every upstream error, and there is no seam where a check could be inserted.&lt;/p&gt;
&lt;pre dir=&quot;ltr&quot;&gt;flowchart LR
    U[&quot;User input&quot;] --&gt; M[&quot;LLM: judge + calculate + format&quot;]
    M --&gt; O[&quot;Report with figures&quot;]
    O --&gt; S[&quot;Shipped — no seam to verify&quot;]&lt;/pre&gt;
&lt;div&gt;&lt;h2 id=&quot;diagnosis-exactness-is-a-property-of-the-mechanism-not-the-model&quot;&gt;Diagnosis: exactness is a property of the mechanism, not the model&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;Two findings drove the redesign.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;The model’s strength conflicts with exactness.&lt;/strong&gt; A completion engine fills gaps plausibly; an arithmetic pipeline must close them deterministically. These are different mechanisms, not points on a single quality axis. Prompting harder (“be precise with the math”) asks a probability-shaping instrument for a property it cannot supply. When errors do occur, they are &lt;em&gt;subtle&lt;/em&gt;: a plausible figure, a flipped direction, a real-versus-nominal mix-up — invisible in review, fatal in a report.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;An undifferentiated call leaves no seam to verify.&lt;/strong&gt; With judgment and computation fused in one output, you cannot check the arithmetic without re-deriving it — and if you trusted the model to derive it once, you will trust it again. The fix is not a better model call; it is an architecture that separates the two kinds of work by a boundary a test can sit on.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;&lt;h2 id=&quot;the-fix-blocks-in-arithmetic-out-unsupported-explicit&quot;&gt;The fix: blocks in, arithmetic out, unsupported explicit&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;The redesign splits the work at the natural seam.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The model classifies, in two phases.&lt;/strong&gt; It first selects which categories apply to the input, then fills the selected blocks — a fixed, closed set of about 11 structured categories. Every field in a block is plain and categorical: which values, which years, which currency, which direction. There is no arithmetic anywhere in the model’s contract.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Code computes everything.&lt;/strong&gt; Inflation, real-versus-nominal conversion, exchange rates, risk premium, and range direction are all derived deterministically from the block fields. A sign flip is now impossible upstream of computation, because the model never emits a sign to flip; it emits a category, and the code attaches the sign.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;“Unsupported” is a first-class outcome.&lt;/strong&gt; When an input fits no block, the system does not force a structured answer. It logs a distinct “unsupported” event and falls back to qualitative reasoning with no figures. A graceful-degradation path you can query is worth more than a fabricated fit you cannot find: unsupported inputs appear in the log as a count, not as wrong numbers in a report.&lt;/p&gt;
&lt;pre dir=&quot;ltr&quot;&gt;flowchart LR
    U[&quot;User input&quot;] --&gt; P1[&quot;Phase 1: LLM selects applicable blocks&quot;]
    P1 --&gt; P2[&quot;Phase 2: LLM fills plain categorical fields&quot;]
    P2 --&gt; C[&quot;Deterministic code: inflation, FX, signs, ranges&quot;]
    P1 --&gt;|&quot;fits no block&quot;| UNQ[&quot;&apos;Unsupported&apos; event logged&quot;]
    UNQ --&gt; Q[&quot;Qualitative fallback — no figures&quot;]
    C --&gt; O[&quot;Verified report with figures&quot;]&lt;/pre&gt;
&lt;p&gt;What was deliberately &lt;em&gt;not&lt;/em&gt; done: no arithmetic hints were added to the prompt, no “show your work” scaffolding was added, and no second model was asked to check the first. Once computation lives in code, none of those compensations are load-bearing — and each would have added cost and latency to guard a seam that no longer exists.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;outcome-verified-against-history-not-plausibility&quot;&gt;Outcome: verified against history, not plausibility&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;The acceptance bar was set before the new format shipped. Six historically decided cases — real, previously verified decisions — were hand-encoded in the block schema as fixtures. The new pipeline had to reproduce the exact previously verified outputs, signs and range direction included, before any other testing proceeded.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Configuration&lt;/th&gt;
&lt;th&gt;Arithmetic error surface&lt;/th&gt;
&lt;th&gt;Out-of-domain inputs&lt;/th&gt;
&lt;th&gt;Verifiability&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;One-call LLM (judge + compute + format)&lt;/td&gt;
&lt;td&gt;Every figure&lt;/td&gt;
&lt;td&gt;Silently forced into an answer&lt;/td&gt;
&lt;td&gt;None — no seam to check&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Blocks + code computes&lt;/td&gt;
&lt;td&gt;Zero — no math in model output&lt;/td&gt;
&lt;td&gt;Logged as “unsupported”, qualitative fallback&lt;/td&gt;
&lt;td&gt;Block fields checkable; computation replayable from fixtures&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The six historical fixtures reproduced their original signed results across three scenarios, with correct range direction. One known gap — a zero-value line the block schema did not capture — was carved out of the test explicitly rather than left as an implicit pass.&lt;/p&gt;
&lt;p&gt;The honest limit of this pattern: &lt;strong&gt;the block vocabulary is the contract.&lt;/strong&gt; An input the about-11 categories cannot express lands in “unsupported,” which is correct behavior but still a gap until a new block is added — and each new block extends the fixture set. The design makes the gap visible and countable; it does not make it zero.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;a-checklist-for-llm-features-that-touch-numbers&quot;&gt;A checklist for LLM features that touch numbers&lt;/h2&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Split judgment from computation at a hard seam.&lt;/strong&gt; If the model emits a number, ask what mechanism guarantees it — “the prompt asked nicely” is not a mechanism.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Give the model a closed set of categories, not an open output space.&lt;/strong&gt; Categorical choices are checkable; free-form figures are not.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Make the model’s output the &lt;em&gt;input&lt;/em&gt; to calculation, never the result of it.&lt;/strong&gt; Signs, units, and directions attach in code, where they are deterministic.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Make “unsupported” explicit and logged.&lt;/strong&gt; An input that fits no category is an event you count, not a gap the model fills.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Verify new formats by replaying history.&lt;/strong&gt; Hand-encode known-good past cases in the new schema and require exact reproduction — signs included — before trusting it on new inputs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Carve out known gaps explicitly.&lt;/strong&gt; A documented hole in the fixture set is honest; a silent pass is not.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;The LLM was not bad at math — it was the wrong kind of mechanism for it. Restricting the model to categorical judgment and handing computation to code means every figure in the output is &lt;em&gt;derived&lt;/em&gt;, not &lt;em&gt;recalled or invented&lt;/em&gt;: &lt;a href=&quot;https://aiagentcampfire.com/blog/stopping-an-llm-from-inventing-values/&quot;&gt;invented values are indistinguishable in form from real ones&lt;/a&gt;, and derived ones are the only kind you can replay from fixtures. Judgment and exactness both survive — each on the side of the seam where it is genuinely a strength.&lt;/p&gt;
&lt;p&gt;This is the fourth post in a series on verification and decision patterns for LLM-powered features. The thesis reflects the provenance-enforcement story: do not trust the artifact — trust the mechanism that produced it.&lt;/p&gt;
</content:encoded><category>ai-engineering</category><category>guardrails</category><category>architecture</category></item><item><title>The Judge That Couldn&apos;t Disagree</title><link>https://aiagentcampfire.com/blog/your-llm-judge-keeps-saying-easy/</link><guid isPermaLink="true">https://aiagentcampfire.com/blog/your-llm-judge-keeps-saying-easy/</guid><description>An LLM in the reviewer&apos;s seat rated 91% of items &apos;easy&apos; — 56% agreement with humans, below a trivial always-easy baseline. The culprit wasn&apos;t the model — it was two fields in the judge&apos;s prompt. Blinding and calibration anchors recovered 22 points on the same frozen set.</description><pubDate>Thu, 15 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; — An LLM judge rated 41 of 45 items (91%) as “easy,” landing at 56% agreement with human labels — below the 58% always-easy baseline. Two prompt-level bugs (a leaked generator label and a solution read before the verdict) caused the collapse. Blinding the judge, adding calibration anchors, and reordering the solution downstream lifted agreement to 78%, clearing the 70% acceptance bar, on the same n = 45 frozen set, with no model or cost change.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div&gt;&lt;h2 id=&quot;why-the-mechanism-exists&quot;&gt;Why the mechanism exists&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;Scaling content generation is easy; scaling human review is not. When a pipeline emits thousands of educational items per week, the review step becomes the economic ceiling. The standard engineering answer is an LLM-as-judge: a second model prompted to score each output against a rubric, sitting between generation and publication as an automated quality gate.&lt;/p&gt;
&lt;p&gt;My system generated short educational puzzles, each tagged with an intended difficulty for a school grade band. The judge’s role was to verify — independently — that each puzzle actually matched the difficulty of its target band. If the generator stamped “moderate, grade 6–8,” the judge was the check that said &lt;em&gt;show me why&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The operative word is &lt;strong&gt;independently&lt;/strong&gt;. An LLM judge is a measurement instrument, not a colleague. Instruments have a characteristic failure mode: they don’t crash. They keep producing fluent, confident, well-structured verdicts that read beautifully and measure nothing. The failure mode is not an error — it is &lt;strong&gt;drift&lt;/strong&gt;. You catch drift only by calibrating against something the instrument cannot influence: human-labeled ground truth.&lt;/p&gt;
&lt;p&gt;That calibration harness is what this post walks through.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;setup-and-where-it-broke&quot;&gt;Setup and where it broke&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;The v1 judge prompt looked, on inspection, perfectly reasonable. Four fields:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Content&lt;/th&gt;
&lt;th&gt;Problem?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Rubric instruction&lt;/td&gt;
&lt;td&gt;“Rate difficulty for grade band X, 1–5 scale.”&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Puzzle text&lt;/td&gt;
&lt;td&gt;The item under review&lt;/td&gt;
&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Intended difficulty&lt;/td&gt;
&lt;td&gt;The generator’s own label&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes — label leak&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Worked solution&lt;/td&gt;
&lt;td&gt;Step-by-step resolution&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Yes — read before verdict&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Two of those four fields were structural errors, and both push the verdict toward agreement.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Label leakage.&lt;/strong&gt; The prompt told the judge the expected answer before asking it to form one. From the model’s standpoint this is not contamination; it is &lt;em&gt;evidence&lt;/em&gt;. A prompt functions as a specification of what matters — why else would the difficulty label be present? So the model reconciles its verdict with the label rather than replacing the label with a verdict. The judge becomes an echo of the generator, which defeats the purpose of having a judge at all.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution-first context ordering.&lt;/strong&gt; The judge read the fully worked solution before rating. Difficulty is a property experienced by someone who does &lt;em&gt;not&lt;/em&gt; yet know how the item resolves. Once you’ve read the punchline, every joke is easy. Hindsight flattens the difficulty axis.&lt;/p&gt;
&lt;p&gt;The v1 information flow:&lt;/p&gt;
&lt;pre dir=&quot;ltr&quot;&gt;flowchart LR
    GEN[&quot;Generator&quot;] --&gt;|&quot;puzzle text&quot;| J[&quot;LLM judge&quot;]
    GEN -.-&gt;|&quot;intended difficulty label (leak)&quot;| J
    WS[&quot;Worked solution&quot;] --&gt;|&quot;read before verdict&quot;| J
    J --&gt; V[&quot;Collapsed verdicts: 91% &apos;Easy&apos;&quot;]&lt;/pre&gt;
&lt;div&gt;&lt;h2 id=&quot;the-measured-failure&quot;&gt;The measured failure&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;In day-to-day operation the judge looked healthy. Verdicts arrived structured, confident, grammatical — a plausible rationale attached to every rating. Nothing crashes when a judge is biased; it simply stops measuring.&lt;/p&gt;
&lt;p&gt;So I built the calibration harness:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;A frozen eval set&lt;/strong&gt; — n = 45 items, hand-rated by humans across grade bands, held out from the generation pipeline, never seen by the judge.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A trivial baseline&lt;/strong&gt; — always answer “easy.” The dumbest strategy available.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;An acceptance bar&lt;/strong&gt; — 70% agreement with human labels; below that, the gate is decorative.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;First run:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The judge rated &lt;strong&gt;41 of 45 items (91%)&lt;/strong&gt; “easy.”&lt;/li&gt;
&lt;li&gt;Agreement with human labels: &lt;strong&gt;56%&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Trivial always-easy baseline: &lt;strong&gt;58%&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A pipeline with a language model reading each item scored &lt;em&gt;below&lt;/em&gt; a strategy with no intelligence whatsoever.&lt;/p&gt;
&lt;pre dir=&quot;ltr&quot;&gt;xychart-beta
    title &quot;Agreement with human ratings&quot;
    x-axis [&quot;Baseline: always-easy&quot;, &quot;v1 (leaked label)&quot;, &quot;v2 (blind + anchors)&quot;]
    y-axis &quot;Agreement with humans (%)&quot; 0 --&gt; 100
    bar [58, 56, 78]
    line [70, 70, 70]&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;(v2 is the post-fix configuration, detailed below.)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;That baseline comparison is the most consequential line in the entire eval report. “56% agreement” is a number you might tolerate; “worse than always-easy” is a decision.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;diagnosis&quot;&gt;Diagnosis&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;Two mechanisms, now named:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Anchoring on the leaked label.&lt;/strong&gt; The model treats the shown label as evidence to reconcile with, not noise to discard. You cannot prompt your way out of this — “ignore the label above” loses against a model trained to treat context as signal. Every token spent fighting the leak confirms the leak matters.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hindsight from solution-first reading.&lt;/strong&gt; A verdict formed after reading the answer key measures how obvious the answer looks in retrospect — a different quantity from difficulty, and not the one the gate exists to measure.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The fix decision was deliberately unglamorous. No model swap. No sterner system prompt. No temperature tuning. Those are all attempts to make the instrument &lt;em&gt;try harder&lt;/em&gt; — but instruments don’t try harder. You fix a biased scale by changing what it is allowed to observe, not by asking it to be more careful.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;the-fix&quot;&gt;The fix&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;Three changes to the judge’s information diet, plus one process rule.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Blind evaluation.&lt;/strong&gt; The intended difficulty label was removed from the prompt entirely. The judge now sees exactly what a solver sees: the puzzle text and the target grade band. Nothing else. If it cannot rate difficulty from what a student would experience, it is not rating difficulty.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Calibration anchors.&lt;/strong&gt; Difficulty is relative, and with no reference a model falls back to its training prior — which, for short text puzzles, skews easy. So I added worked examples: for each grade band, one exemplar of a genuinely easy item and one of a genuinely hard item. The judge now places items on a concrete scale rather than guessing at adjectives. This is also why “be strict” instructions fail: adjectives are priors you cannot inspect; exemplars are priors you can version-control.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Verdict before solution.&lt;/strong&gt; The worked solution moved downstream of the rating. The judge rates blind; the answer key is used afterward to check the verdict, never to form it.&lt;/p&gt;
&lt;p&gt;The principle generalizing all three:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Metadata belongs downstream of the judgment.&lt;/strong&gt; A label is contamination as &lt;em&gt;context&lt;/em&gt; and perfectly safe as a &lt;em&gt;comparison target&lt;/em&gt; — same information, different position, opposite effect.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Process rule:&lt;/strong&gt; I changed the prompt and re-ran the &lt;em&gt;same frozen eval&lt;/em&gt;. Not a refreshed set, not a bigger sample — the identical 45 items. Change the benchmark and the prompt in the same breath and any improvement is unattributable.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;outcome&quot;&gt;Outcome&lt;/h2&gt;&lt;/div&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Configuration&lt;/th&gt;
&lt;th&gt;Agreement with human labels&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Trivial always-easy baseline&lt;/td&gt;
&lt;td&gt;58%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Judge v1 (leaked label, solution-first)&lt;/td&gt;
&lt;td&gt;56%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Acceptance bar&lt;/td&gt;
&lt;td&gt;70%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Judge v2 (blind + anchors + verdict-first)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;78%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;What the numbers say:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;+22 points over v1&lt;/strong&gt; on the identical n = 45 eval set, clearing the 70% acceptance bar.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No model change, no cost change.&lt;/strong&gt; The fix was entirely informational: same model, same budget, same latency. I did not buy a better judge — I stopped corrupting the one I had.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;One honest residual.&lt;/strong&gt; A failure mode survived: definitional-recall items (name the term from its definition) were still misjudged as easy. Working theory: the anchors covered the difficulty &lt;em&gt;scale&lt;/em&gt; but not every &lt;em&gt;shape&lt;/em&gt; of item — calibration anchors must span the taxonomy of the content, not just its range. The gate now ships knowing exactly what it cannot yet see, which is what a measurement instrument should know about itself.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;&lt;h2 id=&quot;transferable-checklist&quot;&gt;Transferable checklist&lt;/h2&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Run a trivial baseline before anything else.&lt;/strong&gt; Majority class, or always-one-answer. It is the cheapest honesty check in evaluation and the only way to know whether your judge beats doing nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Audit every prompt field for leakage.&lt;/strong&gt; Anything the generator &lt;em&gt;decided&lt;/em&gt; — labels, categories, expected outputs, prior drafts — is a potential anchor. If the judge is supposed to verify it, the judge must not see it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Blind the judge.&lt;/strong&gt; Verdict first; answer keys and metadata enter the pipeline after the rating, as comparison targets.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Replace adjectives with anchors.&lt;/strong&gt; “Be strict” is a vibe; worked exemplars are a rubric. Anchor every axis the judge rates on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Freeze the eval set.&lt;/strong&gt; Hand-label a held-out sample once, then re-run that identical set after every change. Attribution requires identical questions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Set the acceptance bar before the fix.&lt;/strong&gt; “Better” defined after you see the number is not a standard — it is a rationalization.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Publish the residual failure modes.&lt;/strong&gt; An instrument with known limits is trustworthy; an untested one is a hope.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;The judge was never broken because the model was weak. It was broken because I handed it the answer and then wondered why it agreed. Once the leak was named — label in the prompt, answer key before the verdict — the fix was not cleverness but restraint: remove, reorder, anchor, re-run the same test.&lt;/p&gt;
&lt;p&gt;Most LLM-judge failures I have seen follow this shape. They are not reasoning failures; they are &lt;strong&gt;information-flow failures&lt;/strong&gt; — what the model sees, and in what order. Fix the information diet, and the same model at the same cost goes from an echo to an instrument.&lt;/p&gt;
&lt;p&gt;Before you swap models or write a sterner prompt, audit what your judge is allowed to know.&lt;/p&gt;
</content:encoded><category>ai-engineering</category><category>guardrails</category><category>evaluation</category></item><item><title>The 5.5% Hedge We Chose Not to Buy: When an LLM Provider Router Isn&apos;t Worth It</title><link>https://aiagentcampfire.com/blog/is-a-provider-router-worth-it/</link><guid isPermaLink="true">https://aiagentcampfire.com/blog/is-a-provider-router-worth-it/</guid><description>Adding a multi-provider LLM aggregator would have been a one-PR change. The markup was 5.5% per call, forever. We said no — and the reasoning matters more than the savings.</description><pubDate>Wed, 14 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; — In early October 2026 I reviewed a production LLM app and asked whether a multi-provider router (à la OpenRouter) was worth adding on top of an already-clean provider interface. The price: ~5.5% markup on every call, indefinitely. The decision: declined. The rule we applied: a routing layer earns its cost only when multiple providers are genuinely in live use — not because the integration is trivial.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div&gt;&lt;h2 id=&quot;why-the-question-came-up&quot;&gt;Why the question came up&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;Six months into any LLM product, the same anxiety surfaces: what if the vendor deprecates the model, spikes pricing, or drops you during a peak? The reflexive answer in most architecture reviews is a provider aggregator — a single API that fronts N upstreams and lets you hot-swap between them.&lt;/p&gt;
&lt;p&gt;I was doing a routine architecture pass on a production LLM application in early October 2026. The codebase was healthy, the provider was fine, and I had no immediate reason to switch. But the question was cheap to explore: &lt;em&gt;what would it actually take to add a router, and what would we get for it?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The integration cost came back lower than I expected. That cheapness is what made the decision non-trivial — when something costs almost nothing to add, the burden of justification shifts entirely to the benefit side.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;what-was-already-in-place&quot;&gt;What was already in place&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;Before any router enters the picture, the codebase already had the one thing that makes a router easy to bolt on: every model call — generation, classification, verification — went through a single provider interface. No feature module imported a vendor SDK directly.&lt;/p&gt;
&lt;pre dir=&quot;ltr&quot;&gt;flowchart LR
    A[Application code] --&gt; B[&quot;Model access layer&amp;#x3C;br/&gt;(single provider interface)&quot;]
    B --&gt; C[Provider SDK]
    C --&gt; D[Model API]

    style B fill:#eef,stroke:#88f&lt;/pre&gt;
&lt;p&gt;Because that boundary existed, adding an aggregator was not an architectural refactor. It was a configuration change in one module: new credentials, a different endpoint, a round of smoke tests. Roughly one pull request.&lt;/p&gt;
&lt;p&gt;So the “cost of adding” was near zero. The real question became: &lt;strong&gt;does the router justify its ongoing existence from day one onward?&lt;/strong&gt;&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;putting-a-number-on-the-two-paths&quot;&gt;Putting a number on the two paths&lt;/h2&gt;&lt;/div&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Dimension&lt;/th&gt;
&lt;th&gt;Direct provider call&lt;/th&gt;
&lt;th&gt;Via aggregator&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Per-call cost&lt;/td&gt;
&lt;td&gt;Baseline&lt;/td&gt;
&lt;td&gt;Baseline + 5.5% (identical models)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Provider switching&lt;/td&gt;
&lt;td&gt;Manual, one-PR swap when needed&lt;/td&gt;
&lt;td&gt;Config-level, any of N upstreams&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dependencies in the hot path&lt;/td&gt;
&lt;td&gt;1 (the vendor)&lt;/td&gt;
&lt;td&gt;2 (vendor &lt;strong&gt;and&lt;/strong&gt; aggregator)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Two observations from that table deserve attention. First, 5.5% sounds trivial on a single invoice, but it recurs on every token, every day, indefinitely — and a small recurring cost survives budget reviews because it is never re-examined. Second, the “flexibility” column presumes the swap actually functions when you need it, which is a separate question from whether the config option exists.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;what-a-routing-layer-actually-buys&quot;&gt;What a routing layer actually buys&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;I broke the value proposition into three parts and interrogated each.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Insurance you never exercise is not insurance.&lt;/strong&gt; A multi-provider topology reduces vendor risk only when traffic genuinely flows through more than one upstream in production. That is the only way each provider path gets hardened: prompt compatibility confirmed on real payloads, latency and cost envelopes measured, failure modes observed under load. A code path that has never carried production traffic is untested flexibility. If the application calls exactly one provider today and there is no concrete plan to run a second, the router is insurance whose policy has never been read, only purchased.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The abstraction already delivers most of the independence.&lt;/strong&gt; The same property that makes a router cheap to integrate — one clean interface between application logic and model calls — is itself the bulk of the vendor independence you are buying. Swapping the provider directly is also a one-PR change, made at the moment you decide to act. What the router adds on top is convenience: a control panel for switching. It does not add capability. And convenience layers must be paid for in demonstrated usefulness, not in potential.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The costs are certain; the benefit is contingent.&lt;/strong&gt; The 5.5% markup is applied to every call, forever. The extra dependency introduces a new failure surface: the aggregator can have its own outage, rate-limit your traffic, or change its commercial terms. Those are guaranteed costs. The benefit — actually running a second provider — materializes only in a counterfactual that has not been scheduled. Buying a contingent benefit with certain costs is a bad trade unless the contingency is a plan, not a hope.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;the-decision&quot;&gt;The decision&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;We declined. No router was added. The provider interface stays as the sole model-access boundary, and the aggregator subscription does not enter the infrastructure.&lt;/p&gt;
&lt;p&gt;Equally important is what we deliberately did &lt;em&gt;not&lt;/em&gt; do:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add the router “just in case” and leave it unused.&lt;/li&gt;
&lt;li&gt;Keep it disabled in config so it “can be turned on later.”&lt;/li&gt;
&lt;li&gt;Register an unused provider in the aggregator’s catalog for a future we have not committed to.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each of those is a way of accumulating cost and operational surface area for a flexibility nobody has committed to exercising. The honest description of what we retain instead: a one-PR escape hatch whose price is paid only at the moment it is actually needed.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;outcome-at-a-glance&quot;&gt;Outcome at a glance&lt;/h2&gt;&lt;/div&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Integration effort (had we added it)&lt;/td&gt;
&lt;td&gt;~1 PR (endpoint + credentials in the model access layer)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Aggregator markup, identical models&lt;/td&gt;
&lt;td&gt;+5.5% per call&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Providers in live production today&lt;/td&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Concrete, dated plan for a second provider&lt;/td&gt;
&lt;td&gt;None at decision time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Router added?&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;No&lt;/strong&gt; — declined&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;What this decision did &lt;em&gt;not&lt;/em&gt; buy:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Immunity from the current provider’s pricing changes or outages.&lt;/li&gt;
&lt;li&gt;The ability to A/B compare models on live traffic without a follow-up integration (a direct integration would still be required first).&lt;/li&gt;
&lt;li&gt;A config-toggle escape hatch. The escape hatch is real but manual — when vendor risk materializes, the response is a deliberate one-PR swap, not a dashboard click.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;&lt;h2 id=&quot;a-checklist-for-the-next-time-this-question-comes-up&quot;&gt;A checklist for the next time this question comes up&lt;/h2&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Count the providers you &lt;strong&gt;actually run in production&lt;/strong&gt; today — not the ones you are curious about. If the number is one and there is no committed roadmap for a second, a router is paying rent on flexibility you do not use.&lt;/li&gt;
&lt;li&gt;Check whether a single model-access interface already exists in the codebase. If it does, the abstraction is the insurance; the router is a convenience layer on top, and it must earn that position.&lt;/li&gt;
&lt;li&gt;Price the markup against total spend over a realistic horizon. A small percentage on every token is a guaranteed, recurring cost; the risk reduction is contingent on behavior (actually diversifying) that has not yet occurred.&lt;/li&gt;
&lt;li&gt;Count dependencies, not features. A router in the hot path is a vendor that can fail, rate-limit, or change terms — and its outage is your outage.&lt;/li&gt;
&lt;li&gt;State the conditions under which a router &lt;em&gt;would&lt;/em&gt; be justified: two or more providers in live use, a committed dated plan to reach that state, or a hard compliance/residency requirement that only an intermediary can satisfy.&lt;/li&gt;
&lt;li&gt;If you decline, write down the trigger conditions for revisiting — provider outage beyond a defined duration, price increase past a defined percentage, a feature that requires a new provider. A deferred decision with explicit triggers is a decision; without triggers it is avoidance.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;&lt;h2 id=&quot;the-principle-underneath&quot;&gt;The principle underneath&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;Ease of integration is not a reason to add a router — it is the reason you can safely not add one. The pattern generalizes well beyond LLMs to any intermediary layer: API gateways, CDNs, orchestration platforms. The rule is the same each time: &lt;strong&gt;a flexibility layer pays for itself when the flexibility is exercised, not when it is purchased.&lt;/strong&gt;&lt;/p&gt;
</content:encoded><category>ai-engineering</category><category>architecture</category><category>cost</category></item><item><title>A Suggestion With a Success Rate: Enforcing Provenance in LLM Drafting</title><link>https://aiagentcampfire.com/blog/stopping-an-llm-from-inventing-values/</link><guid isPermaLink="true">https://aiagentcampfire.com/blog/stopping-an-llm-from-inventing-values/</guid><description>A drafting assistant filled a subjective gap with a plausible guess and shipped it as fact. The prompt said &apos;never invent data&apos; — and the safety bar still failed at 87.5%. The fix that took us to a verified 100% wasn&apos;t better wording; it was a code-level provenance check that treats every untraceable value as a question the user should answer.</description><pubDate>Mon, 12 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt; — Our drafting assistant quietly substituted a subjective user input with a fluent guess, and the hard-gate safety bar that forbids shipped fabrications scored &lt;strong&gt;87.5%&lt;/strong&gt; — a fail. The durable fix was structural: a named-field prompt, a code-level provenance validator that checks where each protected value came from, and a routing layer that converts every violation into a clarifying question. Live runs hit &lt;strong&gt;100%&lt;/strong&gt;, and a recorded-answer replay reproduces that score at zero API cost.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div&gt;&lt;h2 id=&quot;why-a-completion-engine-guesses&quot;&gt;Why a completion engine guesses&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;The LLM in our pipeline is hired for one thing: &lt;strong&gt;completion&lt;/strong&gt;. It receives a partial state — some inputs filled, some slots empty — and produces the most plausible continuation. That is the entire contract. Structured data goes in; a tailored, fluent document comes out.&lt;/p&gt;
&lt;p&gt;The same property that makes it useful makes it dangerous. To a completion engine, an empty slot is not a wall. It is a gap in the document, and filling gaps plausibly is literally the model’s job. When it invents a value, it is not broken — it is executing its training objective in a context where that objective is the wrong one. Locally the output looks perfect: fluent, complete, no error. Globally, a value exists that came from nowhere.&lt;/p&gt;
&lt;p&gt;There is a deeper structural reason the model cannot catch itself: nothing in its computation marks a &lt;em&gt;recalled&lt;/em&gt; input differently from a &lt;em&gt;constructed&lt;/em&gt; one. Both are just tokens. The property that separates them — &lt;strong&gt;provenance&lt;/strong&gt; — does not exist inside the model, and the emitted text does not carry it. If your safety design also never checks provenance, you are as blind as the model.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;what-the-pipeline-actually-produces&quot;&gt;What the pipeline actually produces&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;The system drafts personalized documents from a user’s declared inputs. Those inputs fall into three categories:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Content type&lt;/th&gt;
&lt;th&gt;Source&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Objective values&lt;/td&gt;
&lt;td&gt;Computed by the system&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Declared facts&lt;/td&gt;
&lt;td&gt;Copied verbatim from the user’s record&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Subjective judgments — &lt;strong&gt;protected fields&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Copied verbatim from the user’s answers, or the draft halts and asks&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The protected fields are the critical constraint. They are personal value judgments — relative priorities, preferences, trade-offs — that only the user can supply. No computation, no inference, no “reasonable default” can produce them. A draft that contains one without a user behind it is wrong by definition, no matter how natural it reads.&lt;/p&gt;
&lt;p&gt;The v1 system prompt read: &lt;em&gt;“Never invent data. If a required input is missing, ask the user.”&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;On the surface that is a reasonable instruction. The problem is what an instruction can actually do.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;the-run-that-broke-the-bar&quot;&gt;The run that broke the bar&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;Our eval suite carries a hard-gate safety bar: &lt;strong&gt;the system never ships an invented input.&lt;/strong&gt; A hard gate has one passing grade — 100%. A single violation in the sample fails the bar.&lt;/p&gt;
&lt;p&gt;The first measured run scored &lt;strong&gt;87.5%&lt;/strong&gt;. At least one sampled draft contained a protected value the user had never provided. The model had filled the gap with a plausible guess, produced a complete document, and shipped it. No error. No flag. The draft read like any other correct output.&lt;/p&gt;
&lt;p&gt;The camouflage is the danger. The invented value was &lt;em&gt;plausible&lt;/em&gt; — the kind of answer this user might have given. A human reviewer would see a normal document. The only property that distinguishes the fabrication from a real input is provenance, and the text does not encode it.&lt;/p&gt;
&lt;p&gt;And the number needs a harder reading than “close to passing”: &lt;strong&gt;87.5% on a hard gate is 0%.&lt;/strong&gt; A gate that holds 87.5% of the time is not a gate; it is a suggestion with a success rate.&lt;/p&gt;
&lt;pre dir=&quot;ltr&quot;&gt;flowchart LR
    REQ[&quot;Draft request&quot;]:::input --&gt; MODEL[&quot;LLM&quot;]:::model
    GAP[&quot;Missing subjective input&quot;]:::gap --&gt; MODEL
    P[&quot;Prompt: never invent, ask&quot;]:::prompt -.-&gt; MODEL
    MODEL --&gt; D[&quot;Complete, plausible draft&quot;]:::output
    D --&gt; SHIP[&quot;Shipped — no provenance check&quot;]:::danger
    SHIP --&gt; INV[&quot;The invented value reads as real&quot;]:::danger

    classDef model   fill:#fef3c7,stroke:#b45309,stroke-width:1.5px,color:#78350f;
    classDef input   fill:#f1f5f9,stroke:#64748b,stroke-width:1.5px,color:#334155;
    classDef gap     fill:#fee2e2,stroke:#b91c1c,stroke-width:1px,color:#7f1d1d;
    classDef prompt  fill:#e0f2fe,stroke:#0369a1,stroke-width:1px,color:#0c4a6e,stroke-dasharray:4 4;
    classDef output  fill:#f1f5f9,stroke:#64748b,stroke-width:1.5px,color:#334155;
    classDef danger  fill:#fecaca,stroke:#b91c1c,stroke-width:2px,color:#7f1d1d;&lt;/pre&gt;
&lt;div&gt;&lt;h2 id=&quot;diagnosis-a-prompt-is-a-request-not-a-constraint&quot;&gt;Diagnosis: a prompt is a request, not a constraint&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;Three findings shaped the redesign:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Completion pressure is a prior, not a defect.&lt;/strong&gt; A single sentence of instruction competes against a training objective that rewards producing the most plausible continuation. Prompts shift a probability distribution; they cannot fence it. For a hard gate, “very likely to comply” is the wrong shape of guarantee. You need a mechanism whose failure mode is &lt;em&gt;refuse&lt;/em&gt;, not &lt;em&gt;probably comply&lt;/em&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;“Never invent data” is unfalsifiable as written.&lt;/strong&gt; The model has no reliable way to tell which fields it may synthesize from context and which must be verbatim. A general rule gives it nothing concrete to check against. Naming the specific protected fields turns a vibe into a contract — checkable by the model, and, more importantly, checkable by code.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Detection cannot be textual.&lt;/strong&gt; No amount of reading the draft distinguishes an invented value from a real one; the information simply is not in the artifact. Enforcement has to be structural: verify &lt;em&gt;where a value came from&lt;/em&gt;, not &lt;em&gt;what it looks like&lt;/em&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The design conclusion: keep the prompt — it lowers the rate — but move the guarantee into code, where the rate is enforceable.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;the-fix-name-the-fields-then-fence-them&quot;&gt;The fix: name the fields, then fence them&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Layer 1 — a sharpened prompt.&lt;/strong&gt; The general instruction became a named manifest: &lt;em&gt;“Fields A, B, and C must be copied verbatim from the user’s declared inputs. If any is absent, stop and ask.”&lt;/em&gt; Concreteness beats generality because a named field is auditable.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Layer 2 — a provenance validator in code.&lt;/strong&gt; This is the durable layer, running on every completed draft:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Parse the draft and locate every slot that &lt;strong&gt;consumes a protected field&lt;/strong&gt; — identified by how the document uses the value downstream, not by position or by guessing where it “should” sit.&lt;/li&gt;
&lt;li&gt;For each slot, verify the value exactly matches a declared user input.&lt;/li&gt;
&lt;li&gt;Any value that cannot be traced to a declared input fails validation.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The check is deliberately &lt;strong&gt;provenance-based, not intent-based&lt;/strong&gt;. It never asks &lt;em&gt;“did the model mean to invent this?”&lt;/em&gt; — that question is undecidable. It asks &lt;em&gt;“can this value be shown to have come from the user?”&lt;/em&gt; — a set-membership test.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Layer 3 — route, don’t reject.&lt;/strong&gt; A failed validation is not an error state. It is converted into the clarifying question the model should have asked in the first place. The system’s failure mode is &lt;em&gt;ask the user&lt;/em&gt;, never &lt;em&gt;ship anyway&lt;/em&gt;.&lt;/p&gt;
&lt;pre dir=&quot;ltr&quot;&gt;flowchart LR
    MODEL[&quot;LLM draft&quot;]:::model --&gt; V{&quot;Provenance validator:&amp;#x3C;br/&gt;every protected value traces&amp;#x3C;br/&gt;to a declared input?&quot;}:::code
    V --&gt;|&quot;traceable&quot;| SHIP[&quot;Ship&quot;]:::good
    V --&gt;|&quot;untraceable&quot;| ASK[&quot;Ask the user&quot;]:::fallback
    ASK --&gt; REC[&quot;Record answer&quot;]:::fallback
    REC --&gt; MODEL
    REC --&gt; REPLAY[&quot;Replay harness:&amp;#x3C;br/&gt;re-run the eval at zero cost&quot;]:::good

    classDef model    fill:#fef3c7,stroke:#b45309,stroke-width:1.5px,color:#78350f;
    classDef code     fill:#dbeafe,stroke:#1d4ed8,stroke-width:2px,color:#1e3a8a;
    classDef good     fill:#dcfce7,stroke:#15803d,stroke-width:1.5px,color:#14532d;
    classDef fallback fill:#ede9fe,stroke:#6d28d9,stroke-width:1.5px,color:#4c1d95;&lt;/pre&gt;
&lt;div&gt;&lt;h2 id=&quot;outcome-100-and-free-regressions&quot;&gt;Outcome: 100%, and free regressions&lt;/h2&gt;&lt;/div&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Configuration&lt;/th&gt;
&lt;th&gt;Safety-bar pass rate&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;v1 — prompt only (“never invent data”)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;87.5%&lt;/strong&gt; — hard gate failed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;v2 — named fields + provenance validator + ask-routing&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;100%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;v2 replayed against recorded answers&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;100%&lt;/strong&gt;, at zero API cost&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The replay row deserves its own paragraph. We recorded the user-turn answers once, then re-ran the identical eval against the recording. Same score, no marginal cost, no variance from a live model re-answering. Every future prompt or pipeline change now gets a &lt;strong&gt;zero-cost regression run&lt;/strong&gt; against the same frozen scenario — the same frozen-eval discipline I described when calibrating an LLM judge, applied here to a safety bar.&lt;/p&gt;
&lt;pre dir=&quot;ltr&quot;&gt;xychart-beta
    title &quot;Safety-bar pass rate&quot;
    x-axis [&quot;v1 (prompt only)&quot;, &quot;v2 (prompt + validator)&quot;, &quot;v2 replay&quot;]
    y-axis &quot;Pass rate (%)&quot; 0 --&gt; 105
    bar [87.5, 100, 100]
    line [100, 100, 100]&lt;/pre&gt;
&lt;p&gt;The honest limit: &lt;strong&gt;the fence is exactly as wide as the manifest.&lt;/strong&gt; A new subjective field added next quarter is unprotected until it joins the protected set, and the validator must fail closed on any slot it cannot classify. Defense in depth narrows the hole; it does not abolish maintenance.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;transferable-checklist&quot;&gt;Transferable checklist&lt;/h2&gt;&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Name the protected fields individually in the prompt.&lt;/strong&gt; A named field is auditable; “be careful with user data” is not.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Treat the prompt as friction, not the fence.&lt;/strong&gt; Prompts make the right behaviour likely; only code makes the wrong behaviour unshippable.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check provenance, not plausibility.&lt;/strong&gt; A value is legitimate if and only if it traces to a declared input — appearance proves nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tie the check to consumption.&lt;/strong&gt; Identify protected values by how the draft uses them downstream, not by where you expect them to sit.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Make the failure mode a question.&lt;/strong&gt; Route violations back to the user as clarifying questions — never forward to production as output.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Record answers once, replay forever.&lt;/strong&gt; An answer recording turns every later prompt change into a zero-cost regression eval.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fail closed on the unknown.&lt;/strong&gt; A slot the validator cannot classify is a violation, not a pass.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;The model never misbehaved — it completed. The system’s error was asking a probability-shifting instrument to enforce an invariant. Prompts make the right behaviour &lt;em&gt;likely&lt;/em&gt;; validators make the wrong behaviour &lt;em&gt;impossible to ship&lt;/em&gt;; routing converts the residual into a clarifying question rather than a fabrication.&lt;/p&gt;
&lt;p&gt;This is the same lesson the LLM-judge calibration story told from the other direction: &lt;strong&gt;do not trust plausibility — verify structure.&lt;/strong&gt; When a constraint must hold, decide what would prove it — provenance, checksums, frozen eval sets — and put that proof in code.&lt;/p&gt;
</content:encoded><category>ai-engineering</category><category>guardrails</category></item><item><title>My First Blog Post</title><link>https://aiagentcampfire.com/blog/my-first-post/</link><guid isPermaLink="true">https://aiagentcampfire.com/blog/my-first-post/</guid><description>Welcome to my new blog about building AI agents in public.</description><pubDate>Sat, 10 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Welcome to my &lt;em&gt;new blog&lt;/em&gt;! Here I will share what I learn while building AI agents.&lt;/p&gt;
&lt;div&gt;&lt;h2 id=&quot;whats-next&quot;&gt;What’s next&lt;/h2&gt;&lt;/div&gt;
&lt;p&gt;More posts soon. Watch this space.&lt;/p&gt;
</content:encoded><category>ai-agents</category></item></channel></rss>