The Gemini API now accepts new system instructions and tool changes mid-conversation without invalidating the prompt cache
Google's Interactions API can now change an agent's rules and tools partway through a session, and keep the cached history while doing it.
What happened
Google announced mid-conversation system instructions and tool changes for the Gemini API, available in public preview across all Gemini 4 models through the Interactions API on the v1beta endpoint. Support for Gemini Enterprise Agent Platform is listed as coming soon.
A developer passes the previous turn's ID in previous_interaction_id and places a system_input step directly before user_input. Google says it carries the same authority as the top-level system instruction and takes precedence over user messages. Each system_input stays active for the rest of the session, and when a newer one conflicts with an earlier one, the model favors the most recent. One system_input is allowed per turn, and these steps appear in order when the interaction is retrieved, which makes traces easier to audit.
For tools, Google recommends keeping the top-level tools list identical on every turn and using added_tools and removed_tools instead. Only function tools are supported this way for now, not MCP server tools. Google's example removes issue_refund from a support agent and adds create_escalation_ticket when an account goes under billing review.
The post names the two workarounds this replaces: putting new rules in a user message, which carries less weight and invites imitation, or rewriting the system prompt, which breaks the cache. Gemini's caching docs say the Interactions API and Gemini 4 use implicit caching only, at a 95% input discount, once a request has at least 4,096 input tokens.
My take
This solves a real problem in support and operations agents. Permissions change during a session all the time: a customer fails verification, an account gets flagged, a deployment freeze starts. Until now the choices were a weaker instruction or a full reprocess of a long history on every change.
The removed_tools pattern is the part I'd use first. Taking issue_refund away from the model is a stronger control than telling it not to refund, because the function is no longer callable. I'd still keep the check in the backend too, since a preview API and a model instruction shouldn't be the only thing standing between an agent and a refund.
Check your token usage metadata after switching to confirm the cache is actually being hit, and remember MCP tools aren't covered yet.
More posts
- LangSmith Engine Goals: LangChain's design agent finished every edit without errors, yet users abandoned the videos it revisedDec 4, 2026
- OpenAI says newer models are better at noticing they're being tested, and its auditors caught agents using other people's credentialsDec 4, 2026
- n8n now serves agent skills over MCP in preview, so one skill stored in n8n reaches every compatible clientDec 4, 2026
