Google shipped a public preview of mid-conversation instructions in the Gemini API, letting developers update system instructions and swap tools while a conversation is already underway, without invalidating the prompt cache. The feature lands through a system_input step in the Interactions API, Google's unified stateful interface for Gemini models and agent workflows.
The problem it solves is structural. Before this change, developers who tucked new rules into a user message found that those instructions carried less weight than the top-level system instruction and could even be imitated by the user text, a prompt-injection hazard in its own right. Rewriting the actual system instruction or replacing the tool list mid-session worked, but it invalidated the prompt cache, forcing the model to reprocess the entire conversation history and driving up both latency and cost on every long session.
The new step threads the needle. A system_input instruction ranks at the same level as the top-level system instruction and takes precedence over user messages, so it cannot be talked down by later user text. Everything before the update stays a cache hit, so only the new instruction and subsequent turns are processed fresh. On the tool side, developers keep the top-level tool list intact and use added_tools and removed_tools to add or drop function tools during the session, with the change persisting until the next modification.
Availability is broad. Google says the feature is in public preview across all Gemini 4 models, carries no separate charge, and tokens flowing through it are billed at standard input prices. That pricing choice matters for agent builders, whose instinct under the old regime was to avoid touching instructions mid-run precisely because of the cache-blowing cost.
The practical beneficiary is the long-running agent. Real agent sessions change state: a support agent escalates to a human-supervision mode, a research agent gains a web tool halfway through, a coding agent switches rule sets when it moves from planning to execution. Until now each of those transitions either risked diluted instructions or paid a full-history reprocessing tax. Removing that trade-off makes dynamic control a default design choice rather than an optimization someone remembers to skip.
Google is also converging with competitors on agent-runtime ergonomics. Anthropic added mid-conversation effort control to the Claude API so agents can dial reasoning spend up and down mid-task, and both vendors are pushing stateful, server-side session management. The API layer is quietly becoming the battleground where agent platforms are won, on cache economics, instruction precedence and tool governance rather than on raw model scores.
Comments (0)
Log in to join the discussion
Log InNo comments yet