Gemini API adds mid-conversation system instructions and tool changes, in preview
Google says developers can now update system instructions or tools partway through a conversation in the Gemini API's Interactions API while keeping the prompt cache intact. The feature is in public preview.

Google announced on 3 December 2026 that "mid-conversation system instruction and tool changes are available in preview in the Gemini API through the Interactions API". The post, on Google's blog, is by Trey Nguyen, Product Manager for the Gemini API, and Daniel Kyme, Product Manager at Google Cloud. The Gemini API release notes carry a matching entry the same day, headed "Mid-conversation system instructions (Public Preview)".
What changed
Google's post sets out the problem it is addressing: "Until now, you couldn't give the model a new system instruction or update tools without invalidating the cache."
It describes two workarounds developers have relied on:
- Putting new instructions in a user message. This keeps the cache, but Google says such messages "don't carry the same weight as your top-level system instructions and allow users to try and imitate them".
- Rewriting the system instruction or tools. Google says this "invalidates the prompt cache. The model reprocesses the entire conversation history, adding cost and latency."
The new option is to "send a system_input step at any turn with system instruction or tool changes." According to Google, that step "carries the same authority as your top-level system instruction and takes precedence over user messages, while earlier turns stay cached."
How it works
Per the blog, a developer passes the previous turn's ID in previous_interaction_id and places a system_input step directly before user_input in the input array, keeping the top-level system_instruction unchanged across turns so the cached prefix stays valid. This is Google's own Python example from the post:
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)
On how instructions stack, the blog says: "Rules that cover different topics remain in effect together. When a newer system_input conflicts with an earlier instruction, the model favors the most recent instruction." Google's documentation adds that earlier instructions stay in context, so when reversing one, developers should "state what changed".
The documentation also lists rules that, if broken, return an HTTP 400 error: the step must sit directly before a user_input step; at most one per turn; not on its own or during a function-calling loop; text only in its content; and text is required unless the step adds or removes tools.
Changing tools mid-session
Because tool declarations sit at the start of the prompt, Google says changing the top-level tools list between turns breaks the cache. Instead, it recommends sending the same top-level list every turn and using added_tools and removed_tools on a system_input step. When both appear in one step, the API processes removals before additions, which Google says lets a developer replace a tool definition in place.
The documentation's limits on this part:
- Only custom function tools are supported: "MCP servers and built-in tools (like Google Search or code execution) aren't currently supported."
- The original top-level tools list, including tools later removed, must be passed on every turn in a chain; the docs say dropping a removed tool returns HTTP 400 on later turns, as does re-declaring an added tool in the top-level list.
Google also cautions that these controls "steer model behavior and serve as orchestration controls", and that "Your application should still authorize every function call on the backend before executing it and keep untrusted external or end-user content out of system_input".
What Google suggests it is for
The blog lists five uses: applying rules discovered partway through a session (such as account entitlements or spending limits); re-emphasising formatting, tone or policy rules deep into long sessions; enabling write or account-action tools after authentication and removing them again; disabling a tool when a downstream dependency goes offline; and starting with a small tool set and adding more as a task needs them.
Models, pricing and limits
- Models: the blog says the feature is in "public preview across all Gemini 4 models in the Interactions API", through the v1beta endpoint. The release notes and documentation name three models:
gemini-4-carbon,gemini-4-neonandgemini-4-hydrogen. The documentation says other models return an HTTP 400 error. - Preview status: the documentation says "The API surface may change before general availability."
- Pricing: according to the blog, the feature carries "no separate fee". Tokens in
system_inputsteps are billed at the standard input rate for the model, and earlier turns "remain eligible for cached-token rates when rules or tools change." - Where it does not work, per the docs: the
generateContentmethod does not supportsystem_input; onlymodelinteractions are supported, notagentinteractions; each step stays in context for the rest of the conversation and cannot be removed; and function-calling modes (tool_choice) apply only to the initial tools list, though the model can still call tools added mid-conversation. - Still to come: Google says "Support for Gemini Enterprise Agent Platform to come soon." It gives no date.
The primary sources are Google's blog post, the Gemini API documentation page for the feature and the 3 December release-notes entry (the ai.google.dev documentation addresses now redirect to aistudio.google.com).
Why it matters
Google's own framing is that the change "lets agents adapt to new rules and tools mid-session without re-reading the entire conversation or driving up costs." On our reading, its practical effect for developers building long-running agents is that changing rules or permissions partway through a session no longer has to mean choosing between Google's two described workarounds, a user message with less weight or a rewrite that invalidates the cache. Google's own caveats travel with it: the feature is a preview whose API surface may change, it covers three named Gemini 4 models and custom function tools only, and Google says applications should still authorise every function call on the backend.
Ask Relay — he reads every question himself and replies personally by email.
