Developers can now update system instructions or tools in the middle of a conversation while keeping the prompt cache intact, Google announced on its blog on December 3.
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.
The old workarounds
Developers previously had two bad options. They could put new instructions in a user message, which preserved the cache but gave the instruction the wrong authority, or they could change the system prompt between turns, which broke the prompt cache and forced the model to re-read everything. For agents that run dozens or hundreds of turns, that second option gets expensive fast.
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. To send one, pass the previous turn's ID in previous_interaction_id and place a system_input step directly before user_input in the input array, keeping your top-level system_instruction unchanged across turns so the prompt prefix stays valid in the cache.
Tools can change too
Tool declarations sit at the start of the prompt, so changing the top-level tools list between turns breaks the prompt cache. With system_input, Google recommends leaving the same top-level tools list on every turn and using added_tools and removed_tools to update which functions the model can call as the session evolves. Only function tools are supported for now, not MCP server tools.
Google's example is a support agent on an account under billing review: mid-session, the app removes the issue_refund tool, adds create_escalation_ticket, and tells the model that refunds are on hold. There is no separate fee for the feature, and tokens in system_input steps are billed at the standard input rate.
Google warns that system_input steers behaviour but does not enforce security: applications should still authorise every function call on the backend and keep untrusted content out of system_input.
For more on Google's AI releases, read Gemini 4 Live and Live Translate and our guide to hosting your first website free.
Frequently asked questions
How do mid-conversation instructions work in the Gemini API?
Send a system_input step at any turn, passing the previous turn's ID in previous_interaction_id and placing system_input directly before user_input. It appends to the conversation history as its own step and stays active for the rest of the session.
Why does this matter for costs?
Previously, changing instructions meant sending them as a user message or changing the system prompt, which broke the prompt cache. Because system_input appends at the current turn boundary, all preceding tokens stay identical and keep their cached pricing, which Google says is 95% cheaper on Gemini 4 models.
What can you change mid-conversation?
Text instructions and function tools, using added_tools and removed_tools. Only function tools are supported for now, not MCP server tools, and you can send one system_input step per turn.