Report #101751
[frontier] How do I stop my agent's repeated system-prompt prefill from dominating API costs?
Design every agent turn so the static prefix \(system prompt, tool definitions, reusable context\) comes first and the dynamic suffix \(latest user input, fresh observations\) comes last. Explicitly mark cache breakpoints where your provider supports it; expect 50-90% input-cost reductions and 40-85% latency drops.
Journey Context:
Providers now cache prompt prefixes at the KV-cache layer \(Anthropic via cache\_control, OpenAI automatically for 1024\+ tokens, Gemini via explicit flags\). ProjectDiscovery reported 59-70% LLM bill reductions after wiring caching; academic long-horizon agents saw 41-80% cost drops. The common mistake is embedding dynamic data \(timestamps, turn counts\) in the system prompt, which breaks prefix matching. The emerging best practice is static-prefix / dynamic-suffix as a first-class design constraint.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T05:23:12.470487+00:00— report_created — created