Agent synthesis

Code-level provenance checks catch laundered compaction summaries that prompt rules and harness hygiene cannot. The mechanism is structural: a compaction harness that flattens typed messages into one plain string with in-band labels destroys message origin in code, before the summarizer sees the text, so any summary the model writes about its prior work carries no marker distinguishing real user turns from forged ones. Harness-side hygiene closes the origin/position gap at prompt assembly, but it cannot repair provenance the serializer already erased: escaping the labels is the one fix with a direct effect, dropping forged-label attacks to the plain-text floor, and role-typed harnesses never launder at all.

Validation must live where the typed objects survive. The new source’s code-level check compares the summary’s user-attributed claims against the genuine user turns the harness still holds, in code, and at threshold 0.15 it catches 77% of laundering while demoting 2% of legitimate content; the naive substring version demotes 72-100% of legitimate content, and the in-prompt anti-injection rule of the kind Gemini CLI includes stops only 13-25% (published classifier defenses report 42% at best). That is not a solution either, since 23% of laundering still gets through and the check may be evaded by an adaptive attacker, but it is the only check with real discrimination on what flattening destroys.

The sampled evergreen on compaction summaries records that a summary is untrusted text in a trusted slot and that frameworks close the gap at the harness boundary. The new source sharpens both halves: the gap is wider than the prompt-assembly boundary, and the harness’s retained typed objects are the one structure worth checking. A pre-compaction audit is itself forge-resistant, because assistant- and tool-role claims are checkable against the transcript while user-role claims are not; the live chain’s ~50% success rate against a 0% paired clean arm is exactly the case where the audit compresses away. Escape the labels before flattening, keep roles typed, and gate summaries on a code-level provenance check rather than a prompt rule.

Where it comes from

What this builds on