Google announced support for mid-conversation instructions in the Gemini API. The change lets developers update system instructions and attached tools while a session continues. The prompt cache remains intact through these updates.
Context
Before this update, system instructions and tool definitions were set once at the start of a conversation. Any change required ending the session and starting a new one, which cleared cached prompt data. The new capability removes that restriction for developers who need to adjust behavior on the fly.
The Gemini API has supported long context windows and prompt caching for some time. These features reduce repeated processing costs when the same prefix appears across multiple turns. Until now, that efficiency came with a rigidity: the initial system prompt and tool list were fixed for the life of the cache. Developers building agents that must adapt to new rules, add capabilities, or switch between policy sets faced a choice between restarting and paying the cache-rebuild cost again or accepting that the agent could not evolve without a full reset.
Details
The feature applies directly to the Gemini API. Developers can issue updates to the system prompt and to the list of available tools at any point in an ongoing exchange. The service keeps the existing prompt cache in place, so prior context does not need to be re-sent or re-processed.
No other technical specifications, such as limits on update frequency or supported model versions, appear in the announcement. The change is presented as a straightforward addition to the existing API surface. The announcement focuses on the preservation of the prompt cache as the primary benefit, rather than on new model behaviors or expanded context lengths.
Why it matters
For teams building agents or multi-step assistants, the ability to revise instructions without losing cache state reduces both latency and token spend. Sessions that previously had to be restarted on every policy tweak or tool addition can now continue. This matters most to developers who already rely on long context windows and want to keep those windows warm across behavioral changes.
Consider a production agent that handles customer support tickets. Early in a conversation the agent may need only basic retrieval tools. Later, after the user escalates an issue, the same session may require access to billing tools or internal knowledge bases that were not relevant at the start. Previously, switching tool sets meant discarding the cached prefix that contained the entire ticket history and customer profile. Each restart incurred fresh embedding and caching costs. With mid-conversation updates, the same prefix stays resident while the tool list expands. The marginal cost of the change drops to the tokens required to transmit the new instructions and tool schemas.
The same logic applies to policy adjustments. A developer may discover that an agent is over-refusing certain requests or needs tighter guardrails after real usage data arrives. Updating the system instructions in place avoids both the engineering overhead of managing separate sessions and the user-experience cost of resetting context. Long-running research or coding agents benefit similarly: an agent can receive new coding standards or additional retrieval sources without losing the accumulated state of the current task.
The update does not alter core model capabilities. It only changes when and how often the surrounding instructions can be revised. Teams that never needed to adjust instructions mid-session will see no immediate difference in their workflows. The feature is additive; existing code that sets instructions once at the start continues to work unchanged.
Whether the change leads to more stable production agents or simply more frequent prompt experiments will depend on how developers choose to use it. The concrete effect is narrower: fewer forced session resets and lower cache-rebuild costs when instructions shift. Over time this may encourage tighter iteration loops inside long conversations rather than across separate ones. The practical outcome for most users will be measured in reduced token spend and lower observed latency on the first turn after an instruction change.
---
Sources:
No comments yet