AI news ·
Gemini API adds mid-conversation system instruction and tool updates
Google's Gemini API now lets developers update system instructions or tools mid-conversation without breaking the prompt cache, avoiding full context reprocessing and its costs.

Google released mid-conversation system instruction and tool changes in preview for the Gemini API through its Interactions API. Developers can now update an AI agent's rules or available tools mid-session without invalidating the prompt cache, which means long-running conversations won't need to reprocess the entire history or incur higher costs.
Long-running agents often span dozens or hundreds of turns. Rules, permissions, and available tools shift along the way. Before this update, sending a new system instruction or changing tools broke the cache. Developers relied on workarounds that either weakened instruction authority or forced a full context reprocess.
How system_input works
The Interactions API now accepts a system_input step at any turn. It carries the same authority as the top-level system instruction and takes precedence over user messages. Earlier turns stay cached because the top-level system instruction remains unchanged across turns.
Each system_input appends to the conversation history as its own step and stays active for the rest of the session. When a newer system_input conflicts with an earlier instruction, the model favors the most recent one. When you retrieve an interaction, each system_input step appears in order alongside user_input and model_output, making multi-turn agent traces straightforward to audit.
Updating tools without breaking the cache
Tool declarations sit at the start of the prompt, so changing the top-level tools list between turns normally breaks the cache. Google recommends leaving the same top-level tools list on every turn and using added_tools and removed_tools within a system_input step to adjust which functions the model can call.
Tool updates stay in effect until a later system_input changes them. When a single step includes both fields, the API processes removed_tools before added_tools, letting developers replace a tool definition in place. Only function tools are currently supported for this pattern, not MCP server tools. Google emphasizes that applications should still authorize every function call on the backend before executing it and should keep untrusted external or end-user content out of system_input.
What developers can build with it
The feature opens several practical patterns for agents in production. Teams can apply session-dependent constraints discovered partway through a conversation, such as workspace settings or spending limits. They can re-emphasize formatting or policy rules deep into long sessions as context grows. Dynamic permissions become possible - enabling write or account-action tools after authentication and removing them when returning to read-only review.
Operational use cases include disabling a tool mid-session when a downstream dependency goes offline and restoring it once service recovers. Developers working with large tool catalogs can start with a small set and add more as the task requires, without declaring every tool up front or breaking the cache.
Pricing and availability
Mid-conversation system instructions carry no separate fee. Tokens in system_input steps bill at standard input token rates for the model called. Earlier turns remain eligible for cached-token rates when rules or tools change. The feature is available in public preview across all Gemini 4 models in the Interactions API through the v1beta endpoint. Support for the Gemini Enterprise Agent Platform is coming later.
Why this matters for developers and operations teams
For teams running AI agents in production support or IT workflows, this directly reduces latency and cost on long-running sessions. Instead of forcing a full context reprocess every time a permission changes or a tool goes offline, you can inject instructions at the current turn boundary and keep the cache intact. The result is faster responses for end users and lower compute bills for the same volume of conversations. For developers exploring these patterns, AI for Software Developers Courses cover practical agent design techniques that align with these API capabilities.