high

Mutable working memory lives in the system prompt

PrefixAudit rule mutable-memory-in-prefix · v0.1.0

Why it breaks your cache

Agent state that mutates between steps invalidates the prefix on nearly every step. ProjectDiscovery ran at a 7% hit rate for exactly this reason; relocating the working memory to a trailing user message took it to 84% and cut LLM cost 59%, with 9.8B tokens eventually served from cache.

How to fix it

Move scratch state, scratchpads, task lists, tool-result summaries and running memory OUT of the system block into the last user message. The system prompt should be static for the whole session.

How common is it?

Detected in 27 of 236 production system prompts (11.4%) across 16 vendors.

Estimated impact

Modelled as invalidating 0% of the cached prefix.

Is your prompt affected?

Paste it and find out. Static analysis, in-browser, nothing leaves the page.

Run the audit →

← All 14 rules