Gemini API can now change its own rules mid-conversation
A new Interactions API step lets you swap system instructions or tools partway through a session without blowing away the prompt cache.
Google opened public preview on a Gemini API feature that lets you update system instructions and function tools partway through a conversation, without invalidating the cache on everything that came before. It ships through the Interactions API, across all Gemini 4 models, using the v1beta endpoint.
The mechanism is a new system_input step, sent before user_input at any turn, carrying the prior turn’s ID via previous_interaction_id. Google says it “carries the same authority as your top-level system instruction and takes precedence over user messages,” while earlier turns keep their cached-token pricing. Tool changes go through added_tools and removed_tools fields on the same step, though only custom function tools are supported, not MCP server tools or built-ins like Search. There’s no separate fee: tokens in a system_input step bill at standard input rates.
Previously, rewriting a system instruction or tool list mid-session meant the model reprocessing the whole history from scratch. As Google puts it, that “adds cost and latency.”
Why it matters: long-running agents that need to adapt rules or capabilities as a task evolves, a support bot escalating to a different tool set, a coding agent gaining permissions partway through a run, can now do that without eating a full cache invalidation on every turn. That’s a real cost and latency difference for anything built on long conversations.
The caveat: it’s public preview only, and MCP server tools aren’t covered yet, so anything routing through MCP still needs the old, cache-busting approach.