{"generated_at":"2026-08-10T00:10:48.453102+00:00","clusters":[{"slug":"prompting","label":"Prompting and instruction following","concepts":["prompt-reliability"]},{"slug":"retrieval","label":"Retrieval and grounding","concepts":["rag-retrieval-scaling"]},{"slug":"tool-use","label":"Tool use and agents","concepts":["agent-skill-regressions","mcp-stateless-scaling","structured-output-tool-suppression"]},{"slug":"memory","label":"Memory and context","concepts":["agent-context-lifecycle","agent-memory-poisoning"]},{"slug":"evaluation","label":"Evals and reliability","concepts":["benchmark-production-reliability-gap","llm-judge-reliability"]},{"slug":"operations","label":"Cost, latency, and operations","concepts":["speculative-decoding"]},{"slug":"safety","label":"Safety and control","concepts":["agent-tool-exfiltration-channels","context-compaction-safety","mcp-security-control-layers"]}],"concepts":{"agent-context-lifecycle":{"slug":"agent-context-lifecycle","title":"Why does adding more context sometimes hurt an agent?","question":"Why does adding more context sometimes hurt an agent?","summary":"Most production agent failures trace back to unmanaged context, not weak reasoning — treating context as a lifecycle to architect, ingest, scope, anticipate, and compact (not a log to truncate when it gets too big) is what keeps token cost linear instead of quadratic without paying for it in accuracy.","status":"active","cluster":"memory","cluster_label":"Memory and context","updated":"2026-07-31","audience":"strong-software-engineer","math_depth":"","sections":[{"heading":"Builder consequence","html":"<p>When an agent starts failing on long-running or larger tasks, the fix is usually not &quot;make it reason better&quot; — it&#x27;s rearranging what&#x27;s in its context. Reaching for a summarizer alone treats one stage of a five-stage lifecycle problem and leaves the other four unmanaged, which is why &quot;just summarize the history&quot; so often trades reliability for a lower token count instead of fixing the root cause.</p>"},{"heading":"Short answer","html":"<p>Production agent failures mostly come from unmanaged context, not weak reasoning. Treat context as something you architect, ingest, scope, anticipate, and compact — not a single log you truncate when it gets too big. Naive accumulation grows token cost quadratically with turns; only a compaction step that&#x27;s validated against what must survive achieves linear cost without paying for it in accuracy.</p>"},{"heading":"Builder model","html":"<p>Think of an agent&#x27;s context like a working set, not a transcript. You don&#x27;t just delete things when it gets full — you decide upfront what data structure holds it (a flat log vs. a structured store), what&#x27;s allowed to enter and in what form, what&#x27;s scoped as relevant to the current step versus the whole session, what&#x27;s proactively prefetched before it&#x27;s needed, and finally how it gets compacted without losing the provenance of the facts you kept. Those are the five primitives: architecting, ingesting, scoping, anticipating, and compacting/consolidating. Skipping straight to the last one is the common mistake.</p>"},{"heading":"Mechanism","html":"<p>Each new agent turn re-sends (or attends over) the accumulated history, so a session that naively accumulates context grows its total token cost quadratically with turn count — cost per turn keeps rising as the history keeps growing. Periodic summarization collapses that history into something shorter, flattening the curve back to linear, but every summarization pass is lossy: specific numbers, exact facts, and the provenance of where a fact came from can silently disappear. Performance holds while the loss stays below some threshold, then drops sharply once too much detail is gone — an &quot;accuracy cliff&quot; rather than a graceful degradation. The paper&#x27;s claim is that only compaction validated against what needs to be preserved before it&#x27;s committed gets you linear cost without the cliff, and that validation only works if the other four stages (deciding structure, admission, and scope ahead of time) already constrain what the compactor is allowed to lose.</p>\n<p>OpenAI&#x27;s own ARC-AGI-3 write-up shows both halves of that claim in a single, concrete production setting. Their stock agent harness discarded the model&#x27;s private reasoning after every move, so GPT-5.6 Sol effectively restarted cold each turn instead of building on what it had already ruled out or learned about the puzzle — an ingestion failure, in the paper&#x27;s terms, not a reasoning one. Chaining <code>previous_response_id</code> to retain that reasoning across turns, combined with a compaction step that summarizes dialogue state instead of hard-truncating the oldest messages once context passes roughly 175K characters, took the same model&#x27;s ARC-AGI-3 public-set score from 13.3% to 38.3% while cutting output tokens per game by roughly 6x. Hard truncation and cold-restart-every-turn are exactly the naive, unmanaged patterns the lifecycle framing predicts will underperform.</p>"},{"heading":"Evidence","html":"<p>The reference implementation built around this five-stage lifecycle (Maximem Synap) scores 92% on LongMemEval and 93.2% on LoCoMo, offered as evidence that lifecycle-managed context beats flat-history-plus-summarization baselines on long-memory recall. The authors are explicit that this recall win doesn&#x27;t by itself certify production readiness: existing memory benchmarks, including the ones just cited, don&#x27;t measure latency efficiency, token efficiency, or context-rot resistance, so a high recall score can still hide an expensive or slow pipeline.</p>\n<p>OpenAI&#x27;s ARC-AGI-3 result adds a second, independent data point from a different lab and a different task class (long-horizon puzzle-solving rather than conversational recall): retaining reasoning state and validating compaction against a size threshold rather than hard-truncating produced a roughly 3x score gain with 6x fewer output tokens on the same model. Treat the specific percentages carefully — OpenAI reports them on its own harness, not on ARC-AGI-3&#x27;s independently verified leaderboard, so the number is evidence the mechanism works, not a certified capability claim.</p>"},{"heading":"How to apply","html":"<ul><li>Decide the data structure that will hold context long-term — a session log vs. a structured fact store — before writing a summarizer; that architecture choice, not the compaction step, determines what&#x27;s recoverable later.</li><li>Instrument token cost per turn and watch for the quadratic-growth signature (rising marginal cost per turn) as the earliest sign context is being naively accumulated rather than managed.</li><li>Validate any compaction or summarization step against a held-out set of facts it must preserve before shipping it — don&#x27;t accept a summarizer that &quot;reads fine&quot; without checking recall on the specific facts downstream steps depend on.</li><li>If your API or framework supports carrying reasoning/state across turns (e.g. response-chaining instead of replaying raw history), prefer it over re-deriving state from scratch each turn — discarding reasoning between turns is an ingestion-stage failure, not just a cost inefficiency.</li><li>Trigger compaction on a validated size threshold and summarize, rather than hard-truncating the oldest messages once a context window fills up.</li><li>Measure latency and token cost alongside recall; a benchmark score like LongMemEval/LoCoMo tells you nothing about whether the pipeline is fast or cheap enough to run in production.</li></ul>"},{"heading":"Failure modes","html":"<ul><li>Treating &quot;add a summarizer&quot; as the whole fix: it addresses only the compacting stage and still lets ungoverned ingestion and scoping cause the accuracy cliff downstream.</li><li>Reading a recall-benchmark win as proof the pipeline is production-ready, when the benchmark doesn&#x27;t measure latency, token efficiency, or context-rot resistance.</li><li>Assuming quadratic cost growth is a serving-layer problem fixable with caching or batching, when it&#x27;s actually a context-architecture problem that compounds regardless of how fast the serving stack is.</li><li>Discarding a model&#x27;s intermediate reasoning between turns by default (replaying only raw messages) and mistaking the resulting cold restarts for a model capability limit rather than a harness design choice.</li><li>Citing a lab&#x27;s self-reported, own-harness benchmark jump as a verified capability gain instead of what it actually demonstrates: that the mechanism (retained reasoning plus validated compaction) works, independent of the exact percentage.</li></ul>"},{"heading":"Related","html":"<ul><li><a href=\"/topic/agent-memory\">/topic/agent-memory</a> — why agents forget across steps and sessions.</li><li><a href=\"/topic/agent-cost\">/topic/agent-cost</a> — why agent token cost is a function of behavior, not request count.</li><li><code>context-compaction-safety</code> — the sibling case where compaction breaks a long-running agent&#x27;s safety constraints rather than its factual recall.</li><li><code>benchmark-production-reliability-gap</code> — more on why a benchmark score, self-reported or otherwise, needs independent verification before it becomes a production capability claim.</li></ul>"}],"evidence":[{"id":"menlo-context-lifecycle-2026","kind":"benchmark-result","tier":"benchmark/result-backed","title":"Agentic Context Management: Solving Agent Memory and Cost by Treating Them as Lifecycle and Architecture Problems","note":"Argues production agent failures are less often a reasoning problem than a failure to manage what's in the context: conversation histories, large prompts, large tool definitions, and ballooning tool outputs. Decomposes context management into five primitives — architecting, ingesting, scoping, anticipating, and compacting/consolidating. Naive accumulation grows total session token cost quadratically with turn count; plain summarization flattens this to linear cost but introduces an 'accuracy cliff' as specific facts and provenance get dropped; only compaction validated against what must be preserved achieves linear cost without the cliff. The paper's reference implementation (Maximem Synap) scores 92% on LongMemEval and 93.2% on LoCoMo, and the authors note existing memory benchmarks under-measure latency efficiency, token efficiency, and context-rot resistance.","url":"http://arxiv.org/abs/2607.21503"},{"id":"story-fae52c3b17c1c504-agentic-context-management","kind":"story","tier":"source story","title":"Agentic Context Management: Solving Agent Memory and Cost by Treating Them as Lifecycle and Architecture Problems","note":"","sid":"fae52c3b17c1c504"},{"id":"openai-2026-arc-agi-3-retained-reasoning-compaction","kind":"primary-doc","tier":"primary-doc-backed","title":"How enabling two settings tripled our scores on the ARC-AGI-3 benchmark","note":"OpenAI reports GPT-5.6 Sol scored 13.3% on the ARC-AGI-3 public set with the stock harness on the Responses API, then 38.3% once two settings were enabled: retained reasoning (chaining previous_response_id so private reasoning items carry over between turns instead of the model restarting cold on each move) and compaction (summarizing dialogue state instead of hard-truncating the oldest messages once context passes roughly 175K characters). Output tokens per game fell by roughly 6x at the same time score roughly tripled. OpenAI is explicit these are self-reported numbers on their own harness, not an independently verified ARC-AGI-3 leaderboard entry.","url":"https://openai.com/index/how-two-settings-tripled-our-arc-agi-3-scores"},{"id":"story-265c6a0134aba9b6-arc-agi-3-two-settings","kind":"story","tier":"source story","title":"How enabling two settings tripled our scores on the ARC-AGI-3 benchmark","note":"","sid":"265c6a0134aba9b6"},{"id":"agent-context-lifecycle-editorial-synthesis","kind":"editorial-inference","tier":"editorial inference","title":"Lifecycle framing vs. single-stage fixes","note":"Editorial synthesis: a summarizer alone addresses only the compacting stage of the five-stage lifecycle. It still leaves ingestion and scoping unmanaged, which is why teams that bolt on summarization as their only context-cost fix keep hitting the same accuracy cliff the paper describes — the fix has to span all five stages, not just the last one."}],"related_topics":[{"slug":"agent-memory","title":"Agents forget across steps and sessions"},{"slug":"agent-cost","title":"Agent token costs are unpredictable and easily run away"}],"related_playbook_cards":["pb-context-lifecycle-not-storage"],"related_storylines":[],"covers_evidence":["menlo-context-lifecycle-2026","story-fae52c3b17c1c504-agentic-context-management","openai-2026-arc-agi-3-retained-reasoning-compaction","story-265c6a0134aba9b6-arc-agi-3-two-settings","agent-context-lifecycle-editorial-synthesis"]},"agent-memory-poisoning":{"slug":"agent-memory-poisoning","title":"Can you trust what your agent remembers?","question":"Can you trust what your agent remembers?","summary":"Persistent agent memory is a write-once, replay-many attack surface — 2026 benchmarks show attackers can forge an agent's own reasoning history or plant poisoned facts through routine content like email, both with high success rates against real agent stacks, and current keyword- or consensus-based defenses do not stop it.","status":"active","cluster":"memory","cluster_label":"Memory and context","updated":"2026-07-08","audience":"strong-software-engineer","math_depth":"","sections":[{"heading":"Builder consequence","html":"<p>If your agent has persistent memory — it writes facts, decisions, or reasoning traces to a store it reads back in a later session — that memory is no longer just something the agent reads. It is something an attacker, or the agent&#x27;s own drift, can write to. Untrusted content the agent processes today (an email, a tool result, a retrieved document) can plant an entry that survives into every future session and gets treated as trusted state from then on, with no further scrutiny.</p>"},{"heading":"Short answer","html":"<p>No, not by default. Two independent 2026 papers show current agent memory pipelines are exploitable in different ways: one attack forges the agent&#x27;s own past reasoning and reaches up to 100% success under baseline conditions; another silently injects poisoned facts or preferences through routine external content and reaches 87.5% end-to-end success against a real coding-agent stack, transferring across architectures and memory backends. A third benchmark shows agents also over-trust their own stored memories over fresh, correct evidence — sycophancy, a failure mode that needs no attacker at all. Only a purpose-built defense layer closes the gap; the defenses these papers test by default (keyword filters, consensus/majority checks) do not.</p>"},{"heading":"Builder model","html":"<p>Split memory-trust failures into two attacker-controlled classes plus one non-adversarial class:</p>\n<ul><li><strong>Fact or preference poisoning.</strong> Untrusted external content the agent ingests (an email, a document, a tool response) gets written into persistent memory and reused as ground truth in later sessions — the attacker never touches the agent directly, only what it reads.</li><li><strong>Reasoning poisoning.</strong> The attacker forges the *record of why* the agent decided something in the past, so a later self-consistency or majority-vote check treats the forged trace as corroborating evidence instead of catching it as an outlier.</li><li><strong>Sycophancy (no attacker).</strong> The agent simply weights a stored memory over better, more current evidence when the two conflict, because retrieval surfaced the memory and nothing forces the agent to re-verify it.</li></ul>\n<p>All three share the same root cause: once something is written to memory, most pipelines read it back as trusted without asking how it got there or whether it still holds.</p>"},{"heading":"Mechanism","html":"<p>FARMA (Forged Amplifying Rationale Memory Attack) targets reasoning poisoning specifically. It writes a forged reasoning entry using evasive phrasing designed to slip past keyword-based memory filters, then uses self-referential reinforcement — the forged entry cites or echoes itself across turns — to defeat defenses that rely on consensus among multiple memory entries. Because the forgery reads as internally consistent, majority-vote checks see corroboration instead of an anomaly. The paper&#x27;s own defense, SENTINEL, doesn&#x27;t rely on keywords or consensus; its Reasoning Guard component structurally analyzes a candidate memory entry against five weighted forgery signals before it is trusted.</p>\n<p>MemGhost/WhisperBench targets fact and preference poisoning through the agent&#x27;s normal ingestion path rather than a jailbreak-style prompt. MemGhost is a one-shot payload-generation framework (environment-proxy emulation plus reinforcement learning) that crafts content — for example, an email — designed to be processed by the agent, written into persistent memory without the user noticing, and only exploited in a later, unrelated session. WhisperBench evaluates this end to end across five risk categories and both fact- and preference-style poisoning, and the resulting payloads transfer across agent architectures and memory backends (filesystem-based and Mem0), and keep working against input-level, model-level, and system-level defenses the authors tested.</p>\n<p>Both attacks depend on the same structural gap: a write path into long-term memory that treats agent-generated or externally-sourced content as safe to store, and a read path that treats anything already in memory as more trustworthy than it should be. This is the mirror image of the compaction failure mode in <a href=\"/foundations/context-compaction-safety\">does compacting an agent&#x27;s context put its safety rules at risk?</a> — there, a legitimate constraint gets silently dropped; here, an illegitimate one gets silently added and kept.</p>"},{"heading":"Evidence","html":"<ul><li>Benchmark/result-backed: FARMA poisons an agent&#x27;s own reasoning history using evasive language and self-referential reinforcement, reaching up to 100% attack success across 50 trials under baseline conditions; the SENTINEL defense (a five-signal Reasoning Guard) cuts that to as low as 0% with no false positives across 326 benign traces.</li><li>Benchmark/result-backed: MemGhost/WhisperBench delivers fact and preference poisoning through routine external content, reaching 87.5% end-to-end success against OpenClaw with GPT-5.4 and 71.4% against the Claude Code SDK with Sonnet 4.6, transferring across agent architectures and memory backends and surviving input-, model-, and system-level defenses tested.</li><li>Benchmark/result-backed: MemSyco-Bench evaluates memory-induced sycophancy across five tasks — rejecting insufficient memory as evidence, respecting its scope, resolving memory-vs-evidence conflicts, tracking updates, and using valid memory for personalization — as a failure mode distinct from injection.</li><li>Editorial inference: treat persistent memory with the same threat model as prompt injection, because both a forged reasoning trace and a poisoned fact are just content an agent trusted without checking its provenance.</li></ul>"},{"heading":"How to apply","html":"<ul><li><strong>Treat every memory write path as untrusted input.</strong> Anything that lands in persistent memory — a tool output, a retrieved document, an email the agent parsed, or the agent&#x27;s own reasoning summary — needs the same scrutiny as a prompt-injection surface before it&#x27;s trusted in a future session.</li><li><strong>Don&#x27;t rely on keyword filters or consensus checks alone.</strong> Both are the specific defenses FARMA is built to defeat (evasive language beats keywords, self-referential reinforcement beats consensus). If you need a reasoning-forgery defense, structurally score candidate entries the way SENTINEL&#x27;s Reasoning Guard does, rather than trusting surface-level agreement between memory entries.</li><li><strong>Run an adversarial replay test on your actual ingestion path.</strong> WhisperBench shows even a Claude Code SDK-based stack was exploitable (71.4%), so don&#x27;t assume vendor agent tooling protects memory writes by default — feed your agent&#x27;s real email/tool/document ingestion attacker-controlled content and check whether it lands unnoticed in the persistent store.</li><li><strong>Test for sycophancy separately from injection.</strong> Give the agent a stored memory that conflicts with correct, fresh evidence and check whether it defers to the memory. This failure needs no attacker, so it won&#x27;t show up in an adversarial-only test suite.</li></ul>"},{"heading":"Failure modes","html":"<ul><li>Trusting a memory entry just because the agent itself wrote it in a prior session, instead of checking how that entry got there.</li><li>Defending memory writes with keyword filters or consensus/majority checks only — the exact two defense classes FARMA is designed to defeat.</li><li>Assuming defenses built for single-turn prompt injection carry over to memory poisoning, when memory is a different code path: write once, replay in every future session.</li><li>Never adversarially testing the agent&#x27;s real ingestion pipeline (email, tool output, document parsing) for whether attacker content can silently reach persistent storage.</li><li>Treating sycophancy as out of scope because it isn&#x27;t an &quot;attack&quot; — it degrades decisions the same way poisoned memory does, just without an adversary.</li></ul>"},{"heading":"Related","html":"<p>See <a href=\"/topic/agent-memory\">agent memory</a> for the broader tiered-memory architecture debate, <a href=\"/topic/prompt-injection\">prompt injection</a> for the adjacent single-turn threat model, and <a href=\"/foundations/context-compaction-safety\">does compacting an agent&#x27;s context put its safety rules at risk?</a> for the mirror-image failure where a legitimate constraint is silently lost instead of an illegitimate one silently kept.</p>"}],"evidence":[{"id":"farma-sentinel-2026-reasoning-memory-attack","kind":"benchmark-result","tier":"benchmark/result-backed","title":"Your Agent's Memories Are Not Its Own: Forged Reasoning Attacks on LLM Agent Memory and Defenses","note":"Introduces FARMA (Forged Amplifying Rationale Memory Attack), which poisons an agent's remembered reasoning traces rather than its facts: it inserts forged reasoning using evasive language that bypasses keyword-based defenses, then amplifies it through self-referential reinforcement that defeats consensus-based defenses. Attack success reaches up to 100% under baseline conditions across 50 trials. The paper's SENTINEL defense (a Reasoning Guard that scores five weighted forgery signals) reduces attack success to as low as 0%, with no false positives across 326 benign agent traces.","url":"http://arxiv.org/abs/2607.05029v1"},{"id":"memghost-whisperbench-2026-stealth-memory-injection","kind":"benchmark-result","tier":"benchmark/result-backed","title":"When Claws Remember but Do Not Tell: Stealthy Memory Injection in Persistent Personal Agents","note":"Introduces MemGhost, a one-shot payload-generation framework, and WhisperBench, a 108-case benchmark spanning five risk categories covering both fact and preference poisoning delivered through untrusted external content (such as email) that gets silently written into persistent memory and later reused as trusted state. End-to-end attack success reaches 87.5% against OpenClaw with GPT-5.4 and 71.4% against the Claude Code SDK with Sonnet 4.6 across held-out test cases, and the attack transfers across agent architectures (NanoClaw, Hermes Agent) and memory backends (filesystem, Mem0), remaining effective against the input-level, model-level, and system-level defenses tested.","url":"http://arxiv.org/abs/2607.05189v1"},{"id":"memsyco-bench-2026-memory-sycophancy","kind":"benchmark-result","tier":"benchmark/result-backed","title":"MemSyco-Bench: Benchmarking Sycophancy in Agent Memory","note":"Points out that most memory benchmarks only check whether memories are stored, retrieved, or updated correctly, and proposes five tasks that instead test whether an agent can reject a memory as insufficient evidence, respect its applicable scope, resolve a conflict between memory and objective evidence, track memory updates, and use valid memory for personalization — surfacing sycophancy (an agent over-trusting a stored memory over fresh, correct evidence) as a distinct, non-adversarial memory failure mode.","url":"http://arxiv.org/abs/2607.01071v1"},{"id":"agent-memory-poisoning-editorial-synthesis","kind":"editorial-inference","tier":"editorial inference","title":"LLM Digest synthesis","note":"Persistent agent memory deserves the same threat model as prompt injection: anything written into long-term memory from an untrusted source, or generated by the agent itself, can later be replayed as trusted context, and a reasoning trace is exactly as forgeable as a fact."}],"related_topics":[{"slug":"agent-memory","title":"Agents forget across steps and sessions"},{"slug":"prompt-injection","title":"Untrusted input and tools can hijack an agent"}],"related_playbook_cards":[],"related_storylines":[],"covers_evidence":["farma-sentinel-2026-reasoning-memory-attack","memghost-whisperbench-2026-stealth-memory-injection","memsyco-bench-2026-memory-sycophancy","agent-memory-poisoning-editorial-synthesis"]},"agent-skill-regressions":{"slug":"agent-skill-regressions","title":"Why do reusable skills sometimes make an agent worse?","question":"Why do reusable skills sometimes make an agent worse?","summary":"Grading a procedural skill by average task-success improvement hides its cost: the best-performing skills win mainly by regressing less on tasks the agent already solved, not by solving more — and most regressions trace to the skill changing behavior it was never meant to touch.","status":"active","cluster":"tool-use","cluster_label":"Tool use and agents","updated":"2026-07-29","audience":"strong-software-engineer","math_depth":"","sections":[{"heading":"Builder consequence","html":"<p>If you ship a procedural skill (a step-by-step playbook injected into an agent&#x27;s context) and only track average task-success rate, you can ship a net regression without seeing it. A skill that fixes ten tasks and quietly breaks eight tasks the agent used to pass looks like a solid win on the aggregate number, but eight users just watched something that worked stop working.</p>"},{"heading":"Short answer","html":"<p>Average success-rate improvement hides that skills cut both ways. Splitting outcomes into regressions (previously-passing tasks that now fail) and residual failures (tasks that never passed either way) shows the best skills mostly win by regressing less, not by solving more. Regressions cluster into three specific mechanisms, and the same three areas — procedural guidance, grounding, and verification — also explain most of what&#x27;s left unsolved.</p>"},{"heading":"Builder model","html":"<p>Treat a skill as a change to the agent&#x27;s whole context, not a subroutine that only runs when invoked. A skill sitting in context can shift behavior on tasks that never call it, override how the agent reads its own inputs, and quietly turn off checks the agent would have run anyway. None of that shows up if you only measure &quot;did the task pass,&quot; because a pass/fail count doesn&#x27;t distinguish a task that was already broken from one your own change just broke.</p>"},{"heading":"Mechanism","html":"<p>The study runs agents with and without a candidate skill across nearly 6,000 tasks, two office-automation benchmarks, and three harness stacks, then buckets every outcome change into one of two categories: a <strong>regression</strong> (solved without the skill, failed with it) or a <strong>residual failure</strong> (failed either way). This decomposition is the whole point — it separates &quot;the skill didn&#x27;t help&quot; from &quot;the skill actively broke something that worked.&quot;</p>\n<p>Three mechanisms explain most regressions:</p>\n<ul><li><strong>Skill description osmosis</strong> — the skill&#x27;s presence in context changes agent behavior even on turns where the agent never invokes it. The text doesn&#x27;t have to run to have an effect.</li><li><strong>Grounding displacement</strong> — the skill&#x27;s prescribed procedure overrides how the agent interprets its actual inputs, so the agent follows the recipe instead of what&#x27;s in front of it.</li><li><strong>Verification displacement</strong> — the procedure supplies its own sense of &quot;done,&quot; which suppresses the output checks the agent would otherwise perform.</li></ul>\n<p>Looking at residual failures (tasks that still fail with the skill) turns up a matching imbalance rather than a different problem: existing skills over-invest in procedural guidance, the stage the study finds is least often the actual cause of failure, while under-supporting grounding and verification, the stages responsible for most of what&#x27;s left unsolved.</p>"},{"heading":"Evidence","html":"<p>Benchmark/result-backed: nearly 6,000 runs across two office-automation benchmarks and three harness stacks, with outcomes decomposed into regressions vs. residual failures rather than reported as a single success-rate delta. The paper reports the direction and mechanism of the effect (regressing-less beats gaining-more among top skills; three named regression causes) without publishing a specific percentage for how much of the improvement each mechanism explains — treat the mechanism finding as established and any percentage as unstated by the source.</p>"},{"heading":"How to apply","html":"<ul><li><strong>Score two numbers, not one.</strong> For every candidate skill, measure tasks newly solved and previously-passing tasks now failing separately — never collapse them into a single success-rate delta before shipping.</li><li><strong>Audit failures for the three named modes.</strong> When a task regresses, check whether the skill changed behavior on a turn it wasn&#x27;t invoked on (osmosis), overrode input interpretation (grounding displacement), or suppressed an output check (verification displacement) before rewriting the procedure itself.</li><li><strong>Write grounding and verification steps as explicitly as the procedure.</strong> If a skill spells out steps but leaves &quot;check your inputs&quot; and &quot;check your output&quot; implicit, it&#x27;s the shape most likely to displace exactly those checks.</li><li><strong>Re-test previously-passing tasks whenever a skill changes.</strong> A skill update that only gets evaluated against its target tasks will never surface a regression on tasks outside that set.</li></ul>"},{"heading":"Failure modes","html":"<ul><li>Grading a skill by aggregate success-rate improvement, which lets regressions on previously-solved tasks hide behind gains on new ones.</li><li>Assuming a skill only affects behavior when the agent actually invokes it, missing osmosis effects from the skill merely being present in context.</li><li>Treating every regression as a procedure-writing problem and iterating on the steps, when the study finds grounding and verification gaps cause most of the remaining failures.</li><li>Shipping a skill update without re-running the agent&#x27;s previously-passing task set, so a new regression ships silently.</li></ul>"},{"heading":"Related","html":"<p>See <a href=\"/topic/tool-use\">tool use</a> for the broader set of failure modes in connecting agents to real tools, and <a href=\"/topic/agent-reliability\">agent reliability</a> for why fluent, confident-looking output doesn&#x27;t imply the agent&#x27;s checks are still running.</p>"}],"evidence":[{"id":"regression-tax-2026-skills","kind":"benchmark-result","tier":"benchmark/result-backed","title":"The Regression Tax: Decomposing Why Skills Help and Hurt LLM Agents","note":"Compares agents with and without a procedural skill across nearly 6,000 runs spanning two office-automation benchmarks and three model harness stacks. Splits outcomes into a regression (a task the agent solved without the skill but fails once the skill is added) versus a residual failure (a task that fails both with and without the skill). Finds the best-performing skills win primarily by regressing less, not by gaining more, and identifies three regression causes: skill description osmosis (the skill changes behavior just by being present in context, even when never invoked), grounding displacement (the skill's prescribed procedure overrides how the agent reads its inputs), and verification displacement (the procedure suppresses checks the agent would otherwise run on its own outputs). Analyzing persistent (residual) failures finds the same pattern in reverse: existing skills overemphasize procedural guidance, the stage least often responsible for failure, while under-supporting grounding and verification, the stages that cause most remaining errors.","url":"http://arxiv.org/abs/2607.22520v1"},{"id":"story-89a606f362d88b4e-regression-tax","kind":"story","tier":"source story","title":"The Regression Tax: Decomposing Why Skills Help and Hurt LLM Agents","note":"","sid":"89a606f362d88b4e"}],"related_topics":[{"slug":"tool-use","title":"Agents reach the outside world through fragile, ad-hoc integrations"},{"slug":"agent-reliability","title":"Agents give fluent, confident-looking output even when it's wrong"}],"related_playbook_cards":["pb-skills-regression-tax"],"related_storylines":[],"covers_evidence":["regression-tax-2026-skills","story-89a606f362d88b4e-regression-tax"]},"agent-tool-exfiltration-channels":{"slug":"agent-tool-exfiltration-channels","title":"Why can a tool designed to block exfiltration still leak your data?","question":"Why can a tool designed to block exfiltration still leak your data?","summary":"Blocking the obvious exfiltration path — a model encoding secrets straight into a URL it fetches — isn't enough. Claude's web_fetch tool blocked exactly that, but a researcher still exfiltrated a user's name, city, and employer by chaining an allowed capability (following links found inside a page it had already fetched) into a slow, one-step-at-a-time leak.","status":"active","cluster":"safety","cluster_label":"Safety and control","updated":"2026-07-17","audience":"strong-software-engineer","math_depth":"","sections":[{"heading":"Builder consequence","html":"<p>If your agent has a tool that reads external, untrusted content — fetches a web page, reads an email, opens a file from a shared drive — and that tool can also take a further action based on what it read, you have a potential exfiltration channel even after you block the obvious attack. Stopping &quot;the model can&#x27;t put secrets directly into a URL it fetches&quot; is necessary but not sufficient. An attacker can still walk the model through a sequence of individually legitimate-looking actions that adds up to the same leak, one small piece at a time.</p>"},{"heading":"Short answer","html":"<p>Closing the most direct exfiltration path doesn&#x27;t close the channel. Claude&#x27;s web_fetch tool already blocked a model from constructing a URL that encoded private data and fetching it — the obvious attack. Security researcher Ayush Paul found a second path: web_fetch let a model follow links it discovered *inside a page it had already fetched*. A honeypot site instructed Claude to navigate an alphabetically-ordered chain of links, one per letter of the target information, turning &quot;follow this legitimate-looking link&quot; into a one-bit-at-a-time channel that leaked a user&#x27;s name, home city, and employer. Anthropic&#x27;s fix removed that specific capability: web_fetch can no longer navigate to links found inside its own fetched content.</p>"},{"heading":"Builder model","html":"<p>Split &quot;can this tool exfiltrate data&quot; into two questions, not one:</p>\n<ul><li><strong>Can the model construct an outbound request that encodes secret data?</strong> This is the obvious attack, and most tool designs already block it — e.g. disallow the model from freely composing arbitrary URLs to fetch.</li><li><strong>Can the model be steered, by content it reads, into a sequence of otherwise-legitimate actions whose end state reveals the secret?</strong> This is the channel that survives the first fix. Each individual step — &quot;follow this one link&quot; — looks like normal tool behavior. Only the sequence, chosen entirely by the untrusted content the tool read, encodes the leak.</li></ul>\n<p>The source article names the underlying pattern the &quot;lethal trifecta&quot;: private data the agent can access, exposure to untrusted content that can carry instructions, and any exfiltration vector at all. All three conditions together are exploitable, and closing only one vector (direct URL construction) still leaves the trifecta intact if a second vector (link-following) exists.</p>"},{"heading":"Mechanism","html":"<p>The honeypot page presented itself as a Cloudflare bot check and instructed Claude, in its page content, to &quot;navigate through the website letter by letter to find the user&#x27;s profile.&quot; The site served links at predictable, sequential paths, and which link the honeypot&#x27;s next page pointed to depended on the letter of the secret being exfiltrated at that step. Repeating this across many fetches recovered the user&#x27;s name, home city, and employer — three separate secrets pulled out one character at a time through a channel that was never a single &quot;send this data out&quot; call, just a long chain of individually unremarkable &quot;fetch the next page&quot; calls. The site also targeted only <code>Claude-User</code> user-agents, so the attack activated selectively rather than showing the same behavior to every visitor, including automated scanners.</p>\n<p>The design flaw was specific: web_fetch already refused to let the model directly manipulate or construct a URL that would encode data into the outbound request — it restricted fetches to URLs the user had entered themselves or that the companion web_search tool had returned. But it did allow the model to follow a link *embedded in a page it had already fetched*, a capability that reads as ordinary browsing (a page has links, an agent follows them toward the user&#x27;s goal) but has no way to distinguish &quot;this link was authored by the untrusted page to complete an exfiltration protocol&quot; from &quot;this link is a normal next step.&quot; Anthropic&#x27;s fix removed that capability outright: web_fetch can no longer navigate to links discovered within its own previously fetched content.</p>"},{"heading":"Evidence","html":"<ul><li>Production field-report-backed: Ayush Paul&#x27;s honeypot attack against Claude&#x27;s web_fetch tool exfiltrated a user&#x27;s name, home city, and employer by chaining link-follows the tool allowed, even though direct URL-construction exfiltration was already blocked; Anthropic&#x27;s shipped fix removed web_fetch&#x27;s ability to follow links found inside its own fetched content.</li><li>Source story: the durable story record for this write-up backs the same finding and links back to the original reporting.</li><li>Editorial inference: the general pattern — an untrusted-content-reading tool with any further degree of freedom is a potential exfiltration channel — generalizes past web_fetch to any tool combining &quot;reads content you don&#x27;t control&quot; with &quot;acts on what it read.&quot;</li></ul>"},{"heading":"How to apply","html":"<ul><li><strong>Enumerate every degree of freedom your untrusted-content-reading tools have, not just the headline capability.</strong> web_fetch&#x27;s headline risk was &quot;can it construct an exfiltrating URL&quot;; the actual exploited risk was &quot;can it follow a link it found,&quot; a capability that looked incidental.</li><li><strong>Treat links, filenames, or record IDs discovered inside untrusted content as untrusted instructions, not as data.</strong> A link embedded in a fetched page was authored by whoever controls that page — following it on the page&#x27;s terms, not the user&#x27;s, is exactly the exploited behavior.</li><li><strong>Prefer allowlisting the exact target over free navigation.</strong> Restrict a fetch/browse tool to the URL the user asked for or an explicit allowlist, and require any further navigation to be separately authorized rather than treated as a continuation of the first fetch.</li><li><strong>Watch for selective-targeting attacks in your own logs.</strong> This attack activated only for <code>Claude-User</code> user-agents specifically to evade generic detection — auditing by user-agent, referrer, or request-pattern anomalies can surface an attack that never trips a blanket content filter.</li><li><strong>Re-audit after adding any new follow-up action to a content-reading tool.</strong> A tool that&#x27;s safe today can become an exfiltration channel the moment you add a seemingly unrelated capability (follow a link, open an attachment, query a related record) that gives untrusted content a new way to steer sequential behavior.</li></ul>"},{"heading":"Failure modes","html":"<ul><li>Fixing only the headline exploit — blocking direct URL construction — and declaring the tool safe, missing that a secondary capability like link-following reopens the same class of attack through a slower channel.</li><li>Treating &quot;the model is just browsing&quot; as inherently benign: a sequence of individually normal-looking tool calls, each following the last, is the actual exfiltration mechanism, not a red flag on its own.</li><li>Testing exfiltration defenses only against generic scanners or obvious single-shot attempts, missing an attack that targets a specific user-agent and unfolds over many small steps.</li><li>Assuming a vendor&#x27;s fix for one exfiltration channel in a tool covers every exfiltration channel in that tool, when a distinct capability in the same tool can carry the same class of attack.</li></ul>"},{"heading":"Related","html":"<p>See <a href=\"/topic/prompt-injection\">prompt injection</a> for the broader threat model this attack sits inside, and <a href=\"/topic/tool-use\">tool use</a> for how ad-hoc tool integrations create exactly this kind of unreviewed degree of freedom.</p>"}],"evidence":[{"id":"paul-willison-2026-claude-web-fetch-exfiltration","kind":"production-field-report","tier":"production field-report-backed","title":"How I tricked Claude into leaking your deepest, darkest secrets","note":"Documents security researcher Ayush Paul's attack against Claude's web_fetch tool. web_fetch already blocked a model from directly constructing an exfiltrating URL (e.g. concatenating recent answers onto an attacker's URL), restricting fetches to user-entered URLs or web_search results. Paul found that web_fetch also let the model follow links embedded inside a page it had already fetched. A honeypot site posing as a Cloudflare check told Claude to navigate an alphabetically-ordered chain of nested links (coffee.evil.com/a, /b, ...) to find the user's profile, exfiltrating name, home city, and employer one hop at a time, and targeted only Claude-User user-agents to stay under the radar. Anthropic fixed it by removing web_fetch's ability to navigate to links discovered inside its own previously fetched content, and did not pay a bug bounty, saying the issue had already been found internally.","url":"https://simonwillison.net/2026/Jul/15/claude-web-fetch-exfiltration/#atom-everything"},{"id":"story-5201cdda51e234b5-web-fetch-exfiltration","kind":"story","tier":"source story","title":"How I tricked Claude into leaking your deepest, darkest secrets","note":"","sid":"5201cdda51e234b5"},{"id":"agent-tool-exfiltration-channels-editorial-synthesis","kind":"editorial-inference","tier":"editorial inference","title":"LLM Digest synthesis","note":"This is the 'lethal trifecta' pattern the source article itself names: private data access, exposure to untrusted content, and any exfiltration vector, together, are exploitable regardless of which single vector you closed first. Any agent tool that both reads untrusted content and can take a further action based on what it read is a potential exfiltration channel, even after the most obvious version of the exploit is blocked — the channel just needs to move slower and use a legitimate-looking capability like link-following instead of an outbound request."}],"related_topics":[{"slug":"prompt-injection","title":"Untrusted input and tools can hijack an agent"},{"slug":"tool-use","title":"Agents reach the outside world through fragile, ad-hoc integrations"}],"related_playbook_cards":["pb-restrict-web-fetch-link-following"],"related_storylines":[],"covers_evidence":["paul-willison-2026-claude-web-fetch-exfiltration","story-5201cdda51e234b5-web-fetch-exfiltration","agent-tool-exfiltration-channels-editorial-synthesis"]},"benchmark-production-reliability-gap":{"slug":"benchmark-production-reliability-gap","title":"Does a high benchmark score predict production reliability?","question":"Does a high benchmark score predict production reliability?","summary":"A benchmark pass rate measures one round of scoring against a fixed task set — 2026 evidence shows agent-optimization gains that look real on that single round can fail to transfer or even regress once the agent is re-optimized against new tasks, and a short benchmark task is too brief to surface the failure modes that compound over a real, hundreds-of-turns production session.","status":"active","cluster":"evaluation","cluster_label":"Evals and reliability","updated":"2026-07-22","audience":"strong-software-engineer","math_depth":"","sections":[{"heading":"Builder consequence","html":"<p>If a coding-agent vendor or your own team reports a strong benchmark pass rate, that number describes one round of scoring against a fixed task set. It does not tell you whether the gain survives the next time the agent gets re-optimized, or whether the agent&#x27;s small process failures — an unverified assumption, a deferred fix, a confidently wrong claim — will compound once it runs for hundreds of turns instead of one short task. Treat a benchmark score as a starting hypothesis about production reliability, not a substitute for measuring it.</p>"},{"heading":"Short answer","html":"<p>No, not by itself. A 2026 continual-learning study on Terminal-Bench 2.0 found that one popular agent-optimization method actually performed worse than an unoptimized baseline once transferred to new tasks, and a second method stopped improving after its first optimization round — only a method built with explicit regression control kept improving across rounds. Separately, a real 241-turn production coding session surfaced failure modes — an unverified assumption compounding across six build phases, a confidently wrong claim about the codebase, quietly deferred review fixes — that a short, single-task benchmark run is too brief to ever exercise. A benchmark score answers &quot;did it pass this fixed set of tasks once&quot;; production reliability asks &quot;does it keep working as tasks, optimization rounds, and session length change,&quot; which is a different, harder question the benchmark score was never designed to answer.</p>"},{"heading":"Builder model","html":"<p>Think of a benchmark run as a single frame from a video: it is accurate for that frame and tells you nothing about what happens in the next one. Two forces move the video forward that a single frame can&#x27;t show:</p>\n<p>1. <strong>Re-optimization drift.</strong> Teams tune agents against benchmarks repeatedly — a new harness setting, a new fine-tune, a new prompt — and each round is itself an optimization step. A gain measured once is not guaranteed to hold, or even stay positive, after the next round runs against tasks the previous round never saw. 2. <strong>Horizon compounding.</strong> A benchmark task is usually short: minutes to an hour of agent turns. A production session can run for hundreds of turns. Failure modes that are individually cheap — one wrong assumption, one deferred fix — compound when nothing forces a checkpoint before the next 50 turns build on top of them.</p>\n<p>Both forces mean the fix is the same: measure your own agent&#x27;s trajectory across rounds and across long sessions, using your own production traces, instead of reading a single external benchmark number as if it were a permanent property of the agent.</p>"},{"heading":"Mechanism","html":"<p>A benchmark score is produced by running an agent (optionally after some optimization step) against a fixed set of tasks once, then reporting the aggregate pass rate. Two structural gaps separate that number from production reliability.</p>\n<p><strong>The optimization-gain gap.</strong> The Terminal-Bench 2.0 continual-learning study ran three optimization methods through two phases with identical budgets: an initial optimization phase, then a second phase against new tasks, simulating what actually happens when a deployed agent gets re-optimized as new failures surface. GEPA&#x27;s optimized agent regressed below the unoptimized baseline in the new-task phase — its first-phase gain did not transfer. Meta Harness transferred its gain but plateaued, gaining nothing from a second optimization budget. Only RELAI-VCL, which explicitly checks for regression as part of its optimization loop, kept improving across both phases, reaching a 76.4% lifelong pass rate against a 58.7% baseline. A single-round benchmark score cannot distinguish these three outcomes from each other — all three could report a similar-looking first-round number.</p>\n<p><strong>The horizon gap.</strong> A benchmark task ends; a production session doesn&#x27;t, and the failure modes that matter at hundreds of turns are different from the ones a short task exercises. The 241-turn Claude session write-up documents this directly: the agent stated a specific factual claim about the codebase (how many lifecycle hooks existed) that was simply wrong, deferred code-review findings instead of resolving them, and built a six-phase feature on an assumption nobody had verified — all failures that a single short task, scored once, would not have had the length to produce or the structure to catch.</p>\n<p>Closing both gaps takes the same move: mine your own production traces for the specific failure categories you actually see, the way LangChain built IssueBench around 15 named failure categories across three domains instead of relying on a generic pass/fail benchmark, and re-check any optimization gain after the agent is re-optimized again rather than trusting the number from the first round.</p>"},{"heading":"Evidence","html":"<ul><li>Benchmark/result-backed: the Terminal-Bench 2.0 continual-learning study shows two of three tested optimization methods either regress or plateau on new tasks, while a regression-aware method reaches a 76.4% lifelong pass rate versus a 58.7% baseline — evidence that a one-round optimization gain does not predict what happens on the next round.</li><li>Production field-report-backed: LangChain&#x27;s trace-mining loop produced a measured 13.7% harness lift on Terminal-Bench 2.0 and a cheaper fine-tuned judge model that matched frontier-model performance on a narrow task — both derived from mining the team&#x27;s own production traces, not from a published benchmark score.</li><li>Production field-report-backed: a real 241-turn Claude coding session surfaced a wrong factual claim, deferred review fixes, and an unverified assumption that compounded across six build phases — failure modes a short benchmark task is too brief to exercise.</li><li>Primary-doc-backed: LangChain built IssueBench, a 15-task benchmark across three domains and 15 named failure categories, specifically because judging whether a trace-analysis tool works in production required a purpose-built eval, not a generic agent benchmark.</li><li>Editorial inference: a benchmark score is a single-round, fixed-distribution measurement; production reliability is a claim about repeated re-optimization and long-horizon behavior, and only the team&#x27;s own continual evaluation can measure that gap.</li></ul>"},{"heading":"How to apply","html":"<ul><li><strong>Don&#x27;t cite a benchmark number as a permanent property.</strong> If an agent or harness was optimized once against a benchmark, ask whether that gain has been re-checked after any subsequent re-optimization — a regressed or plateaued gain looks identical to a real one on a single before/after comparison.</li><li><strong>Build regression checks into your own optimization loop.</strong> When you tune a harness, prompt, or fine-tune against your eval set, re-run the previous eval set alongside the new one, the way RELAI-VCL&#x27;s regression control caught what GEPA&#x27;s optimization missed.</li><li><strong>Mine your own production traces, not just the public benchmark.</strong> LangChain&#x27;s 13.7% harness lift came from trace-mining, not from re-running a published benchmark; a generic benchmark can&#x27;t see the failure categories specific to your agent and your users.</li><li><strong>Build a benchmark for your specific failure categories once you know what they are.</strong> Follow IssueBench&#x27;s pattern — name the failure categories you actually see (not generic ones), and test against multiple domains if your agent operates in more than one.</li><li><strong>Test long-horizon sessions, not just single tasks.</strong> Audit at least one long real session (hundreds of turns, not one) for compounding failures — deferred fixes, unverified assumptions, confidently wrong claims — the way the 241-turn Claude session write-up did, since a short benchmark task cannot produce this failure mode by construction.</li></ul>"},{"heading":"Failure modes","html":"<ul><li>Treating a benchmark score as permanent: citing a pass rate from one optimization round as if it will hold after the next re-optimization, without re-checking.</li><li>Optimizing without regression control: tuning against new tasks without also re-running the eval set the previous gain was measured on, so a regression (like GEPA&#x27;s) goes unnoticed.</li><li>Never mining your own traces: relying only on public benchmark numbers instead of mining production traces for the failure categories specific to your deployment.</li><li>Testing only short tasks: validating an agent exclusively on benchmark-length tasks and never auditing a long real session, where compounding failures actually show up.</li><li>Generic evals for a specific problem: using a general-purpose agent benchmark to judge a narrow tool (like a trace-analysis system) instead of building a targeted eval the way IssueBench does.</li></ul>"},{"heading":"Related","html":"<p>See <a href=\"/topic/agent-evaluation\">agent evaluation</a> for the broader problem of grading agent trajectories, <a href=\"/topic/agent-benchmarks\">agent benchmarks</a> for how fixed-task benchmarks are constructed and where they fall short, <a href=\"/topic/agent-tracing\">agent tracing</a> for the trace-mining half of this loop, and <a href=\"/foundations/llm-judge-reliability\">can you trust an LLM-as-judge score?</a> for the adjacent problem of whether the grader itself is reliable.</p>"}],"evidence":[{"id":"terminal-bench-2-continual-learning-2026","kind":"benchmark-result","tier":"benchmark/result-backed","title":"Do Agent Optimizers Compound? A Continual-Learning Evaluation on Terminal-Bench 2.0","note":"Runs three agent-optimization methods through a two-phase continual-learning evaluation on hard Terminal-Bench 2.0 tasks with identical optimization budgets, simulating an agent re-optimized as new failures emerge rather than tuned once against a fixed set. GEPA's optimized agent performs worse than the unoptimized baseline once transferred to the new-task phase. Meta Harness transfers well initially but stops improving once given a second optimization budget. Only RELAI-VCL, which builds regression control into the optimization loop, achieves both positive transfer and continued improvement, reaching a lifelong average pass rate of 76.4% versus 58.7% for the baseline. The paper's conclusion: most reported agent-optimization gains are one-shot numbers against a static benchmark, not evidence the gain holds under realistic, repeated re-optimization.","url":"http://arxiv.org/abs/2607.14004v1"},{"id":"story-8605a4348aa09d77-terminal-bench-continual-learning","kind":"story","tier":"source story","title":"Do Agent Optimizers Compound? A Continual-Learning Evaluation on Terminal-Bench 2.0","note":"","sid":"8605a4348aa09d77"},{"id":"langchain-2026-agent-trace-data-mining","kind":"production-field-report","tier":"production field-report-backed","title":"Improving Agents is a Data Mining Problem","note":"LangChain describes mining production agent traces to find failure signals, curating those failures into an eval/training set, then running improvement experiments — a Harness Engineering to Fine-Tuning to Harness Engineering loop. Adjusting harness parameters based on mined trace behavior produced a 13.7% lift over the base harness on Terminal-Bench 2.0. Separately, a judge model fine-tuned on production trace labels outperformed closed frontier models on the narrow task it was tuned for, at far lower cost to run. Neither result came from the public benchmark score alone; both came from mining the team's own production traces.","url":"https://www.langchain.com/blog/improving-agents-is-a-data-mining-problem"},{"id":"story-4a0a79e7203bae64-agent-trace-data-mining","kind":"story","tier":"source story","title":"Improving Agents is a Data Mining Problem","note":"","sid":"4a0a79e7203bae64"},{"id":"kurrent-2026-241-turn-claude-session","kind":"production-field-report","tier":"production field-report-backed","title":"When your coding agent doesn't listen: evaluating a 241-turn Claude session","note":"A practitioner audits a real 241-turn Claude coding session and finds three failure modes a short benchmark task would not have surfaced: the agent confidently asserted only two lifecycle hooks existed when documentation showed more; it quietly deferred code-review findings instead of fixing them, requiring explicit human pushback; and a six-phase feature was built on an unconfirmed behavioral assumption that ten minutes of transcript auditing revealed was false, forcing a full redesign. Each failure consumed tokens and wall-clock time before a human caught it. The write-up's framing: the agent commits to a path based on an unverified belief and builds on it fast, so a human has to be the safety net across a long session in a way a single-task benchmark run never tests.","url":"https://www.kurrent.io/blog/when-your-coding-agent-doesnt-listen"},{"id":"story-f174897519ebc366-241-turn-claude-session","kind":"story","tier":"source story","title":"When your coding agent doesn't listen: evaluating a 241-turn Claude session","note":"","sid":"f174897519ebc366"},{"id":"langchain-2026-issuebench-methodology","kind":"primary-doc","tier":"primary-doc-backed","title":"IssueBench - How We Evaluate Engine","note":"LangChain built IssueBench specifically because grading whether a trace-analysis tool works can't be read off a generic agent benchmark: it runs 15 synthetic tasks across three domains (SRE log analysis, software engineering, customer support), each a batch of clean and labeled-failure traces, and scores whether the tool identifies issues, assigns one of 15 failure categories (hallucination, PII leak, context explosion, and others), attaches new failures to existing issue cards, and groups genuinely new failures together — testing whether the tool turns raw traces into usable engineering work, not just whether it outputs a plausible-looking label.","url":"https://www.langchain.com/blog/issuebench-how-we-evaluate-engine"},{"id":"story-99b0480e54f4644d-issuebench","kind":"story","tier":"source story","title":"IssueBench - How We Evaluate Engine","note":"","sid":"99b0480e54f4644d"},{"id":"benchmark-production-reliability-gap-editorial-synthesis","kind":"editorial-inference","tier":"editorial inference","title":"LLM Digest synthesis","note":"A benchmark score is a single measurement taken under one set of conditions: one task distribution, one optimization round, one short horizon. Production reliability is a claim about many rounds and a long horizon: whether an optimization gain survives the next re-optimization, and whether the agent's small process failures (an unverified assumption, a deferred fix, a confidently wrong claim) get caught before they compound over hundreds of turns. Closing that gap takes the team's own continual evaluation — mining production traces for the failure categories that actually occur, building an eval for that specific category (as IssueBench does for trace-analysis failures), and re-checking optimization gains after every re-optimization round rather than once at launch."}],"related_topics":[{"slug":"agent-evaluation","title":"Measuring whether an agent actually worked is hard"},{"slug":"agent-benchmarks","title":"Agent benchmarks: fixed tasks that exercise real tool use"},{"slug":"agent-tracing","title":"Tracing and trace analysis for agent runs"}],"related_playbook_cards":[],"related_storylines":[],"covers_evidence":["terminal-bench-2-continual-learning-2026","story-8605a4348aa09d77-terminal-bench-continual-learning","langchain-2026-agent-trace-data-mining","story-4a0a79e7203bae64-agent-trace-data-mining","kurrent-2026-241-turn-claude-session","story-f174897519ebc366-241-turn-claude-session","langchain-2026-issuebench-methodology","story-99b0480e54f4644d-issuebench","benchmark-production-reliability-gap-editorial-synthesis"]},"context-compaction-safety":{"slug":"context-compaction-safety","title":"Does compacting an agent's context put its safety rules at risk?","question":"Does compacting an agent's context put its safety rules at risk?","summary":"Context compaction is not just a lossy cost optimization — a 1,323-episode benchmark shows it can silently erase the governance constraints a long-running agent was given, and only pinning those constraints outside the compactible window prevents it.","status":"active","cluster":"safety","cluster_label":"Safety and control","updated":"2026-07-02","audience":"strong-software-engineer","math_depth":"","sections":[{"heading":"Builder consequence","html":"<p>If your agent runs long enough to need context compaction — summarizing, evicting, or compressing older turns to stay under a token budget — the compactor is not a neutral cost optimization. It is a place where the rules you gave the agent up front (forbidden tools, approval gates, a user&#x27;s hard &quot;do not&quot;) can silently disappear. The agent will keep acting exactly as if nothing changed, because from its perspective nothing did: the constraint is simply no longer in what it can see.</p>"},{"heading":"Short answer","html":"<p>Context compaction can silently erase safety and governance constraints stated earlier in a long-running session, and this is not a rare edge case: across 1,323 episodes and seven model families, prohibited-action violation rises from 0% with the constraint in full context to 30% after ordinary compaction, and as high as 59% for some models. When the constraint text survives the summary, violations stay at 0%. The fix isn&#x27;t &quot;compact less&quot; — it&#x27;s &quot;never let the compaction step touch the parts of context that carry hard rules.&quot;</p>"},{"heading":"Builder model","html":"<p>Split what lives in an agent&#x27;s context into two classes: content that can be safely lost and re-derived (task history, intermediate reasoning, prior tool outputs) and content that is load-bearing and irreversible if lost (permissions, forbidden actions, hard constraints, approval gates). Ordinary summarization treats both classes the same way — it compresses for information density, not for which sentence is a safety rule. Once a governance constraint gets paraphrased away or dropped for space, the agent isn&#x27;t disobeying a rule it still holds; it genuinely no longer has the rule in front of it. The same threat model as prompt injection applies to your own compactor: an untrusted or adversarial step in the pipeline can remove instructions you rely on, whether by accident or on purpose.</p>"},{"heading":"Mechanism","html":"<p>A long-horizon agent keeps a token budget. To stay under it, agents typically evict old turns, replace them with a running summary, or roll both together — a summarization model or heuristic decides what to keep, usually optimizing for task continuity, not rule preservation.</p>\n<p>The Governance Decay study measures how often a stated policy constraint survives this process, using ConstraintRot, a benchmark of long-horizon agent scenarios with deterministic tool-call grading. The results:</p>\n<ul><li><strong>0% violation</strong> when the constraint sits in full, uncompacted context</li><li><strong>30% violation</strong> after ordinary compaction (up to 59% for some models)</li><li><strong>0% violation</strong> when the compacted summary happens to retain the constraint&#x27;s wording</li><li><strong>38% violation</strong> when the wording is dropped</li></ul>\n<p>The paper also demonstrates a Compaction-Eviction Attack: adversarial in-context content crafted to bias the summarizer toward omitting a legitimate policy. Optimized versions of this attack defeat every model they evaluate, turning the compactor into an active adversarial target, not just a source of accidental loss.</p>\n<p>Their proposed fix, Constraint Pinning, is training-free: it quarantines governance constraints so the compaction step can&#x27;t touch them. That alone restores violation to 0% in their benchmark.</p>\n<p>This mechanism generalizes beyond safety text. The tiered memory architecture practitioners converge on — short-term working context, episodic history, long-term semantic store — moves information through a lossy transform at every tier: summarize, embed-and-retrieve, or forget. None of those transforms natively distinguishes a detail that no longer matters from a detail the system depends on.</p>"},{"heading":"Evidence","html":"<ul><li>Benchmark/result-backed: Governance Decay / ConstraintRot measures constraint-violation rate across 1,323 episodes and seven model families: 0% with the policy in full context, 30% after ordinary compaction (up to 59% for some models), 0% when the constraint survives the summary, 38% when it&#x27;s dropped; a Compaction-Eviction Attack defeats every evaluated model, and training-free Constraint Pinning restores violation to 0%.</li><li>Primary-doc-backed: LangChain&#x27;s practitioner guide frames agent memory as short-term (live context), episodic, and long-term/semantic tiers, and recommends a capture -&gt; analyze -&gt; update loop over trace data instead of dumping raw history into long-term memory.</li><li>Production field-report-backed: Elastic&#x27;s Atlas ships three memory categories on top of Elasticsearch, exposed to agents over MCP with per-user isolation, and reports a measured evaluation number (0.89 Recall@10) rather than shipping the architecture as an unverified diagram — the same discipline this concept asks builders to apply to compaction specifically.</li><li>Editorial inference: treat any lossy transform in the memory pipeline as a place a safety-relevant fact can silently vanish, and test for it adversarially, not just on the happy path.</li></ul>"},{"heading":"How to apply","html":"<p>Four changes close this gap:</p>\n<ul><li><strong>Pin hard constraints outside the compactible window.</strong> Identify every rule your agent depends on (forbidden tools, approval gates, hard user &quot;do nots&quot;, compliance rules), store them in a pinned system block your summarization step cannot rewrite or evict, and re-inject the verbatim text into every post-compaction prompt instead of trusting the running summary to carry it forward.</li><li><strong>Add a compaction regression test.</strong> Force a compaction cycle mid-session, then attempt the prohibited action and assert the agent still refuses. The check is cheap and training-free, but only catches the failure if you actually run it — governance decay is invisible until you specifically probe for it.</li><li><strong>Treat the compactor as untrusted input.</strong> If an attacker can influence what enters context (a tool response, a retrieved document), assume they can bias the summarizer into dropping a constraint the same way they&#x27;d exploit an injected tool result. Make sure the pinned region cannot be edited by anything the compactor reads.</li><li><strong>Require a measured number from any memory architecture.</strong> Whether it&#x27;s a tiered store, external retrieval, or a vendor-shipped memory service, demand an evaluation number before you trust an unverified &quot;we added memory&quot; claim.</li></ul>"},{"heading":"Failure modes","html":"<ul><li>Compaction as a black box: trusting a summarizer to preserve &quot;the important parts&quot; without testing whether governance-relevant text specifically survives.</li><li>Treating governance decay as rare: benchmark data says otherwise — violation rates hit double digits under ordinary compaction, not just adversarial conditions.</li><li>No adversarial test: never running a Compaction-Eviction-style attack against your own pipeline, so the first adversarial constraint drop happens in production.</li><li>Same-tier assumption: managing safety rules and disposable task history with the same lossy pipeline instead of splitting load-bearing content into a pinned, non-evictable region.</li><li>Shipping memory without an eval number: adding a memory layer (compaction, retrieval, or a vendor service) and calling it done without measuring whether it actually preserves what matters.</li></ul>"},{"heading":"Related","html":"<p>See <a href=\"/topic/context-compaction\">context compaction</a> for compaction techniques and their cost/latency trade-offs, <a href=\"/topic/agent-memory\">agent memory</a> for the broader tiered-memory architecture debate, and <a href=\"/topic/prompt-injection\">prompt injection</a> for the adjacent threat model where untrusted content hijacks what an agent trusts.</p>"}],"evidence":[{"id":"constraintrot-2026-governance-decay","kind":"benchmark-result","tier":"benchmark/result-backed","title":"Governance Decay: How Context Compaction Silently Erases Safety Constraints in Long-Horizon LLM Agents","note":"ConstraintRot benchmark, 1,323 episodes across seven model families: prohibited-action violation is 0% with the policy in full context, rises to 30% after ordinary compaction (up to 59% for some models), stays 0% when the constraint survives the summary, and reaches 38% when it is dropped. A Compaction-Eviction Attack (adversarial content that biases the summarizer to drop the policy) defeats every evaluated model; the paper's training-free Constraint Pinning mitigation restores violation to 0%.","url":"http://arxiv.org/abs/2606.22528v1"},{"id":"langchain-2026-agent-memory-guide","kind":"primary-doc","tier":"primary-doc-backed","title":"How to Build Memory into AI Agents","note":"Frames agent memory as short-term (live context), episodic, and long-term/semantic tiers, and recommends a capture-traces -> analyze -> selectively-update loop over long-term memory rather than dumping raw history into it.","url":"https://www.langchain.com/blog/how-to-give-your-agent-memory"},{"id":"elastic-atlas-2026-cognitive-memory","kind":"production-field-report","tier":"production field-report-backed","title":"Elastic Open-Sources Atlas Agent Memory Based on Cognitive Science","note":"Elastic's Atlas ships three memory categories on Elasticsearch, exposed to agents over MCP with per-user isolation, and reports 0.89 Recall@10 on a question-answering evaluation rather than shipping the architecture as an unverified diagram.","url":"https://www.infoq.com/news/2026/06/elastic-atlas-agent-memory/"},{"id":"context-compaction-safety-editorial-synthesis","kind":"editorial-inference","tier":"editorial inference","title":"LLM Digest synthesis","note":"For agent builders, any lossy transform in the memory pipeline (compaction, retrieval, forgetting) is a place a safety-relevant fact can silently vanish, and it needs the same adversarial testing discipline as prompt injection, not just a happy-path check."}],"related_topics":[{"slug":"context-compaction","title":"Context compaction: summarize, compress, and curate the working set"},{"slug":"agent-memory","title":"Agents forget across steps and sessions"},{"slug":"prompt-injection","title":"Untrusted input and tools can hijack an agent"}],"related_playbook_cards":["pb-pin-governance-constraints-past-compaction","pb-close-the-trace-to-memory-loop"],"related_storylines":[],"covers_evidence":["constraintrot-2026-governance-decay","langchain-2026-agent-memory-guide","elastic-atlas-2026-cognitive-memory","context-compaction-safety-editorial-synthesis"]},"llm-judge-reliability":{"slug":"llm-judge-reliability","title":"Can you trust an LLM-as-judge score?","question":"Can you trust an LLM-as-judge score?","summary":"An LLM judge is a measurement instrument with its own biases, not ground truth — validate it the same way you validate the agent it grades, and for agent trajectories with checkable evidence, consider a deterministic scorer instead.","status":"active","cluster":"evaluation","cluster_label":"Evals and reliability","updated":"2026-07-10","audience":"strong-software-engineer","math_depth":"","sections":[{"heading":"Builder consequence","html":"<p>If you grade agent traces with an LLM judge, the score you read is not a fact about the agent — it is a fact about the agent filtered through a second model that has its own failure modes. Before you wire a judge into CI gating or a dashboard, you need to know whether it is biased toward a slot, a length, or a language, and whether its accuracy on your eval set predicts catching the failure you actually care about in production.</p>"},{"heading":"Short answer","html":"<p>LLM-as-judge accuracy on a held-out set is necessary but not sufficient. Judges carry systematic biases — favoring a response&#x27;s position, its length, or the language it is written in — that raw accuracy numbers hide, and a judge that passes a benchmark can still miss the specific real-world failure mode you built the eval to catch. A separate, more structural gap sits underneath the bias problem: a judge grades the final answer&#x27;s plausibility, not whether the agent&#x27;s trajectory actually earned that answer, so a confidently-worded response can score 0.85 or higher from two frontier judges while the trace shows the agent never retrieved the evidence its answer depended on. Treat the judge as a component under test, not as the test — and for agent trajectories with checkable evidence paths, consider replacing the judge with a deterministic scorer instead of only auditing it for bias.</p>"},{"heading":"Builder model","html":"<p>A judge is a classifier with a prompt instead of a training loop, and classifiers have failure modes that don&#x27;t show up in a single aggregate accuracy number. Two judge designs exist on a spectrum: a frontier LLM prompted to grade (flexible, expensive, occasionally biased in subtle ways) and a small fine-tuned classifier — encoder or distilled LLM — trained on production-labeled examples (cheap, fast, narrower, and only as good as the labels it learned from). Both need the same thing an agent needs: a held-out test set built from real failures, not just the cases the judge was tuned to recognize.</p>\n<p>A judge — of either design — grades what the agent said, not what the agent&#x27;s trajectory can prove. When the task has a checkable evidence path (a document the agent should have retrieved, a time window it should have reasoned within, a causal mechanism it should have used instead of a plausible-sounding one), a deterministic scorer that grades the trajectory directly closes a gap no amount of judge tuning can, because the judge only ever sees the final answer&#x27;s surface plausibility.</p>"},{"heading":"Mechanism","html":"<p>An LLM judge scores a response (or a multi-step trajectory) by generating a verdict conditioned on the response, a rubric, and often a second response to compare against. Because the verdict is itself a model output, it inherits model-level artifacts:</p>\n<ul><li><strong>Position bias</strong> — the judge prefers whichever candidate is shown first.</li><li><strong>Verbosity bias</strong> — the judge prefers longer text as a proxy for thoroughness.</li><li><strong>Cross-lingual / distribution-shift degradation</strong> — the judge loses calibration outside the language or domain it was tuned on.</li></ul>\n<p>Swapping the order of the two responses being compared is a direct probe for position bias: if the verdict flips depending on which slot a response sits in, the judge is responding to position, not content.</p>\n<p>For agent trajectories specifically, the judge has to score a sequence of tool calls and intermediate decisions, not a single text block, which multiplies the places a bias can hide — a judge can be well-calibrated on final-answer correctness while being unreliable on whether the agent reached that answer through a sound or broken path. Cheaper judge architectures (fine-tuned encoders, distilled small LLMs) trade a wider rubric-following ability for speed and cost, but they are exposed to the same validation requirement: their accuracy has to be measured against the failure modes you care about, not just against the cases used to tune them.</p>\n<p>GroundEval targets that broken-path problem head-on by removing the judge from the loop entirely for tasks with checkable evidence. Instead of asking a model to grade a response, it uses a domain configuration to generate questions, lets the agent answer however it chooses, then scores both the final answer and the recorded trajectory against three deterministic tracks: Silence (did the agent actually check before claiming something was absent), Perspective (did it reason only from evidence available to it at the relevant time), and Counterfactual (did it use the real causal mechanism rather than a plausible-sounding one). Because each track grades the trajectory against ground truth the system already knows — what was retrievable, when, and through what causal path — it catches an ungrounded-but-fluent answer that a judge, which only ever sees the final text, cannot detect by construction.</p>"},{"heading":"Evidence","html":"<ul><li>Benchmark/result-backed: BabelJudge constructs gold-labeled pairs by perturbing known-good answers (no human annotation needed) and measures position bias, verbosity bias, order inconsistency, and cross-lingual degradation directly — showing a judge&#x27;s raw accuracy (0.835 in Hindi vs. 0.660 in Swahili) can look closer than its bias-penalized reliability (0.714 vs. 0.550) actually is, and that order consistency in the lower-resource language collapses to near-random.</li><li>Benchmark/result-backed: &quot;Do Encoders Suffice?&quot; benchmarks fine-tuned encoder classifiers against LLM-based judges for harmful-output detection across several attack techniques, testing whether a cheaper, lower-latency judge architecture holds up without a major accuracy loss.</li><li>Production field-report-backed: LangChain and Fireworks fine-tuned a small open model on production trace labels and matched frontier-judge performance at roughly 1/100th the cost — evidence that judge behavior can be distilled, measured, and re-validated rather than locked to whichever frontier model wrote the first version.</li><li>Production field-report-backed: a practitioner postmortem on a real eval miss shows a judge and eval suite scoring a production failure as a pass, which is the failure mode no amount of judge-accuracy reporting alone would surface.</li><li>Benchmark/result-backed: GroundEval&#x27;s case study shows two frontier LLM judges scoring a plausible agent response 0.85 or higher while the recorded trajectory reveals the agent never retrieved the artifact its answer depended on — a GroundEval score of 0.000 — and the paper&#x27;s case studies suggest this ungrounded-but-plausible failure is common, not exceptional.</li><li>Editorial inference: the practical implication is that &quot;judge accuracy&quot; is a claim that needs the same skepticism and held-out testing as any other model output the agent produces.</li></ul>"},{"heading":"How to apply","html":"<p>Before trusting a judge&#x27;s verdicts, run these checks:</p>\n<ul><li><strong>Order-swap test.</strong> Run every pairwise comparison both ways and only count verdicts that agree.</li><li><strong>Verbosity check.</strong> Track response length against verdict to catch verbosity bias.</li><li><strong>Per-slice reliability.</strong> If you operate in more than one language or domain, measure judge reliability per slice instead of reporting one pooled number.</li><li><strong>Held-out set from real failures.</strong> Build it from production failures your team has actually seen, not synthetic cases the judge would obviously get right — a judge that&#x27;s accurate on easy cases and silent on the hard one you cared about is failing at its job.</li><li><strong>Re-validate before swapping in a cheaper judge.</strong> If cost matters, validate a fine-tuned encoder or distilled small model against the same held-out set before shipping it, and re-run validation whenever the underlying model, prompt, or rubric changes.</li><li><strong>Check groundedness, not just plausibility, for agent trajectories.</strong> If the task has a checkable evidence path — a document that should have been retrieved, a time boundary the reasoning must respect, a causal mechanism it must use — grade the recorded trajectory against that ground truth directly instead of asking a judge whether the final answer sounds right.</li></ul>"},{"heading":"Failure modes","html":"<ul><li>Aggregate accuracy worship: reporting one pooled accuracy number and missing that it hides a collapse in a specific slice (language, position, length band).</li><li>Order blindness: never testing whether a pairwise verdict flips when you swap which response sits in which slot.</li><li>Benchmark-only validation: tuning and validating a judge on the same kind of cases, so it never sees the production failure mode the eval exists to catch.</li><li>Set-and-forget judges: shipping a judge once and never re-validating it after the agent, prompt, or underlying judge model changes.</li><li>Treating cost-cutting as free: swapping in a cheaper judge architecture for cost reasons without re-running the same bias and accuracy checks used on the original judge.</li><li>Grading the answer, not the path: trusting a judge&#x27;s high score on a fluent final answer without checking whether the trajectory that produced it actually retrieved the right evidence, respected the right time boundary, or used the right causal mechanism.</li></ul>"},{"heading":"Related","html":"<p>See <a href=\"/topic/agent-evaluation\">agent evaluation</a> for the broader problem of grading agent trajectories, <a href=\"/topic/llm-as-judge\">LLM-as-judge</a> for the model-graded evaluation pattern this concept interrogates, and <a href=\"/foundations/benchmark-production-reliability-gap\">does a high benchmark score predict production reliability?</a> for the adjacent problem of whether the benchmark itself, not just the judge, predicts real-world behavior.</p>"}],"evidence":[{"id":"babeljudge-2026-judge-bias","kind":"benchmark-result","tier":"benchmark/result-backed","title":"BabelJudge: Measuring LLM-as-a-Judge Reliability Across Languages and Agent Trajectories","note":"Finds position bias, verbosity bias, order inconsistency, and cross-lingual degradation in an LLM judge (Qwen2.5-7B-Instruct): bias-penalized reliability falls from 0.714 (Hindi) to 0.550 (Swahili) and order consistency collapses to 0.480 under slot swaps, even though raw accuracy (0.835 vs 0.660) hides the gap.","url":"http://arxiv.org/abs/2606.22329v1"},{"id":"encoder-decoder-safety-judges-2026","kind":"benchmark-result","tier":"benchmark/result-backed","title":"Do Encoders Suffice? A Systematic Comparison of Encoder and Decoder Safety Judges for LLM Adversarial Evaluation","note":"Benchmarks fine-tuned encoder classifiers against LLM-based judges for detecting harmful outputs across multiple attack techniques, evaluating whether a much cheaper, lower-latency judge architecture can substitute for an LLM judge without a major accuracy loss.","url":"http://arxiv.org/abs/2606.25782v1"},{"id":"langchain-fireworks-trace-judge-2026","kind":"production-field-report","tier":"production field-report-backed","title":"Building a 100x Cheaper Trace Judge with Fireworks","note":"LangChain and Fireworks fine-tuned a small open model on production trace labels and matched frontier-judge performance at roughly 1/100th the cost, showing a judge's behavior can be distilled and re-validated rather than treated as fixed.","url":"https://www.langchain.com/blog/building-a-100x-cheaper-trace-judge-with-fireworks"},{"id":"linear-sales-email-eval-miss-2026","kind":"production-field-report","tier":"production field-report-backed","title":"Why most AI evals would miss the Linear sales email failure","note":"Practitioner postmortem on a real production failure that a typical eval suite and judge would have scored as a pass, illustrating that judge accuracy on a benchmark does not guarantee the judge catches the failure that actually matters.","url":"https://tenureai.dev/writing/why-most-ai-evals-would-miss-the-linear-sales-email-failure"},{"id":"groundeval-2026-judge-free-agent-evaluation","kind":"benchmark-result","tier":"benchmark/result-backed","title":"GroundEval: A Deterministic Replacement for LLM-as-Judge in Stateful Agent Evaluation","note":"In a case study, two frontier LLM judges scored a plausible agent response 0.85 or higher, but the recorded trajectory showed the agent had never retrieved the artifact its answer depended on, yielding a GroundEval score of 0.000. GroundEval replaces the judge with a deterministic scorer over grounded, time-bounded, access-controlled evidence, checking three tracks LLM-as-judge evaluation struggles to detect by construction: Silence (did the agent check before claiming absence), Perspective (did it reason only from evidence available at the relevant time), and Counterfactual (did it use the correct causal mechanism rather than a plausible one). The paper's case studies suggest this failure mode is common, not exceptional.","url":"https://arxiv.org/abs/2606.22737"},{"id":"llm-judge-reliability-editorial-synthesis","kind":"editorial-inference","tier":"editorial inference","title":"LLM Digest synthesis","note":"For agent builders, an LLM-as-judge score is an output of a measurement instrument with its own bias profile, not a ground-truth label, so the judge needs the same validation discipline as the agent it grades."}],"related_topics":[{"slug":"agent-evaluation","title":"Measuring whether an agent actually worked is hard"},{"slug":"llm-as-judge","title":"LLM-as-judge: model-graded evaluation of traces and outputs"}],"related_playbook_cards":["pb-audit-llm-judges-for-position-and-language-bias"],"related_storylines":[],"covers_evidence":["babeljudge-2026-judge-bias","encoder-decoder-safety-judges-2026","langchain-fireworks-trace-judge-2026","linear-sales-email-eval-miss-2026","groundeval-2026-judge-free-agent-evaluation","llm-judge-reliability-editorial-synthesis"]},"mcp-security-control-layers":{"slug":"mcp-security-control-layers","title":"What actually breaks when you run MCP in production, and how do you defend it?","question":"What actually breaks when you run MCP in production, and how do you defend it?","summary":"An analysis of documented MCP CVEs found most incidents cluster in four layers — unsafe tool execution, unauthenticated management endpoints, unrestricted outbound calls, and undetected tool-definition drift — and a gateway alone defends none of them; each layer needs its own control, enforced closer to the failure than the gateway.","status":"active","cluster":"safety","cluster_label":"Safety and control","updated":"2026-08-07","audience":"strong-software-engineer","math_depth":"","sections":[{"heading":"Builder consequence","html":"<p>If &quot;securing MCP&quot; in your deployment plan means &quot;put it behind an authenticated gateway,&quot; you&#x27;ve covered one layer and left three uncovered. An analysis of documented MCP CVEs found that most incidents happen inside or downstream of the server the gateway is fronting — in how a tool executes its arguments, what a server can reach outbound, and whether a tool&#x27;s definition still matches what was approved — none of which a gateway&#x27;s inbound auth check inspects.</p>"},{"heading":"Short answer","html":"<p>Documented MCP vulnerabilities cluster into four layers, each with a different earliest point where it can actually be stopped: unsafe tool execution (arguments reaching a shell or <code>eval()</code>), unauthenticated management surfaces (inspectors, test harnesses, registration endpoints treated as non-production), an unrestricted outbound trust boundary (a server able to call any URL with a privileged credential), and undetected semantic drift (a tool&#x27;s definition changing after a human approved it). A gateway sitting in front of MCP traffic addresses none of these directly — it&#x27;s an inbound routing and auth control, and three of the four failure classes happen behind it.</p>"},{"heading":"Builder model","html":"<p>Don&#x27;t model MCP security as &quot;gateway secures the perimeter, servers are trusted inside it.&quot; Model each MCP server as a small privileged service with its own attack surface, and ask the same four questions you&#x27;d ask of any service that executes instructions and calls the network: does it turn caller-supplied arguments into a shell command or eval&#x27;d code (execution layer)? Are its non-production interfaces — the ones a developer or CI pipeline hits, not the ones an agent hits — actually authenticated (management layer)? What can it reach outbound, and with what credential (trust-boundary layer)? And is there any way for its advertised behavior to change without someone noticing (integrity layer)? A gateway answers &quot;who&#x27;s allowed to call this server,&quot; which is a real but separate question from all four.</p>"},{"heading":"Mechanism","html":"<p>The execution layer fails when a tool implementation passes caller-controlled arguments into a shell string or an <code>exec()</code>/<code>eval()</code> call instead of an argument array — the classic command-injection pattern, just reached through a tool call instead of a web form. The InfoQ analysis attributes 13 of 30 documented CVEs to exactly this pattern, and the fix is mechanical: pass arguments as arrays so there&#x27;s no string to inject into, and gate merges with CI checks that flag <code>subprocess(shell=True)</code> and equivalents.</p>\n<p>The management-infrastructure layer fails because MCP tooling ships operational surfaces — inspectors, testing harnesses, server registration endpoints — that get built and deployed with the same casualness as any dev tool, then left reachable in a production network because nobody treated them as production. Six documented CVEs trace to exactly this: an unauthenticated management endpoint that shouldn&#x27;t have been reachable at all. The fix is treating every management endpoint as production-adjacent: mandatory authentication, network isolation, and minimal filesystem access, not &quot;it&#x27;s just for debugging.&quot;</p>\n<p>The outbound trust-boundary layer fails when a server&#x27;s egress isn&#x27;t restricted and its outbound credential is broader than the one call that needs it. CVE-2026-26118, an Azure SSRF, is the concrete case: a server could be induced to call an attacker-controlled URL and leak a managed-identity token to it, because nothing constrained where the server&#x27;s outbound calls could go or scoped the credential attached to them. The fix is an egress allow-list enforced at the network layer plus scoped identity tokens — one credential class per tool purpose, so a leaked token from one tool doesn&#x27;t grant everything the server can do.</p>\n<p>The semantic-integrity layer fails when a tool&#x27;s definition changes after a human or system approved it — a &quot;rug-pull,&quot; where the tool a reviewer signed off on isn&#x27;t the tool that ends up executing. The defense is manifest pinning: hashing the approved tool definition (SHA-256 canonicalization) at registration time, storing that as the signed baseline, and routing any material schema change through operator review instead of silently accepting whatever the server now advertises.</p>"},{"heading":"Evidence","html":"<ul><li>Production field-report: the InfoQ analysis is grounded in a documented CVE count (30 total, with the 13/6 split cited above) and a specific named vulnerability (CVE-2026-26118), not a hypothetical threat model — it&#x27;s a measured accounting of what has actually gone wrong in shipped MCP deployments.</li><li>Story-backed: the AWS AgentCore writeup situates this guidance as landing the day after MCP&#x27;s 2026-07-28 spec revision, which hardened the *authorization* spec but left execution, management-surface, outbound, and integrity risks to be addressed by deployment-level controls, not the protocol itself.</li><li>Editorial inference: the &quot;gateway can&#x27;t see three of the four layers&quot; framing is LLM Digest&#x27;s synthesis of why defense-in-depth applies here specifically — it&#x27;s not a claim made verbatim in either source.</li></ul>"},{"heading":"How to apply","html":"<ul><li><strong>Audit tool execution paths for shell/eval usage first — it&#x27;s the largest documented category.</strong> Grep tool-implementation code for <code>shell=True</code>, <code>exec()</code>, <code>eval()</code>, or string-built shell commands, and require arguments to be passed as arrays instead.</li><li><strong>Treat your MCP inspector, test harness, and registration endpoint as production services</strong>, not developer conveniences — put authentication and network isolation on them even if &quot;only internal tools use them.&quot;</li><li><strong>Put an egress allow-list on every MCP server&#x27;s network path, and scope credentials per tool purpose.</strong> A server that only needs to call one internal API shouldn&#x27;t hold a credential broad enough to reach arbitrary external URLs.</li><li><strong>Pin tool manifests at registration and diff on every change.</strong> Hash the approved tool definition and require operator review before accepting a materially changed schema from a server you&#x27;ve already approved — don&#x27;t silently trust whatever the server advertises on each connection.</li><li><strong>Don&#x27;t stop at the gateway.</strong> A vendor gateway tier gives you inbound routing, auth, and observability; budget separately for execution-layer, outbound, and integrity controls, because the gateway&#x27;s threat model doesn&#x27;t cover them.</li></ul>"},{"heading":"Failure modes","html":"<ul><li>Equating &quot;behind an authenticated gateway&quot; with &quot;secure&quot;: the gateway controls who can call a server, not what the server does with the call once it arrives.</li><li>Shipping debug/inspector tooling to production reachability because it &quot;isn&#x27;t the real API&quot; — six documented CVEs are exactly this mistake.</li><li>Granting a tool&#x27;s outbound credential broader scope than the one integration it needs, so a single SSRF or injection turns into full-credential exfiltration instead of a contained one.</li><li>Trusting a server&#x27;s currently-advertised tool definition indefinitely after initial approval, with no re-verification if that definition changes later.</li></ul>"},{"heading":"Related","html":"<p>See <a href=\"/topic/mcp\">MCP</a> for the protocol&#x27;s broader production adoption arc, <a href=\"/topic/agent-sandboxing\">agent sandboxing</a> for execution-isolation techniques that complement the execution-layer fix here, and <a href=\"/topic/prompt-injection\">prompt injection</a> for the attacker-controlled-input side of the outbound-trust-boundary failure.</p>"}],"evidence":[{"id":"infoq-mcp-defense-in-depth","kind":"production-field-report","tier":"production field-report-backed","title":"Securing MCP in Production: Defense-in-Depth Beyond the Gateway","note":"Analyzes documented MCP CVEs and groups the failures into four architectural layers: safe tool execution (13 of 30 documented CVEs traced to unsafe execution patterns like shell string interpolation or exec()/eval() on user input), management infrastructure (six CVEs from unauthenticated inspector, testing-harness, or registration endpoints), the outbound trust boundary (illustrated by CVE-2026-26118, an Azure SSRF that let a malicious URL exfiltrate a managed-identity token), and semantic integrity (undetected post-registration changes to a tool's definition, a 'rug-pull' attack). Recommends per-layer controls: arguments passed as arrays rather than shell strings; mandatory auth plus network isolation on management endpoints; egress allow-lists and per-tool-purpose scoped credentials; and manifest pinning with SHA-256 canonicalization so a definition change requires operator review.","url":"https://www.infoq.com/articles/securing-mcp-production-gateway/"},{"id":"aws-agentcore-mcp-2026-07-28-spec","kind":"story","tier":"source story","title":"How AgentCore Gateway supports the MCP 2026-07-28 spec","note":"Context: this security guidance was published one day after MCP's largest spec revision, framing production hardening as the necessary complement to the new spec's own authorization changes rather than something the spec update handles on its own.","sid":"b734d716b0d66f96"},{"id":"mcp-security-editorial-synthesis","kind":"editorial-inference","tier":"editorial inference","title":"LLM Digest synthesis","note":"The through-line across all four layers is that a routing gateway sits at the network edge, while three of the four failure classes (unsafe execution, outbound exfiltration, definition drift) originate inside or behind the MCP server itself — a gateway can enforce inbound auth and rate limits, but it structurally cannot see what a tool does once a call reaches it."}],"related_topics":[{"slug":"mcp","title":"Model Context Protocol: a standard interface for agent tools"},{"slug":"agent-sandboxing","title":"Sandboxing, scoped credentials, and guardrails"},{"slug":"prompt-injection","title":"Untrusted input and tools can hijack an agent"}],"related_playbook_cards":[],"related_storylines":[{"slug":"gateway-mcp","label":"Gateway MCP"}],"covers_evidence":["infoq-mcp-defense-in-depth","aws-agentcore-mcp-2026-07-28-spec","mcp-security-editorial-synthesis"]},"mcp-stateless-scaling":{"slug":"mcp-stateless-scaling","title":"Why did MCP go stateless, and what does that change for scaling agent tool gateways?","question":"Why did MCP go stateless, and what does that change for scaling agent tool gateways?","summary":"MCP's 2026-07-28 spec dropped the session-handshake header that pinned a client to one server instance, so any gateway node can now handle any request — the same statelessness trade that let HTTP scale horizontally, applied to agent tool calls.","status":"active","cluster":"tool-use","cluster_label":"Tool use and agents","updated":"2026-08-07","audience":"strong-software-engineer","math_depth":"","sections":[{"heading":"Builder consequence","html":"<p>If you run or plan to run an MCP gateway or a fleet of MCP servers behind one, the protocol version you target decides whether you can put a plain load balancer in front of them or need sticky routing and a shared session store. MCP&#x27;s 2026-07-28 spec removed the protocol-level reason you&#x27;d need the latter. If your gateway or client library still assumes a session handshake, you&#x27;re carrying scaling complexity the spec no longer requires.</p>"},{"heading":"Short answer","html":"<p>Earlier MCP versions opened a connection with an initialization handshake: the server issued an <code>Mcp-Session-Id</code> header, and the client had to send it back on every following call, which meant that call had to land on the same server instance that issued it. The 2026-07-28 spec — the largest revision since MCP launched — removed that handshake. Each request is now self-contained: protocol version and client capabilities travel inside the request&#x27;s own <code>_meta</code> parameter, so any gateway node can service any call. The same revision also formalized a governed extensions system (SEP-2133) so new capabilities ship independently of the core spec, and hardened the authorization spec toward standard OAuth 2.0/OpenID Connect patterns.</p>"},{"heading":"Builder model","html":"<p>Treat this the same way you&#x27;d treat choosing between a stateful WebSocket session and stateless HTTP requests. A stateful protocol needs every follow-up call routed to the specific instance holding that session&#x27;s state — you either pin the client to that instance (sticky sessions) or replicate the state to a shared store every backend can read. Either way, that instance failing mid-session drops the session&#x27;s context with it. A stateless protocol removes that constraint by having each request carry what a handler needs to serve it, so a load balancer can route purely on capacity and any healthy instance can pick up the next call. MCP moving from the former to the latter is a protocol-level decision to make gateway fleets behave like ordinary horizontally scaled web infrastructure instead of like a session-affine service.</p>"},{"heading":"Mechanism","html":"<p>Before the 2026-07-28 spec, an MCP client opened a session with an initialization exchange, and the server responded with a session identifier the client was required to echo on every subsequent request. That identifier was the mechanism binding a client to one server instance: whichever instance issued the session ID was the only one that could correctly service later calls in that session, because session state (negotiated capabilities, protocol version) lived on that instance and nowhere else by default.</p>\n<p>The new spec drops the handshake and the header. Instead, the protocol version and the client&#x27;s capabilities are included directly inside the <code>_meta</code> parameter of each request. Nothing about serving a given call depends on which instance served the previous one, because the previous call&#x27;s context isn&#x27;t implicitly required — the current call restates what it needs. That is what &quot;stateless&quot; means here concretely: not that MCP servers can&#x27;t hold state at all (a tool implementation can still be stateful in whatever way it needs), but that the *protocol* no longer requires request-to-request server affinity to interpret a call correctly.</p>\n<p>Two other changes shipped in the same revision, distinct from statelessness but bundled into the same spec bump: a governed extensions system (SEP-2133) that gives each new protocol capability a reverse-DNS identifier, a dedicated repository with delegated maintainers, and its own release cadence — so a client and server negotiate which extensions they both support via an <code>extensions</code> capability map, instead of every new feature forcing a core version bump; and six SEPs that bring MCP&#x27;s authorization specification closer to standard OAuth 2.0 and OpenID Connect deployment patterns, without changing how a specific gateway&#x27;s inbound credential check (IAM/SigV4, OAuth/JWT) is implemented.</p>"},{"heading":"Evidence","html":"<ul><li>Story-backed: the AWS AgentCore Gateway writeup names the specific mechanism change (session-handshake header replaced by a self-contained <code>_meta</code> parameter) and the two accompanying spec changes (governed extensions via SEP-2133, six authorization-hardening SEPs), and reports that AgentCore Gateway operators enable the new spec version via a single <code>UpdateGateway</code> call rather than a redeployment.</li><li>Storyline-backed: the <code>gateway-mcp</code> thread shows the practical consequence within days — Azure API Management shipping a dedicated AI Gateway tier as a control plane spanning multiple model providers and MCP servers, evidence that the ecosystem is building on the assumption that MCP traffic can be routed statelessly.</li><li>Editorial inference: the load-balancing and failover framing (sticky routing vs. stateless routing, HTTP&#x27;s own history of this trade-off) is LLM Digest&#x27;s synthesis connecting the protocol change to standard distributed-systems scaling practice; it is not a claim from either source article.</li></ul>"},{"heading":"How to apply","html":"<ul><li><strong>Drop session-affinity infrastructure once your MCP clients and servers both speak the 2026-07-28+ spec.</strong> Sticky load-balancer rules or a shared session-ID store are no longer required by the protocol; keep them only if something else in your stack (not MCP itself) still needs them.</li><li><strong>Check your MCP client/server library version before assuming statelessness.</strong> A library built against a pre-2026-07-28 spec version may still perform the old handshake; confirm the library negotiates via the <code>_meta</code> parameter, not a lingering <code>Mcp-Session-Id</code> header, before removing affinity routing.</li><li><strong>Treat extension support as negotiated, not assumed.</strong> With SEP-2133, a server can support an extension your client doesn&#x27;t know about, or vice versa; check the negotiated <code>extensions</code> capability map rather than assuming a feature is available because the spec version matches.</li><li><strong>Re-verify your gateway&#x27;s inbound auth separately from the spec bump.</strong> The authorization hardening changes the *specification&#x27;s* alignment with OAuth 2.0/OIDC; it does not automatically change how your specific gateway validates inbound credentials, so upgrading the protocol version is not itself an auth upgrade.</li></ul>"},{"heading":"Failure modes","html":"<ul><li>Assuming statelessness before your stack supports it: removing sticky routing while a client or server library still relies on the old session-handshake header silently breaks multi-call sessions.</li><li>Conflating &quot;stateless protocol&quot; with &quot;stateless tools&quot;: the protocol no longer requires server affinity to route a call correctly, but a tool implementation behind the gateway can still hold state (a database connection, a cache) — that&#x27;s an application-level design choice, not something the spec decides for you.</li><li>Treating the authorization SEPs as a credential-mechanism upgrade: they align the spec with OAuth 2.0/OIDC conventions, but your gateway&#x27;s actual inbound auth check doesn&#x27;t change unless you change it.</li><li>Skipping the extension negotiation check: assuming a peer supports an extension because both sides report the same core protocol version, when SEP-2133 extensions are negotiated independently of core version.</li></ul>"},{"heading":"Related","html":"<p>See <a href=\"/topic/mcp\">MCP</a> for the protocol&#x27;s broader adoption arc and <a href=\"/topic/tool-use\">tool use</a> for the wider set of agent tool-calling failure modes this scaling change doesn&#x27;t address.</p>"}],"evidence":[{"id":"aws-agentcore-mcp-2026-07-28-spec","kind":"story","tier":"source story","title":"How AgentCore Gateway supports the MCP 2026-07-28 spec","note":"Describes the spec's three changes: elimination of the session-handshake, an `Mcp-Session-Id` header that previously pinned clients to a server instance; requests now carry protocol version and client capabilities inside a self-contained `_meta` parameter instead; a governed extensions system (SEP-2133) giving each new capability a reverse-DNS identifier, its own repository, and independent release cadence instead of forcing core spec version bumps; and six SEPs hardening the authorization spec toward closer OAuth 2.0/OpenID Connect alignment, while existing gateway-level credential mechanisms (IAM/SigV4, OAuth/JWT) are unaffected.","sid":"b734d716b0d66f96"},{"id":"gateway-mcp-storyline","kind":"storyline","tier":"storyline","title":"Gateway MCP","note":"Tracks the spec revision landing, AWS Bedrock AgentCore Gateway shipping support for it via a single API call, and Azure API Management shipping a dedicated AI Gateway tier fronting multiple model providers behind one MCP-aware control plane within days of the spec change.","slug":"gateway-mcp"},{"id":"mcp-statelessness-editorial-synthesis","kind":"editorial-inference","tier":"editorial inference","title":"LLM Digest synthesis","note":"The scaling implication is the same one HTTP's statelessness solved decades ago: a stateful protocol requires session affinity (sticky routing to the instance holding the session) or a shared session store, both of which complicate load balancing and turn losing one instance into a dropped session; a stateless protocol lets any instance serve any request because the request carries what it needs, which is what let AWS ship spec support as a config change on an existing gateway rather than a re-architecture."}],"related_topics":[{"slug":"mcp","title":"Model Context Protocol: a standard interface for agent tools"},{"slug":"tool-use","title":"Agents reach the outside world through fragile, ad-hoc integrations"}],"related_playbook_cards":[],"related_storylines":[{"slug":"gateway-mcp","label":"Gateway MCP"}],"covers_evidence":["aws-agentcore-mcp-2026-07-28-spec","gateway-mcp-storyline","mcp-statelessness-editorial-synthesis"]},"prompt-reliability":{"slug":"prompt-reliability","title":"What makes a prompt reliable?","question":"What makes a prompt reliable?","summary":"Reliable prompts reduce ambiguity, constrain outputs, and make failures measurable.","status":"active","cluster":"prompting","cluster_label":"Prompting and instruction following","updated":"2026-07-02","audience":"strong-software-engineer","math_depth":"intuition","sections":[{"heading":"Builder consequence","html":"<p>Reliable prompts are interfaces, not prose. If an agent step matters, write the prompt like a contract: define the role of the step, the available inputs, the required output shape, the decision rules, and the failure behavior you will test.</p>"},{"heading":"Short answer","html":"<p>A good prompt reduces ambiguity in the model&#x27;s continuation while preserving the information needed to solve the task. Instructions set the goal, examples show the local pattern, schemas constrain the output channel, and evals tell you whether the contract survives model, context, and data changes.</p>"},{"heading":"Builder model","html":"<p>Treat every important prompt as a small API. The input is the context you pass in, the implementation is the model&#x27;s learned distribution, and the output contract is what downstream code or humans consume. Reliability improves when the prompt makes the desired continuation easier than nearby wrong continuations, then verifies that behavior with representative cases.</p>"},{"heading":"Mechanism","html":"<p>An autoregressive language model predicts the next token conditioned on the tokens before it. A prompt is therefore not just an instruction; it is the conditioning environment for all later tokens. Clear task framing, examples, delimiters, and output schemas change which continuations are likely.</p>\n<p>Four techniques work for the same underlying reason — they narrow which continuations the model finds likely:</p>\n<ul><li><strong>Few-shot examples</strong> place a pattern directly in context.</li><li><strong>Chain-of-thought examples</strong> demonstrate an intermediate representation before the final answer, which helps on multi-step problems.</li><li><strong>Self-consistency</strong> helps when the model can reach the same answer through multiple sampled paths.</li><li><strong>Long context is not automatically reliable context</strong> — relevant information can be harder to use when it is buried in the middle.</li></ul>"},{"heading":"Math intuition","html":"<p>Think of the model as assigning probability mass across possible next-token paths. A vague prompt spreads mass across many plausible completions: explanation, refusal, partial answer, wrong format, hidden assumption. A reliable prompt concentrates mass around the acceptable region.</p>\n<p>Examples act like local coordinates: they show the model what kind of mapping you want. A schema narrows the output subspace. Delimiters reduce accidental mixing between instructions, retrieved text, and user data. Evals estimate whether the probability mass stays in the right region across the cases you actually care about.</p>"},{"heading":"Evidence","html":"<ul><li>Theory/paper-backed: &quot;Language Models are Few-Shot Learners&quot; shows that large language models can adapt to new tasks from instructions and examples placed directly in context.</li><li>Benchmark/result-backed: chain-of-thought prompting and self-consistency report improvements on reasoning benchmarks when prompts demonstrate intermediate reasoning or sample multiple reasoning paths.</li><li>Benchmark/result-backed: &quot;Lost in the Middle&quot; shows that adding more context can reduce reliability when the relevant evidence is positioned poorly.</li><li>Editorial inference: for production agents, these findings imply that prompt quality is inseparable from interface design and evaluation.</li></ul>"},{"heading":"How to apply","html":"<p>Write the prompt contract before polishing wording:</p>\n<ul><li>Specify the task, the input fields, what the model must ignore, the output schema, and what to do when evidence is missing.</li><li>Put volatile or untrusted content behind clear delimiters.</li><li>Keep decisive instructions close to the work they govern, especially when the context is long.</li></ul>\n<p>For agent systems, pair the prompt with a small eval set that includes clean successes, missing-information cases, adversarial or irrelevant context, and format-stability checks. Change one prompt dimension at a time, then compare outputs against the contract. If downstream code parses the answer, schema adherence is part of correctness, not formatting polish.</p>"},{"heading":"Failure modes","html":"<ul><li>Prompt-tip copying: borrowing a clever phrase without testing whether it changes behavior on your task.</li><li>Context stuffing: adding more retrieved text until the decisive evidence is harder to find.</li><li>Hidden contracts: expecting JSON, citations, or tool arguments without making those constraints explicit.</li><li>No negative cases: testing only easy examples, so the prompt looks reliable until the first ambiguous production input.</li><li>Security confusion: relying on prompt wording to control untrusted instructions instead of using sandboxing, permissions, and output validation.</li></ul>"},{"heading":"Related","html":"<p>Use <a href=\"/topic/agent-evaluation\">agent evaluation</a> to test whether prompt changes helped, <a href=\"/topic/context-compaction\">context compaction</a> to keep the working set usable, and <a href=\"/topic/prompt-injection\">prompt injection</a> when the prompt includes untrusted text or tool output.</p>"}],"evidence":[{"id":"brown-2020-language-models","kind":"theory-paper","tier":"theory/paper-backed","title":"Language Models are Few-Shot Learners","note":"Shows that task behavior can be specified through instructions and examples in context, without gradient updates.","url":"https://arxiv.org/abs/2005.14165"},{"id":"wei-2022-chain-of-thought","kind":"benchmark-result","tier":"benchmark/result-backed","title":"Chain-of-Thought Prompting Elicits Reasoning in Large Language Models","note":"Reports that exemplars with intermediate reasoning improve performance on arithmetic, commonsense, and symbolic reasoning tasks.","url":"https://arxiv.org/abs/2201.11903"},{"id":"wang-2022-self-consistency","kind":"benchmark-result","tier":"benchmark/result-backed","title":"Self-Consistency Improves Chain of Thought Reasoning in Language Models","note":"Shows that sampling multiple reasoning paths and selecting a consistent answer can improve reasoning benchmark accuracy.","url":"https://arxiv.org/abs/2203.11171"},{"id":"liu-2023-lost-in-the-middle","kind":"benchmark-result","tier":"benchmark/result-backed","title":"Lost in the Middle: How Language Models Use Long Contexts","note":"Finds that long-context models can perform worse when relevant information appears in the middle of the context.","url":"https://arxiv.org/abs/2307.03172"},{"id":"prompt-reliability-editorial-synthesis","kind":"editorial-inference","tier":"editorial inference","title":"LLM Digest synthesis","note":"For agent builders, prompt reliability should be treated as an interface and evaluation problem, not a copywriting problem."}],"related_topics":[{"slug":"agent-evaluation","title":"Measuring whether an agent actually worked is hard"},{"slug":"context-compaction","title":"Context compaction: summarize, compress, and curate the working set"},{"slug":"prompt-injection","title":"Untrusted input and tools can hijack an agent"}],"related_playbook_cards":[],"related_storylines":[],"covers_evidence":["brown-2020-language-models","wei-2022-chain-of-thought","wang-2022-self-consistency","liu-2023-lost-in-the-middle","prompt-reliability-editorial-synthesis"]},"rag-retrieval-scaling":{"slug":"rag-retrieval-scaling","title":"Why does RAG accuracy degrade as the knowledge base grows, and what fixes it?","question":"Why does RAG accuracy degrade as the knowledge base grows, and what fixes it?","summary":"Naive top-k vector retrieval treats every chunk as an independent nearest-neighbor hit, so as a knowledge base grows, questions that need two or more chunks combined become steadily less likely to get everything they need in one shot — the fix is structural (graph traversal, an agentic retrieve-and-check loop, or precomputed task-specific views), not a bigger k.","status":"active","cluster":"retrieval","cluster_label":"Retrieval and grounding","updated":"2026-08-05","audience":"strong-software-engineer","math_depth":"intuition","sections":[{"heading":"Builder consequence","html":"<p>A RAG demo built on a few hundred documents can look solid, then quietly get worse every month as the knowledge base grows — not because the model got dumber, but because the retrieval step was never the part that scales. If your production RAG&#x27;s misses cluster on questions that need two or more facts stitched together, that&#x27;s not a prompting problem or a bigger-model problem. It&#x27;s a sign that flat top-k similarity search has hit its structural ceiling, and the fix is to change what happens before generation, not to tune the generation step further.</p>"},{"heading":"Short answer","html":"<p>Naive RAG retrieves the top-k chunks by vector similarity and hands them to the generator, one independent lookup per query. As the corpus grows, the odds that every fact a question needs lands in that single top-k window shrink, especially for questions that require combining facts from multiple documents. Three structural fixes address this from different angles: graph-based retrieval (GraphRAG/KG-RAG) precomputes entity and relationship structure so a query can traverse links instead of depending on one lucky vector match; agentic RAG replaces the one-shot lookup with a loop that plans, retrieves, checks coverage, and retrieves again when it isn&#x27;t enough; task-aware compression precomputes task-specific summaries at multiple fidelity tiers ahead of query time and routes each query to the tier that already has what it needs. None of these make the underlying model retrieve better per se — they change how much structuring work happens before a similarity search ever runs.</p>"},{"heading":"Builder model","html":"<p>Think of flat vector RAG as a single independent nearest-neighbor lookup per query: it answers &quot;what&#x27;s the most similar chunk to this question,&quot; not &quot;what set of chunks, together, answers this question.&quot; A question answerable from one chunk stays reliable at any corpus size. A question that requires two or three chunks in combination becomes a search for all of them landing in the same top-k window at once — a much harder ask, and one that gets harder as the corpus grows and more distractor chunks compete for those k slots.</p>\n<p>GraphRAG replaces &quot;search once over flat chunks&quot; with &quot;traverse precomputed structure.&quot; Agentic RAG replaces &quot;search once&quot; with &quot;search, evaluate whether that&#x27;s enough, and search again if it isn&#x27;t.&quot; Task-aware compression replaces &quot;search the raw corpus at query time&quot; with &quot;search a smaller, pre-digested, task-specific index built ahead of time.&quot; They are different levers on the same problem, not competing solutions to pick exactly one of.</p>"},{"heading":"Mechanism","html":"<p>Standard RAG (Lewis et al., 2020) embeds a query, retrieves the k nearest passage vectors from an index, and conditions generation on those k passages. The retriever and generator are separate: the generator only ever sees what similarity search happened to surface, and gets no chance to ask for more.</p>\n<p><strong>GraphRAG</strong> (Edge et al., 2024) targets query-focused questions that span a whole corpus rather than one passage — &quot;what are the major themes across all these documents&quot; has no single chunk that is the answer. It builds an entity and relationship graph from the corpus offline, clusters that graph into communities, and precomputes a summary per community. A query then traverses the graph and combines relevant community summaries, rather than hoping one vector search returns a chunk that happens to contain the whole answer.</p>\n<p><strong>Agentic RAG</strong> turns retrieval from a single pass into a loop: plan what&#x27;s needed, retrieve, evaluate whether the retrieved context actually covers the question, and issue another retrieval (possibly reformulated) if it doesn&#x27;t. This directly targets the coverage problem — a single top-k pull missing one of three needed facts gets a second chance instead of silently generating from an incomplete context.</p>\n<p><strong>Task-aware compression</strong> (the AWS &quot;Beyond RAG&quot; pattern) moves structuring work to index time instead of query time: it pre-compresses the knowledge base into compact, task-specific representations at multiple fidelity tiers, caches them, and routes each incoming query to the tier that already has enough context for that task shape. It trades index-build cost and staleness risk for lower per-query retrieval cost and a ceiling that doesn&#x27;t depend on getting lucky with top-k.</p>"},{"heading":"Math intuition","html":"<p>Model a question that needs <code>m</code> distinct facts, each living in a different chunk, with a flat corpus of <code>n</code> chunks and a fixed retrieval budget of <code>k</code>. Treat each needed chunk&#x27;s odds of landing in the top-k window as roughly independent and shrinking as <code>n</code> grows relative to <code>k</code> (more chunks compete for the same k slots). The odds that *all* <code>m</code> needed chunks land in the same top-k window is then roughly the product of each chunk&#x27;s individual odds — a number that falls off multiplicatively in <code>m</code>, not additively. A question needing one fact degrades slowly as the corpus grows; a question needing three or four facts degrades much faster, because missing any single one breaks the whole answer. That is the concrete shape of &quot;RAG gets worse as the corpus grows&quot;: it isn&#x27;t a uniform decline, it&#x27;s a decline that hits multi-hop, cross-document questions hardest first — which is exactly the failure mode GraphRAG, agentic re-retrieval, and task-aware compression each independently target.</p>"},{"heading":"Evidence","html":"<p>Lewis et al. (2020) establishes the retrieve-then-generate mechanism that every variant here modifies (theory-paper). Edge et al. (2024)&#x27;s GraphRAG paper demonstrates the specific failure mode — corpus-spanning, query-focused questions — that flat top-k retrieval cannot answer, and the graph-traversal fix (theory-paper). The agentic-RAG survey traces the same naive-to-graph-to-agentic progression from a data-integration production angle, describing the retrieve-refine-reason loop as the response to persistent accuracy and cost problems in enterprise deployments (story). The AWS task-aware compression post reports the same ceiling from a different production context — analytical tasks spanning hundreds of documents — and describes an implemented pre-compression-and-routing fix (story). No single source in this set claims one fix supersedes the others; treat them as evidence for three separate, compatible levers on the same underlying problem (editorial inference).</p>"},{"heading":"How to apply","html":"<p>Before reaching for any fix, characterize your retrieval failures: pull the queries your RAG system gets wrong and check whether they cluster on questions needing one fact (rare miss, probably a chunking or embedding-quality issue) versus questions needing several facts combined (structural coverage problem, the one this page addresses). Don&#x27;t respond to the second pattern by just raising <code>k</code> — that adds distractor chunks competing for the generator&#x27;s attention without improving the odds that the *right* combination of chunks all land together.</p>\n<p>If failures cluster on corpus-wide or cross-document questions, evaluate GraphRAG-style precomputed structure first — it&#x27;s the most direct match for &quot;no single chunk contains the answer.&quot; If failures look more like &quot;the first retrieval pass just wasn&#x27;t enough and a second, reformulated query would have caught it,&quot; an agentic retrieve-and-check loop is the better-targeted fix, but budget for its added latency and cost per query since it can issue multiple retrieval rounds. If the real pain is retrieval cost or latency at scale rather than coverage, task-aware pre-compression is the lever — it moves cost from query time to index-build time, which only pays off if your task shapes are stable enough to precompute for.</p>\n<p>Reach for fine-tuning instead of any of these only when the query distribution is narrow and repeated enough that maintaining a retrieval index costs more than baking the knowledge into weights — and even then, keep an eval that separately measures multi-hop coverage, because fine-tuning doesn&#x27;t fix a structural retrieval gap either.</p>"},{"heading":"Failure modes","html":"<p>Raising <code>k</code> without restructuring adds noise, not coverage — more competing chunks in the context window, no better odds the needed combination is among them, and a real risk of pushing genuinely relevant chunks out of the generator&#x27;s effective attention. A knowledge graph built once and never refreshed goes stale exactly where GraphRAG&#x27;s advantage matters most: entities and relationships that changed since the last build silently misdirect traversal instead of failing loudly. An agentic retrieve-and-check loop with no stop condition or coverage eval can spiral into unbounded extra retrieval rounds, trading an unpredictable and easy-to-miss cost and latency tax for marginal coverage gains. Task-aware compression tiers cached without an invalidation path serve stale pre-digested summaries once the source documents change, which is worse than a plain cache miss because the system reports high confidence in an outdated answer instead of falling back to fresh retrieval.</p>"},{"heading":"Related","html":"<p>See <code>/topic/vector-kb</code> for the retrieval-mechanism baseline (vector vs. graph indexes) and <code>/topic/grounding</code> for why an agent&#x27;s answer is only as trustworthy as what it retrieved and can prove it retrieved.</p>"}],"evidence":[{"id":"lewis-2020-rag","kind":"theory-paper","tier":"theory/paper-backed","title":"Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks","note":"Introduces the RAG mechanism this whole space builds on: a dense retriever fetches the top-k passages by vector similarity, and the generator conditions on them. Retrieval and generation are separate stages — the generator can only use what similarity search happened to surface.","url":"https://arxiv.org/abs/2005.11401"},{"id":"edge-2024-graphrag","kind":"theory-paper","tier":"theory/paper-backed","title":"From Local to Global: A Graph RAG Approach to Query-Focused Summarization","note":"Shows flat top-k retrieval fails on questions that require connecting facts spread across many documents (query-focused summarization over a whole corpus). Builds an entity/relationship graph and community summaries ahead of time so a query traverses structure instead of relying on any single chunk's vector coming back as the top hit.","url":"https://arxiv.org/abs/2404.16130"},{"id":"story-355c8cf2c3a4e36a-agentic-rag-survey","kind":"story","tier":"source story","title":"Towards Trustworthy and Cost-Efficient Data Integration: From Naïve RAG to Agentic RAG","note":"Traces the same progression from a production angle: naive RAG to GraphRAG/KG-RAG to Agentic RAG, where a multi-agent loop adaptively plans, retrieves, refines, and re-reasons instead of taking one retrieval pass as final.","sid":"355c8cf2c3a4e36a"},{"id":"story-46be0149e39dc713-aws-takc","kind":"story","tier":"source story","title":"Beyond RAG: Task-aware knowledge compression for enterprise AI on AWS","note":"Reports that flat RAG hits a ceiling on analytical tasks spanning hundreds of documents, and describes pre-compressing a knowledge base into task-specific representations at multiple fidelity tiers, then routing each query to the tier with enough context — moving structuring work to index time instead of query time.","sid":"46be0149e39dc713"},{"id":"rag-scaling-editorial-synthesis","kind":"editorial-inference","tier":"editorial inference","title":"One fix does not cover every degradation mode","note":"Editorial synthesis: graph structure, an agentic retrieve-and-check loop, and task-aware pre-compression are not interchangeable fixes for the same failure. They target different symptoms — missing cross-document links, under-coverage on complex questions, and per-query compute cost — and a system can need more than one at once."}],"related_topics":[{"slug":"vector-kb","title":"External knowledge base: vector and graph retrieval"},{"slug":"grounding","title":"An agent's answer is only as good as what it retrieved — and whether it can prove it"}],"related_playbook_cards":[],"related_storylines":[],"covers_evidence":["lewis-2020-rag","edge-2024-graphrag","story-355c8cf2c3a4e36a-agentic-rag-survey","story-46be0149e39dc713-aws-takc","rag-scaling-editorial-synthesis"]},"speculative-decoding":{"slug":"speculative-decoding","title":"How does speculative decoding speed up LLM inference?","question":"How does speculative decoding speed up LLM inference?","summary":"Speculative decoding drafts several tokens cheaply, then verifies them in one parallel pass through the target model — cutting decode latency without changing the output distribution, as long as the draft's guesses are good enough to pay for themselves.","status":"active","cluster":"operations","cluster_label":"Cost, latency, and operations","updated":"2026-07-15","audience":"strong-software-engineer","math_depth":"intuition","sections":[{"heading":"Builder consequence","html":"<p>Decode dominates an agent&#x27;s wall-clock, and by default it is strictly sequential: one token in, one full forward pass, one token out, repeated for every token of every turn. Speculative decoding is the one latency lever that cuts that sequential cost without touching model weights, retraining anything end-to-end, or trading away answer quality — which makes it worth understanding as a mechanism you can reason about, not just a serving flag you flip and hope.</p>"},{"heading":"Short answer","html":"<p>A cheap draft process proposes several tokens ahead of where the target model has actually decoded. The target model then checks all of those guesses in a single forward pass instead of one at a time. Tokens the target model would have produced anyway are accepted for free; the first guess it disagrees with is thrown out and resampled correctly from there. The accept/reject math guarantees the final output has exactly the same distribution as running the target model alone — the speedup comes from turning a sequential dependency into a parallel check, not from approximating the model.</p>"},{"heading":"Builder model","html":"<p>Decode at typical serving batch sizes is memory-bandwidth-bound, not compute-bound: most of a decode step is spent streaming model weights through the GPU, with FLOPs to spare. Speculative decoding spends that spare compute. Verifying several draft tokens in one forward pass costs about the same wall-clock as producing a single token normally, because the bottleneck — memory traffic — barely grows while the extra parallel compute is nearly free, right up until the batch gets large enough to saturate the chip.</p>"},{"heading":"Mechanism","html":"<p>One decode cycle has three steps:</p>\n<ul><li><strong>Draft.</strong> A cheap process — a much smaller separate model, or a lightweight head trained alongside the target model — autoregressively proposes several candidate tokens ahead of the current position.</li><li><strong>Verify.</strong> The target model runs a single forward pass over the drafted tokens together, producing next-token probabilities at every position at once. This is what the parallelism buys: a transformer&#x27;s forward pass is inherently parallel across positions — only its own token-by-token *sampling* was ever sequential.</li><li><strong>Accept or reject.</strong> Walk the candidates left to right. Accept a draft token with probability <code>min(1, p_target(x) / q_draft(x))</code>. At the first token the check fails, discard every draft token after it and resample that position from the corrected residual distribution, then start the next draft cycle from there.</li></ul>\n<p>The engineering advances that made this a serving default (EAGLE and its EAGLE-3 successor, used in production per the vLLM/AMD write-up below) are almost entirely in the draft step: instead of an independently trained small model, they train a lightweight head to predict the target model&#x27;s own next hidden-state features autoregressively. Because the draft is derived from the target&#x27;s own internal state rather than a separately trained approximation, its guesses correlate far more with what the target model would actually choose, which is what raises the acceptance rate high enough to pay for the extra verify pass.</p>"},{"heading":"Math intuition","html":"<p>The correctness argument is a modified rejection sampling scheme. For a draft distribution <code>q</code> and target distribution <code>p</code>, accept a drafted token <code>x</code> with probability <code>min(1, p(x)/q(x))</code>. If rejected, resample from the residual distribution <code>max(0, p(x) - q(x))</code>, renormalized. Summing the accept branch and the reject-then-resample branch over all possible tokens reproduces <code>p(x)</code> exactly, regardless of what <code>q</code> is — the draft can be a bad guesser and the math still holds, it just accepts less often. The draft is *free information*, never *different information*: a bad draft costs you speed, not correctness.</p>\n<p>The speed argument follows from the memory-bound builder model above. If one decode step costs time <code>T</code> largely independent of small compute increases, then verifying <code>k</code> draft tokens in one step still costs roughly <code>T</code>, not <code>k · T</code>. Accepting an average of <code>α · k</code> tokens per verify step (<code>α</code> = acceptance rate) turns <code>α · k</code> sequential steps into one, so the achievable speedup tracks <code>1 + α · k</code> — until batch size grows enough that the GPU becomes compute-bound and the &quot;<code>T</code> regardless of <code>k</code>&quot; assumption stops holding.</p>"},{"heading":"Evidence","html":"<ul><li>Theory/paper-backed: Leviathan et al. and Chen et al. independently introduced speculative decoding and speculative sampling, each proving the accept/reject scheme reproduces the target model&#x27;s exact output distribution.</li><li>Theory/paper-backed: EAGLE reframes the draft step as predicting the target model&#x27;s own hidden-state features instead of relying on a separately trained small model, which is the mechanism that made acceptance rates high enough for production use.</li><li>Story: vLLM&#x27;s EAGLE-3 write-up on AMD Instinct GPUs reports 2.00x throughput for Kimi-K2.5 and 1.79x for MiniMax-M2.5 in a real serving stack — evidence the pattern now ships across accelerator vendors, not one.</li><li>Story: Modal and Decagon&#x27;s production write-up frames speculative decoding as a draft/target tuning problem specific to the workload, not a universal default.</li><li>Story: NVIDIA&#x27;s DFlash report of up to ~15x on Blackwell shows the ceiling once the draft/verify pair is co-designed with the accelerator, in contrast to the roughly 1.8-2x figures above from a less specialized software/hardware pairing.</li></ul>"},{"heading":"How to apply","html":"<ul><li>Measure acceptance rate on your own traffic before trusting any vendor&#x27;s throughput multiplier. Low-entropy, structured output — code, JSON, repetitive tool-call arguments — accepts at much higher rates than open-ended creative text, so the same technique can be a large win for one agent and a marginal one for another.</li><li>Prefer a feature-level draft head trained alongside the target model (the EAGLE approach) over an off-the-shelf small model as the draft; acceptance rate is the entire economics of the technique.</li><li>Benchmark end-to-end latency and cost per token at your real concurrency, not tokens/sec at one batch size — the win shrinks as concurrency rises and the GPU shifts from memory-bound to compute-bound.</li><li>Treat vendor multipliers (2x, 15x) as workload- and hardware-specific ceilings, not a number you inherit automatically; validate against your own agent&#x27;s decode traffic.</li><li>Because the technique is lossless by construction, it is safe to roll out broadly once tuned — there is no accuracy eval cycle to run, only a latency/cost one.</li></ul>"},{"heading":"Failure modes","html":"<ul><li><strong>Assuming the speedup is free at any batch size.</strong> At high concurrency, the extra verify compute competes for the same GPU cycles the batch already needs; the benefit shrinks or disappears once decode is compute-bound rather than memory-bound.</li><li><strong>Mismatched draft and target.</strong> Swapping in an unrelated small model, or reusing a draft head trained against a different target checkpoint, tanks the acceptance rate and can make decode slower than not speculating at all, since you still pay the draft cost with little payoff.</li><li><strong>Treating headline multipliers as guaranteed.</strong> A hardware-co-designed benchmark number reflects a specific model, batch size, and accelerator; a different production workload will see a different number, often much smaller.</li><li><strong>Believing it changes output quality.</strong> Implemented correctly, speculative decoding is lossless by construction. If you observe a quality change after enabling it, the bug is in the accept/reject implementation, not an inherent trade-off of the technique.</li></ul>"},{"heading":"Related","html":"<p>See <a href=\"/topic/speculative-decoding\">speculative decoding</a> for current vendor and hardware coverage, and <a href=\"/topic/agent-latency\">agent latency</a> for why the strictly sequential decode loop this technique attacks dominates an agent&#x27;s wall-clock in the first place.</p>"}],"evidence":[{"id":"leviathan-2023-speculative-decoding","kind":"theory-paper","tier":"theory/paper-backed","title":"Fast Inference from Transformers via Speculative Decoding","note":"Introduces speculative decoding and proves the accept/reject scheme reproduces the target model's output distribution exactly.","url":"https://arxiv.org/abs/2211.17192"},{"id":"chen-2023-speculative-sampling","kind":"theory-paper","tier":"theory/paper-backed","title":"Accelerating Large Language Model Decoding with Speculative Sampling","note":"Independently formalizes speculative sampling with the same modified-rejection-sampling correctness argument.","url":"https://arxiv.org/abs/2302.01318"},{"id":"li-2024-eagle","kind":"theory-paper","tier":"theory/paper-backed","title":"EAGLE: Speculative Sampling Requires Rethinking Feature Uncertainty","note":"Drafts from the target model's own hidden-state features instead of an independent small model, raising acceptance rate enough to make speculation a practical serving default.","url":"https://arxiv.org/abs/2401.15077"},{"id":"vllm-eagle3-amd-instinct-2026","kind":"story","tier":"source story","title":"EAGLE-3 Speculative Decoding on AMD Instinct GPUs: Training and Serving with vLLM and AMD Quark","note":"Reports 2.00x throughput on Kimi-K2.5 and 1.79x on MiniMax-M2.5 in a real vLLM serving stack on AMD Instinct GPUs.","sid":"f0c08e4beff850db"},{"id":"modal-decagon-specdec-2026","kind":"story","tier":"source story","title":"Achieve state-of-the-art inference latencies with speculative decoding","note":"Documents speculative decoding as a workload-specific draft/target tuning problem in a real production deployment, not a flip-a-switch default.","sid":"62173e9d865bdec2"},{"id":"nvidia-dflash-blackwell-2026","kind":"story","tier":"source story","title":"Boost Inference Performance up to 15x on NVIDIA Blackwell Using DFlash Speculative Decoding - NVIDIA Developer","note":"Shows how large a headline multiplier gets once the draft/verify pair is co-designed with the accelerator — a ceiling number, not a typical one.","sid":"99bd515fd5fd8083"}],"related_topics":[{"slug":"speculative-decoding","title":"Speculative decoding: draft cheaply, verify in parallel"},{"slug":"agent-latency","title":"Agent loops multiply per-call latency into slow, expensive runs"},{"slug":"agent-cost","title":"Agent token costs are unpredictable and easily run away"}],"related_playbook_cards":[],"related_storylines":[],"covers_evidence":["leviathan-2023-speculative-decoding","chen-2023-speculative-sampling","li-2024-eagle","vllm-eagle3-amd-instinct-2026","modal-decagon-specdec-2026","nvidia-dflash-blackwell-2026"]},"structured-output-tool-suppression":{"slug":"structured-output-tool-suppression","title":"Why does forcing structured output make my agent stop calling tools?","question":"Why does forcing structured output make my agent stop calling tools?","summary":"Turning on JSON Schema constraints and tool calling at the same time can silently suppress tool calls in open-weight models — the schema is compiled into a token mask that makes tool-call tokens unreachable during decoding, and it passes any test that checks the two capabilities separately.","status":"active","cluster":"tool-use","cluster_label":"Tool use and agents","updated":"2026-07-03","audience":"strong-software-engineer","math_depth":"","sections":[{"heading":"Builder consequence","html":"<p>If your agent both calls tools and is forced to return a response matching a JSON Schema — a common pattern once you want a fixed output contract downstream code can parse — those two constraints can interact badly. On several open-weight model families, enabling both at once causes the model to quietly stop calling tools, even though the same model calls tools fine with no schema and produces schema-valid output fine with no tools. Nothing errors. The response just stops containing tool calls, and a downstream system that only checks &quot;is this valid JSON&quot; will never notice.</p>"},{"heading":"Short answer","html":"<p>Tool Calling and JSON Schema constraints, tested independently, both work. Tested together, multiple open-weight models exhibit Tool Suppression: they keep producing schema-valid output but stop invoking tools. The cause is implementation-level, not a reasoning failure — schema constraints are compiled into a grammar that masks which tokens are legal at each decoding step, and that mask can make tool-call tokens unreachable. A training-free fix exists: decouple the two passes instead of asking one constrained decode to satisfy both.</p>"},{"heading":"Builder model","html":"<p>Treat &quot;tool calling&quot; and &quot;structured output&quot; as two constraints imposed on the same decoding process, not two independent features you can validate in separate test suites. Constrained decoding (grammar-based JSON Schema enforcement) works by restricting, at every token, which continuations are even legal — it doesn&#x27;t rank or discourage the disallowed tokens, it removes them from consideration entirely. If a tool-call token sequence isn&#x27;t part of the schema&#x27;s grammar, the model has no path to emit it, regardless of what the underlying policy would otherwise choose. This is a token-masking interaction bug hiding behind two capabilities that each look correct on their own.</p>"},{"heading":"Mechanism","html":"<p>JSON Schema enforcement is typically implemented as constrained decoding: the schema is compiled into a grammar (often a finite-state or pushdown structure), and at each decoding step the model&#x27;s next-token distribution is masked down to only the tokens that keep the output on a path the grammar allows. This is what makes structured output reliable — it&#x27;s an implementation-level guarantee, not a request the model can decide to ignore.</p>\n<p>The paper reproduces a specific interaction failure of this mechanism: when tool calling and JSON Schema constraints are active simultaneously, the compiled grammar can leave no legal path to a tool-call token, so tool-call tokens become unreachable during decoding — not merely unlikely. Evaluated independently, both capabilities test out fine: the model calls tools correctly with no schema active, and produces valid schema-conforming output with no tools active. The suppression only appears once both constraints are enforced on the same decode.</p>\n<p>The paper frames the interpretation carefully. It proposes Constraint Priority Inversion (CPI) — the idea that schema satisfaction ends up dominating action-selection when multiple constraints apply at once — as a hypothesis consistent with the observed behavior, explicitly not a verified internal mechanism. The token-masking explanation is the implementation-level finding; CPI is the paper&#x27;s best behavioral account of why it happens that way.</p>\n<p>The proposed mitigation, Transparent Two-Pass Execution, sidesteps the interaction instead of resolving it inside a single constrained decode: generate reasoning and tool calls unconstrained in the first pass, then apply the JSON Schema constraint in a second pass that formats or validates the response. Decoupling the two passes restores tool invocation while keeping the structured-output guarantee, with no retraining required.</p>"},{"heading":"Evidence","html":"<ul><li>Benchmark/result-backed: the Constraint Tax paper reproduces Tool Suppression across multiple open-weight model families and deployment settings through controlled experiments, isolates the cause to grammar-based token masking making tool-call tokens unreachable under joint constraints, and validates that Transparent Two-Pass Execution restores tool invocation without retraining.</li><li>Editorial inference: because tool calling and structured output are normally built and tested as separate features, the combination is a blind spot that a project&#x27;s existing test suite is unlikely to catch on its own.</li></ul>"},{"heading":"How to apply","html":"<ul><li><strong>Test the combination, not just the parts.</strong> Add a test case that exercises tool calling with your production JSON Schema (or response-format) constraint active at the same time, not two separate suites that each pass in isolation.</li><li><strong>Watch for silent suppression, not errors.</strong> A schema-valid response with zero tool calls where a tool call was clearly warranted is the signature to look for — it won&#x27;t throw, fail validation, or show up in a generic error rate.</li><li><strong>Don&#x27;t try to prompt your way out of it.</strong> If suppression is implementation-level (a token-masking artifact of joint constrained decoding), no amount of instructing the model to &quot;remember to use tools&quot; fixes a token it structurally cannot emit.</li><li><strong>Prefer decoupling over retraining.</strong> Try a two-pass approach — let tool selection and tool-call generation happen unconstrained, then separately enforce the output schema — before reaching for fine-tuning or dropping structured output entirely.</li><li><strong>Re-check after any model, SDK, or serving-stack upgrade.</strong> Whether constrained decoding and tool calling interact this way is an implementation detail of the serving stack, so a change to any of those components can reintroduce or change the suppression behavior even if your prompt and schema didn&#x27;t change.</li></ul>"},{"heading":"Failure modes","html":"<ul><li>Testing in isolation: validating tool calling and structured output in separate test suites, which is exactly the setup where this failure is invisible.</li><li>Silent regression: no error, no failed validation — just an agent that stops calling tools once both constraints are live, discovered only when someone notices missing tool activity downstream.</li><li>Misdiagnosing it as a reasoning problem: rewriting prompts or few-shot examples to &quot;encourage&quot; tool use when the actual blocker is that the constrained decode has no legal path to the tool-call token.</li><li>Overclaiming the mechanism: treating Constraint Priority Inversion as a proven internal cause rather than the paper&#x27;s own stated hypothesis — the token-masking finding is what&#x27;s established; CPI is the interpretation.</li><li>Reaching for retraining first: fine-tuning to &quot;fix&quot; a decoding-time constraint interaction that a training-free two-pass decoupling can resolve at inference time.</li></ul>"},{"heading":"Related","html":"<p>See <a href=\"/topic/tool-use\">tool use</a> for the broader set of failure modes in connecting agents to real tools, <a href=\"/topic/mcp\">MCP</a> for how tool interfaces are standardized, and <a href=\"/topic/agent-evaluation\">agent evaluation</a> for why joint-capability tests like this one need to be part of an agent&#x27;s eval suite, not just its unit tests.</p>"}],"evidence":[{"id":"constrainttax-2026-tool-suppression","kind":"benchmark-result","tier":"benchmark/result-backed","title":"Constraint Tax in Open-Weight LLMs: An Empirical Study of Tool Calling Suppression Under Structured Output Constraints","note":"Reports a reproducible phenomenon: when Tool Calling and JSON Schema constraints are enabled simultaneously, multiple open-weight model families stop invoking tools despite maintaining high schema compliance, while tool execution and schema compliance both work fine when tested independently. Traces the cause to JSON Schema constraints being compiled into grammar-based token masks that make tool-call tokens unreachable during decoding, proposes this as the Constraint Priority Inversion (CPI) hypothesis (explicitly framed as a behavioral hypothesis, not a verified internal mechanism), and shows a training-free Transparent Two-Pass Execution strategy — generate tool calls unconstrained, then separately enforce the schema on the response — restores tool invocation without retraining.","url":"http://arxiv.org/abs/2606.25605v1"},{"id":"structured-output-tool-suppression-editorial-synthesis","kind":"editorial-inference","tier":"editorial inference","title":"LLM Digest synthesis","note":"For agent builders, tool calling and structured output are usually validated as separate features; this finding means the combination needs its own explicit test, because a model can pass both checks in isolation and still go silent on tools the moment both constraints are active together."}],"related_topics":[{"slug":"tool-use","title":"Agents reach the outside world through fragile, ad-hoc integrations"},{"slug":"mcp","title":"Model Context Protocol: a standard interface for agent tools"},{"slug":"agent-evaluation","title":"Measuring whether an agent actually worked is hard"}],"related_playbook_cards":[],"related_storylines":[],"covers_evidence":["constrainttax-2026-tool-suppression","structured-output-tool-suppression-editorial-synthesis"]}}}