Google adds mid-conversation instructions to the Gemini API without breaking the cache
Google's Gemini API now accepts new rules and tool changes mid-session in preview, but only function tools are supported for updates so far.
The short version
- Google says there is no separate fee for mid-conversation system instructions.
- The preview covers all Gemini 4 models through the v1beta endpoint.
- Support for Gemini Enterprise Agent Platform is to come soon.
- Only function tools can be updated this way, not MCP server tools.
- Replace in place: If one step has both tool fields, removed_tools is processed before added_tools, so a tool definition can be swapped in place.
What Google released
A support chat is under way when the customer's account goes under billing review. The Gemini API now has a preview feature in the Interactions API for exactly this kind of mid-session change, and the blog.google post introduces it.
Google's blog says mid-conversation changes to system instructions and tools are available in preview in the Gemini API. They work through the Interactions API. The goal is to let agents adapt to new rules and tools during a session without re-reading the full conversation or pushing up costs.
Agents that run for a long time often work through dozens, if not hundreds, of turns. Along the way their rules, permissions and available tools change.
Why it matters
A US developer who builds a support or operations agent gets a way to change rules or tools between turns while earlier turns stay eligible for cached-token rates. The new steps cost the standard input token rates for the model, with no separate fee.
The old workarounds
Before this feature, a new system instruction or a tool update invalidated the cache. Developers commonly relied on two workarounds.
Google's blog post says developers have commonly relied on two workarounds. One is to send new system instructions as a user message, which is meant to preserve the cache. The post says such messages do not carry the same weight as top-level system instructions, and users can try to imitate them. The other is to rewrite the system instruction or change the tools. The post says this invalidates the prompt cache, so the model reprocesses the whole conversation history, which adds cost and latency.
How system_input works
A developer passes the previous turn's ID in previous_interaction_id. Then a system_input step goes directly before user_input in the input array. The top-level system_instruction should stay unchanged across turns so the prompt prefix stays valid in the cache.
The example calls the model gemini-4-neon. First, a user asks what to check when latency spikes. Then a system_input step says a production deployment freeze is active and asks for read-only diagnostics, and the user asks for a command to deploy a new release.
Every system_input is appended to the history as a separate step. It remains active for the rest of the session, beside the top-level system_instruction. The post says it has the same authority as the top-level instruction and takes precedence over user messages. Rules about different topics all stay in effect. If a newer one conflicts with an earlier one, the model favors the latest.
Fetching an interaction with client.interactions.get lists each system_input step in order beside user_input and model_output. The post says this makes multi-turn agent traces straightforward to audit and debug. You can send one system_input step per turn, directly before user_input, holding text content, tool updates, or both.
Changing tools mid-session
The post explains that tool declarations come at the start of the prompt. Changing the top-level tools list between turns therefore breaks the cache. It recommends leaving that list identical each turn and using added_tools and removed_tools to adjust which functions the model may call.
In the post's example, a support agent begins with get_store_hours and issue_refund. On the next turn the app drops issue_refund and adds create_escalation_ticket. A text note says the account is under billing review, and the user then asks to refund order 12345. These tool changes last until a later system_input changes them again.
The post adds that a short text note alongside a removed tool gives the model context to explain why an action is unavailable. For now, added_tools and removed_tools work only for function tools, not MCP server tools.
Uses, pricing and models
Google lists several uses: rules found partway through a chat, such as spending limits; reinforcing formatting or policy rules late in long sessions; permission and mode switches; live operational changes when a downstream dependency goes offline; and large tool catalogs that grow as needed.
On price, the post says there is no separate fee for mid-conversation system instructions. Text inside system_input steps is billed like any other input, at the standard input token rates for the model you call. Earlier turns can still get cached-token rates after a change to rules or tools.
The preview covers all Gemini 4 models in the Interactions API, through the v1beta endpoint, in the Gemini API. The post says support for Gemini Enterprise Agent Platform is to come soon.
A small detail: Google points developers to the documentation, a comparison of Gemini models, and the AI Developer Forum for discussion.
Security caution
The post cautions that system_input, added_tools and removed_tools guide how the model behaves and act as orchestration controls. It says an app should still check authorization for every function call on the backend before running it. It also says to keep untrusted external or end-user content out of system_input.
The questions people ask
What it means for you
A developer running long agent sessions on Gemini 4 models has the most to look at here. The post covers rule changes, permissions and tool catalogs.
Who gains
Google says earlier turns stay cached when rules or tools change, so the model does not reprocess the full history. System steps also outrank user messages.
How solid is it
Mixed. This is Google's own description of its preview feature. The post shares code examples but no test results or measured savings.
What you can do
Try it on a Gemini 4 model in the v1beta endpoint, and keep backend checks on every function call before running it.
What to watch
- When does Gemini Enterprise Agent Platform get support?
- Will MCP server tools be added to the supported tool updates?
- How will the preview change before general release?
More stories
GeminiGoogle adds storage, wallet and Gemini app to Personal Intelligence in AI Mode
GeminiGoogle Gemini Notebook adds images and timers to flashcards
GeminiGoogle introduces Tool Retrieval to Gemini API for large tool libraries
GeminiGoogle adds grocery ordering and financial tools to Search and Gemini
GeminiGoogle adds computer use capabilities to Gemini app for Mac
Get The Daily
AI news, explained in 5 minutes a day. Free. The first issue is coming soon.
No password. Unsubscribe any time. Privacy
Say why
Liked it? Say why
Add a line for other readers.
No account needed. We never show your email. Comments with links, ads or abuse are held and not shown. Your comment shows after a quick check.
Sources
The reporting and documents this story is built from. Each link opens the original.
- ReportingGoogle: the article we sourced blog.google
Written with AI by the SI Agent News Desk from the reporting above. Every number is checked against it.Spot a mistake or a concern? Contact us · Corrections.
