Google has added Gemini mid-conversation instructions to the Gemini API, so developers can now update system instructions or tools in the middle of a conversation while keeping the prompt cache intact. Announced on 3 December 2026 by Trey Nguyen, Product Manager for the Gemini API, and Daniel Kyme, Product Manager at Google Cloud, the feature is available in preview through the Interactions API, across all Gemini 4 models via the v1beta endpoint. Support for the Gemini Enterprise Agent Platform is to come soon.
This article explains what Google announced, why long-running agents needed it, how the new system_input step works, how tool updates work, what to build with the feature, and the pricing and guardrails that apply.
What Google announced: mid-conversation instructions in the Gemini API
Mid-conversation system instruction and tool changes are available in preview in the Gemini API through the Interactions API. That lets agents adapt to new rules and tools mid-session without re-reading the entire conversation or driving up costs.
The scope is specific. It is a preview, it runs through the Interactions API, and it covers all Gemini 4 models through the v1beta endpoint. Gemini Enterprise Agent Platform support is to come soon, so teams on that platform should not assume the feature is available to them yet.
The core idea is a new step type. The Interactions API now allows developers to send a system_input step at any turn, carrying a system instruction change, a tool change, or both. It carries the same authority as the top-level system instruction and takes precedence over user messages, while earlier turns stay cached.
Why long-running agents needed this
Long-running agents work across dozens, if not hundreds, of turns. Along the way, rules, permissions and available tools change: a workspace setting is discovered, an account entitlement changes, a spending limit is reached, or a downstream service goes offline. The instructions and tools the agent started with are no longer the right ones.
Before this feature, developers relied on two workarounds, each with a drawback Google describes plainly. Putting new instructions in a user message preserved the cache, but user messages do not carry the same weight as top-level system instructions and allow users to try to imitate them. Rewriting the system instruction or changing the tools gave the new rule full weight, but invalidated the prompt cache, so the model reprocessed the entire conversation history, adding cost and latency.
Mid-conversation instructions remove that trade-off. The new step has system-level authority, and because it is appended at the current turn boundary rather than rewriting the start of the prompt, earlier turns keep their cached status.
How Gemini mid-conversation instructions work

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 the top-level system_instruction unchanged across turns so the prompt prefix stays valid in the cache. Google’s example uses the Python google-genai SDK with the v1beta API version and the model gemini-4-neon:
from google import genai
client = genai.Client(http_options={"api_version": "v1beta"})
system_instruction = "You are an infrastructure troubleshooting assistant."
turn1 = client.interactions.create(
model="gemini-4-neon",
system_instruction=system_instruction,
input="Latency just spiked on our service. What should I check first?",
)
turn2 = client.interactions.create(
model="gemini-4-neon",
previous_interaction_id=turn1.id,
system_instruction=system_instruction,
input=[
{
"type": "system_input",
"content": [
{
"type": "text",
"text": (
"A production deployment freeze is now active. "
"Recommend read-only diagnostics and do not allow further rollouts."
),
}
],
},
{
"type": "user_input",
"content": [
{
"type": "text",
"text": "Give me the command to deploy a new release.",
}
],
},
],
)
print(turn2.output_text)Here, the second turn adds a deployment freeze after the first turn has already happened. The top-level instruction is sent again unchanged, the new rule arrives immediately before the user’s request, and the model is expected to refuse the deploy and offer read-only checks instead.
Four properties matter before using the step. Each system_input appends to the conversation history as its own step and stays active for the rest of the session alongside the top-level system_instruction; it is not a one-turn override. Rules on different topics remain in effect together. When a newer system_input conflicts with an earlier instruction, the model favours the most recent instruction. And only one system_input step may be sent per turn, directly before user_input, containing text content, tool updates, or both.
The cache behaviour follows from where the step sits. Because it appends at the current turn boundary, all preceding tokens remain identical from turn to turn and reuse the prompt cache. Changing the top-level instruction instead would change the prompt prefix and break that reuse, which is why Google’s pattern keeps it unchanged.
The step is also visible on retrieval. Calling client.interactions.get with the interaction ID returns each system_input step in order alongside user_input and model_output steps. Google says that makes multi-turn agent traces straightforward to audit and debug: when an agent refuses an action mid-session, the trace shows which instruction was in force at which turn.
How mid-conversation tool updates work

