Zhidaily AI · Intelligence · Daily
Zhidaily
Issue 35 · December 4, 2026 · Fri
Today's stories
10 stories · 5 companies
Home / December 4, 2026 / Gemini API adds mid-conversation instructions without breaking prompt cache
← Back
Release Official Models / Agents · Google Score72

Gemini API adds mid-conversation instructions without breaking prompt cache

In brief
Google's Gemini API now lets agents change their system instructions and available tools mid-session while keeping earlier turns cached, so long-running agents can adapt without paying to reprocess th
Google Blog blog.google
Dec 4 · 02:00 Read the original ↗
01Summary

Google has added mid-conversation system instruction and tool changes to the Gemini API's Interactions API, in public preview across all Gemini 4 models via the v1beta endpoint. Developers send a system_input step before the user's message; it carries the same authority as the top-level system instruction, overrides user messages, and stays active for the rest of the session, with newer instructions winning conflicts. Tool changes use added_tools and removed_tools while the top-level tools list stays fixed, so the prompt prefix remains identical and earlier turns still qualify for cached-token rates. Only function tools are supported, not MCP server tools, and Gemini Enterprise Agent Platform support is promised but not yet available. There is no separate fee: tokens in system_input steps are billed at the model's standard input token rates. Google also warns that these fields steer behavior but do not enforce it, so applications must still authorize every function call on the backend.

02Background

Prompt caching only pays off when the start of a prompt stays byte-for-byte the same between calls. Changing the system instruction or the tool list sits at the front of the prompt, so any edit invalidated the cache and forced the model to reprocess the entire history. Developers worked around this by smuggling new rules into user messages, which the model treats with less authority and users can imitate.

03What it means for builders

Agents that run for dozens or hundreds of turns can now switch modes, revoke a tool after a refund window closes, or add tools after authentication without losing cached-token pricing on prior turns. Teams should keep their top-level system_instruction and tools list unchanged across turns and route all changes through system_input, or the cache benefit disappears. Because system_input is model input rather than an access control, backend authorization of each function call remains mandatory.