Introducing mid-conversation instructions in the Gemini API
Summary of an article by Google AI blog — AI Made
Google has introduced a preview feature in the Gemini API, available through the Interactions API, that lets developers change system instructions or tools partway through a conversation without invalidating the prompt cache. Until now, such changes forced the model to reprocess the whole history, which raised costs for long-running agents that work across many turns while rules and permissions shift.
The feature works through a new step type called systeminput. A developer places it directly before the user input in a turn, and it carries the same authority as the top-level system instruction and overrides user messages. Earlier turns stay cached, and the top-level instruction should remain unchanged. Each step stays active for the rest of the session, and when two instructions conflict the model follows the newer one.
For tools, the top-level list should stay identical on every turn. Developers instead use addedtools and removedtools, with removals processed first. Only function tools are supported, not MCP server tools. Google advises that the application still authorize every function call on the backend and keep untrusted content out of systeminput.
There is no separate fee. Tokens are billed at standard input rates, and earlier turns keep cached-token pricing. The preview covers all Gemini 4 models on the v1beta endpoint.
Publishers: to have your site removed from our sources, write to info@weare1801.com.
Read the original at Google AI blog →