
Trey Nguyen
· 1 min read
Introducing mid-conversation instructions in the Gemini API
Dec 03, 2026
|
Developers can now update system instructions or tools in the middle of a conversation while keeping the prompt cache intact.
Trey Nguyen
Product Manager, Gemini API
Daniel Kyme
Product Manager, Google Cloud
Your browser does not support the audio element.
Listen to article
[[duration]] minutes
This content is generated by Google AI. Generative AI is experimental
Today, mid-conversation system instruction and tool changes are available in preview in the Gemini API through the Interactions API. This lets agents adapt to new rules and tools mid-session without re-reading the entire conversation or driving up costs.
Long-running agents often work across dozens, if not hundreds, of turns. Along the way, rules, permissions and available tools change. Until now, you couldn't give the model a new system instruction or update tools without invalidating the cache.
Developers have commonly relied on two workarounds:
- Putting instructions in a user message: To preserve the cache, you could send new system instructions as a user message. These don’t carry the same weight as your top-level system instructions and allow users to try and imitate them.
- Rewriting system instruction or tools: Rewriting the system instruction or changing tools invalidates the prompt cache. The model reprocesses the entire conversation history, adding cost and latency.
The Interactions API now allows you to send a system_input step at any turn with system instruction or tool changes. It carries the same authority as your top-level system instruction and takes precedence over user messages, while earlier turns stay cached.
How it works
To send an instruction mid-conversation, pass the previous turn's ID in previous_interaction_id and place a system_input step directly before user_input in the input array. Keep your top-level system_instruction unchanged across turns so the prompt prefix stays valid in the cache:
Original source
This story was published by Google AI Blog and written by Trey Nguyen. SyncAI.news shows a preview; the complete article is on the publisher's site.
Read the full story on blog.google


