Google is making it easier for developers to build long-running AI agents with a new Gemini API capability that allows system instructions and available tools to change in the middle of a conversation without invalidating the prompt cache.
Announced on December 3, 2026, the new feature, called mid-conversation system instructions, is available in public preview through Google’s Gemini API Interactions API. It allows developers to introduce new rules, update permissions, and modify the functions an AI agent can use as a conversation progresses, without forcing Gemini to reprocess the entire conversation history.
The update addresses a practical challenge for developers building AI agents that operate across dozens or even hundreds of conversation turns. As these agents work through complex tasks, their operating rules and available capabilities may need to change depending on new information, account permissions, or changing circumstances.
Previously, modifying system instructions or changing the tools available to a model could invalidate the prompt cache. That meant the model had to process the conversation history again, potentially increasing both latency and API costs.
Google says the new approach allows developers to make these changes while keeping earlier conversation turns cached.
How Gemini API mid-conversation instructions work
The new capability introduces a system_input step that developers can insert into the conversation at any turn. This step allows an application to provide additional system-level instructions that remain active for the rest of the session.
Importantly, these instructions carry the same authority as the original top-level system instructions and take precedence over user messages.
Developers can implement the feature using the previous_interaction_id parameter to continue an existing conversation. They can then place a system_input step immediately before the next user_input step in the request.
For example, imagine an AI agent helping an infrastructure team troubleshoot a service outage. During the conversation, the team introduces a production deployment freeze. Instead of restarting the conversation or rewriting the original system instructions, the application can add a new instruction telling Gemini to recommend read-only diagnostics and avoid further deployments.
Gemini can then apply the new restriction while retaining the previous conversation context in the prompt cache.
Google also explains that additional system instructions remain active alongside the original instructions. If a newer instruction conflicts with an earlier one, the model follows the most recent instruction.
The API also records these instruction changes as individual conversation steps, making it easier for developers to inspect interaction histories, audit agent behavior, and debug multi-turn workflows.
Developers can also change available tools without resetting the cache
Beyond system instructions, the update introduces a way to modify the function tools an AI agent can access during an ongoing conversation.
Previously, changing the top-level tools list between requests could invalidate the prompt cache because tool declarations are included at the beginning of the prompt.
Google’s recommended approach is to keep the original top-level tools list unchanged and use two new fields within system_input:
added_tools: Introduces new function tools that the model can use.removed_tools: Removes existing function tools from the model’s available options.
For example, a customer support agent might initially have access to functions for checking store hours and issuing refunds. If an account enters a billing review, the application can remove the refund function and introduce a tool for creating an escalation ticket.
Gemini can then respond to refund requests by explaining that refunds are temporarily unavailable and offering to escalate the issue instead.
These tool changes remain active until another system_input step modifies them. Google also notes that when both fields are included in the same step, removed tools are processed before added tools, allowing developers to replace one function with another.
There is an important limitation: dynamic tool updates currently support function tools, not MCP server tools.
Google also cautions developers that these controls do not replace backend authorization. Applications must still independently validate every function call before executing it, and untrusted user or external content should not be placed inside system_input.
What developers can use the feature for
Google highlights several potential applications for the new capability, particularly for agents that need to adapt their behavior as circumstances change.
For example, applications can introduce session-dependent restrictions based on workspace settings, account entitlements, or spending limits. Developers can also reinforce important formatting, tone, and policy instructions deep into lengthy conversations.
Dynamic permissions are another important use case. An application could enable tools that perform account actions after a user completes authentication or receives the necessary approval, then remove those capabilities when the session returns to read-only mode.
The feature could also help agents respond to changing infrastructure conditions. If a downstream service becomes unavailable, an application can disable the related tool and provide new instructions explaining the situation. Once the service recovers, the tool can be restored.
For applications with large tool catalogs, developers can start agents with a smaller set of functions and introduce additional capabilities only when needed, rather than declaring every possible tool at the beginning of a conversation.
Availability and pricing
Google says mid-conversation system instructions are available in public preview across all Gemini 4 models through the Gemini API’s Interactions API, using the v1beta endpoint.
There is no separate fee for using mid-conversation system instructions. However, tokens included in system_input steps are billed at the standard input-token rates for the selected model.
The important cost advantage is that earlier conversation turns remain eligible for cached-token pricing even when developers introduce new instructions or change available tools.
Support for the Gemini Enterprise Agent Platform is also planned, although Google has not provided a specific availability date.
Developers can get started through the Gemini API documentation, explore the available Gemini 4 models, and join discussions in the AI Developer Forum.
For developers building increasingly sophisticated AI agents, this is a useful infrastructure improvement. Rather than treating system instructions and available tools as settings that must remain fixed throughout a conversation, Gemini can now adapt to changing requirements while preserving the benefits of prompt caching.
Discover more from GadgetBond
Subscribe to get the latest posts sent to your email.