Tool declarations sit at the start of the prompt, so changing the top-level tools list between turns breaks the prompt cache. The answer is parallel to the instruction pattern: leave the same top-level tools list on every turn and use added_tools and removed_tools on the system_input step to update which functions the model can call.
Google’s example is a support agent that starts with get_store_hours and issue_refund. On the next turn, the application removes issue_refund and adds create_escalation_ticket, keeping the top-level tools list identical, and pairs the change with a short text note explaining that the account is under billing review, refunds are paused, and the agent should offer to escalate:
from google import genai
client = genai.Client(http_options={"api_version": "v1beta"})
tools = [
{
"type": "function",
"name": "get_store_hours",
"description": "Look up opening hours for a store.",
"parameters": {
"type": "object",
"properties": {"store_id": {"type": "string"}},
"required": ["store_id"],
},
},
{
"type": "function",
"name": "issue_refund",
"description": "Refund an order.",
"parameters": {
"type": "object",
"properties": {"order_id": {"type": "string"}},
"required": ["order_id"],
},
},
]
turn1 = client.interactions.create(
model="gemini-4-neon",
input="Hi, I have a question about my order.",
tools=tools,
)
turn2 = client.interactions.create(
model="gemini-4-neon",
previous_interaction_id=turn1.id,
tools=tools,
input=[
{
"type": "system_input",
"content": [
{
"type": "text",
"text": (
"This account is under billing review. Explain "
"that refunds are paused and offer to escalate."
),
}
],
"removed_tools": [{"type": "function", "name": "issue_refund"}],
"added_tools": [
{
"type": "function",
"name": "create_escalation_ticket",
"description": "Escalate a billing review issue to support.",
"parameters": {
"type": "object",
"properties": {"order_id": {"type": "string"}},
"required": ["order_id"],
},
}
],
},
{
"type": "user_input",
"content": [{"type": "text", "text": "Refund order 12345."}],
},
],
)
print(turn2.output_text)Three rules govern these updates. Only updating function tools via added_tools and removed_tools is currently supported; MCP server tools are not supported for these updates, according to the announcement. Tool updates stay in effect until a later system_input changes them, so removing a tool is a persistent change to the session. And when a single step includes both fields, the API processes removed_tools before added_tools, letting a tool definition be replaced in place.
The short text note is part of the pattern. Adding it gives the model context to explain why an action is unavailable, so the user hears that refunds are paused because the account is under billing review and is offered an escalation, rather than receiving a bare refusal.
What to build with it: five practical patterns
Google lists five uses, each mapping to a situation where the right instruction or tool set is only known partway through a session.
Session-dependent constraints are the most direct use: apply rules discovered partway through a conversation, such as workspace settings, account entitlements or spending limits, as soon as they are known. The billing-review example is one instance of this pattern.
Long-horizon instruction reinforcement restates key formatting, tone or policy rules deep into a session, with system-level authority, at the point where context has grown and the original instruction may carry less weight.
Dynamic permissions and mode switches use both halves of the feature together: enable write or account-action tools after authentication or plan approval, and remove them when returning to read-only review, while the conversation continues uninterrupted.
Live operational changes cover the incident case: disable a tool and update guidance mid-session when a downstream dependency goes offline, then restore the tool once service recovers.
Large tool catalogues are the scaling case: start with a small set of tools and add more as the task needs them, without declaring every tool up front or breaking the cache.
Pricing, limits and guardrails
Pricing is stated in the announcement itself. Mid-conversation system instructions carry no separate fee. Tokens in system_input steps are billed at the standard input token rates for the model called, and earlier turns remain eligible for cached-token rates when rules or tools change. Note the careful wording: earlier turns remain eligible for cached-token rates. Eligibility is not a guarantee of a cache hit, and the announcement promises no specific saving.
The limits are the preview scope and the current tool restriction: public preview across all Gemini 4 models in the Interactions API through the v1beta endpoint, with Gemini Enterprise Agent Platform support to come soon; only function-tool updates currently supported, not MCP server tools; and only one system_input step per turn, directly before user_input. The supplied announcement evidence does not specify a general-availability date.
The guardrails matter most, because the feature changes what the model is told without changing what the application must enforce. system_input, added_tools and removed_tools steer model behaviour and serve as orchestration controls. They do not replace backend authorisation: an application should still authorise every function call on the backend before executing it, even when the tool has just been removed from the model’s available set. Removing a tool stops the model calling it in the normal course of the session; it is not a security boundary.
Applications should also keep untrusted external or end-user content out of system_input. The step carries system-level authority and takes precedence over user messages, so anything placed in it is treated as an instruction from the application. Content from untrusted sources belongs in user or tool-result content, where it can be treated as data, not in the step that sets the rules.
Getting started
For developers already using the Interactions API, Google points to the Interactions API documentation, a comparison of Gemini models to find the right Gemini 4 model for the workload, and the AI Developer Forum for discussion. The announcement’s two examples, the deployment freeze and the billing-review tool swap, show the request shape: the Python SDK, the v1beta endpoint, previous_interaction_id to continue the session, and an unchanged top-level instruction or tools list.
Before building on the feature, check the two scope questions that decide whether it fits. Is the workload on the Interactions API with a Gemini 4 model, rather than on the Gemini Enterprise Agent Platform, where support is still to come? And are the tools to be added or removed function tools, rather than MCP server tools? Treat these as initial scope checks rather than a complete eligibility test: the function-tool check applies only when the session needs to update tools, and check the supported interaction type in the official documentation before implementation.
Gemini mid-conversation instructions do not change what an agent is for. They change when its rules can change. For sessions where the right instruction is only known after the conversation has started, that timing difference is the feature: the rule arrives with system-level authority, the tools follow the session state, and the history that justifies both stays cached and auditable.












