█

AI/TLDR

Google · 2026-12-03 · major

Gemini API Mid-Conversation Instructions — change rules without losing the cache

In short

Gemini API now lets developers change system instructions and function tools in the middle of a session through a system_input step in the Interactions API. Earlier turns stay cached. Public preview on all Gemini 4 models.

Google · 2026-12-03 · 2 sources checked

Google blog hero graphic for mid-conversation instructions in the Gemini API

Gemini API agents can now get new rules or tools mid-session without breaking the prompt cache.

Quick facts

MakerGoogle
ReleasedDecember 3, 2026
StatusPublic preview
ModelsAll Gemini 4 models
APIInteractions API, v1beta
Tool supportFunction tools only, not MCP server tools
PriceNo extra fee; standard input rate

What is it?

Mid-conversation instructions let a Gemini API developer send a system_input step at any turn of an Interactions API session. The step carries the same authority as the top-level system instruction and wins over user messages. It is in public preview.

How does it work?

You keep the top-level system_instruction and tools list identical on every turn, so the cached prefix stays valid. You place a system_input step before the user_input step and pass the earlier turn's ID as previous_interaction_id. Inside that step, added_tools and removed_tools change which function tools the model may call; removals run before additions. Each step stays in the history and a newer conflicting one wins.

Why does it matter?

Before this, changing instructions either broke the prompt cache, which adds cost and latency, or was sent as a user message, which carries less authority and can be imitated by users. Long agent sessions can now react to events such as a deployment freeze or a tool going offline at the normal cached-token rate. Google warns that system_input is not a security control, so apps must still authorize every function call on the backend.

Who is it for?

developers building long-running Gemini agents

Frequently asked questions

Does Gemini mid-conversation instructions cost extra?
No. Google says Gemini mid-conversation instructions have no separate fee. Tokens inside system_input steps are billed at the standard input rate of the model you call, and earlier turns can still use cached-token rates when you change instructions or tools.
Can mid-conversation instructions in the Gemini API change MCP tools?
Not yet. The Gemini API supports added_tools and removed_tools in a system_input step for function tools only. MCP server tools are not supported. The top-level tools list must stay the same on every turn so the cache stays valid.
Is a Gemini system_input step safe for access control?
No. Google states that system_input, added_tools and removed_tools steer model behavior but are not security controls. Apps should still authorize every function call on the backend and keep untrusted or end-user content out of system_input steps.
What happens when two Gemini system_input steps conflict?
The Gemini API keeps every system_input step in the session history, and each stays active for the rest of the session. When a newer step conflicts with an earlier one, the model favors the newer instruction. Retrieving an interaction shows the steps in order for debugging.

Try it

Use client.interactions.create(...) with a system_input item in the input list (v1beta)

Sources · 2 outlets

Tags

  • gemini-api
  • interactions-api
  • system-instructions
  • prompt-caching
  • function-calling
  • agents
  • google
// NEVER MISS A RELEASEGet every AI release the moment it shipsFree Telegram channel · 1-line TLDRs · no emailJoin on Telegram

← All releases · Learn AI