HeyMark
Content

News Gemini API

Gemini API lets you change instructions during a conversation

2 min read
Progress bars and text boxes of different sizes appear against a white background, with a soft-color gradient along the bottom.

On December 3, 2026, Google announced an update to the Gemini API that lets developers change an agent’s system instructions and tools during a conversation without invalidating the prompt cache. The cache retains context that has already been processed, avoiding the need to process it again on every turn. Trey Nguyen, Product Manager for the Gemini API, and Daniel Kyme, Product Manager at Google Cloud, introduced the update. It is available in preview through the Interactions API. Google

Change the rules without reprocessing the history

According to Google, developers had been using two alternatives: sending new rules as user messages or rewriting the system instructions and tools. The first preserved the cache but did not give those rules the authority of a system instruction. The second invalidated the cache and required reprocessing the history, adding cost and latency. Google

The update introduces the system_input step, which preserves the authority of top-level system instructions and takes precedence over user messages. Added instructions remain active for the session; if a new instruction contradicts an earlier one, the model favors the most recent. To preserve the cache prefix, the top-level system_instruction must remain unchanged. Google

The example of a deployment pause

The published code continues an interaction using previous_interaction_id and places system_input immediately before user_input. The new instruction pauses deployments and limits the assistant to read-only diagnostics. When it later receives a request to deploy a version, that request is subject to the newly added restriction. Google

Update the available tools

To change tools without invalidating the cache, Google says to keep the top-level tools list and use added_tools and removed_tools. Its example removes the issue_refund function, which issues refunds, from a support agent and adds create_escalation_ticket, which escalates an issue. For now, these updates support function tools, not MCP server tools. Google

When an interaction is retrieved, the system_input, user_input, and model_output steps appear in order. This history makes it possible to review which instruction the agent received before each request and response. Google

Source

blog.google

Plan your next post in HeyMark.

Keep the idea, review the draft with your team, and see how it performed in the accounts you connected.