Skip to content
Tools · Dec 3, 2026

Gemini API adds mid-conversation instructions to preserve prompt cache

Developers can now update system instructions or tools mid-session without invalidating the prompt cache, reducing latency and cost for long-running agents.

Trust79
HypeLow hype

1 source · cross-referenced

ShareXLinkedInEmail
TL;DR
  • Mid-conversation system instructions and tool changes are now available in preview for the Gemini API via the Interactions API.
  • The update lets agents adapt to new rules or tools without reprocessing the entire conversation history.
  • System instructions sent mid-conversation carry the same authority as top-level instructions and take precedence over user messages.
  • Developers can audit multi-turn agent traces as each system_input step is logged alongside user and model outputs.

Google’s Gemini API now supports mid-conversation system instructions and tool changes in preview through the Interactions API. This feature enables developers to update rules, permissions, or available tools during an active session without invalidating the prompt cache.

Previously, developers had to either embed new instructions as user messages—risking user tampering—or rewrite the top-level system instruction, which would invalidate the cache and force the model to reprocess the entire conversation history. Both workarounds increased latency and cost.

With the Interactions API, developers can send a system_input step at any turn by referencing the previous interaction’s ID. This system_input carries the same authority as the top-level system instruction and takes precedence over user messages, while preserving the cached prompt prefix for earlier turns.

To implement this, developers include a system_input step directly before the user_input in the input array, keeping the top-level system_instruction unchanged. The system_input can contain text instructions, tool updates, or both, and appends to the conversation history as its own step.

When newer system_input conflicts with earlier instructions, the model prioritizes the most recent instruction. Each system_input step is logged alongside user_input and model_output, making multi-turn agent traces straightforward to audit and debug.

For example, a developer could issue a mid-conversation instruction to enforce a production deployment freeze, ensuring the model recommends only read-only diagnostics for the remainder of the session. The cache remains intact, so only the new instruction is processed, not the entire history.

Sources
  1. 01Google AI — Blog — Introducing mid-conversation instructions in the Gemini API
Also on Tools

Stories may contain errors. Dispatch is assembled with AI assistance and curated by human editors; despite the trust-score filter, mistakes happen. We correct publicly — every article links to its revision history. Nothing here is financial, legal, or medical advice. Verify before relying on any claim.

© 2026 Dispatch. No ads. No sponsorships. No paid placement. Reader-supported via Ko-fi.

Built by a person who cares about honest AI news.