Gemini agents can now take new rules and tools mid-chat without losing the cache
A new system_input step in the Interactions API lets long-running Gemini 4 agents pick up new rules and tools without paying again to reprocess the whole conversation.

Google has added mid-conversation system instructions to the Gemini API. Developers can now change an agent’s rules and available tools partway through a session while earlier turns stay in the prompt cache. The feature is in public preview on all Gemini 4 models.
The feature was announced on Google’s blog by product managers Trey Nguyen of the Gemini API and Daniel Kyme of Google Cloud. It targets long-running agents whose permissions, policies or toolsets change during a session, which can run to dozens or hundreds of turns.

A new system_input step that outranks user messages
The feature runs only through the Interactions API on the v1beta endpoint. To use it, a developer passes the ID of the previous turn in previous_interaction_id and places a system_input step right before the user_input in the request. Google says this step has the same authority as the top-level system_instruction and overrides user messages.
Each system_input is added to the history as a separate step and stays in force for the rest of the session. Instructions on different topics apply together. When a newer instruction conflicts with an older one, Google says the model favors the most recent. Developers can send one such step per turn, and it can carry text, tool changes or both.

Tool changes use two fields, added_tools and removed_tools. Google recommends keeping the top-level tools list identical on every turn, because tool declarations sit at the start of the prompt and any change there breaks the cache. If a step contains both fields, removals are applied first, so a tool can be swapped for a new version in a single step. Only function tools are supported for now. MCP server tools are not.
Google’s example is a support agent on an account under billing review. Mid-session, the app removes the issue_refund tool, adds create_escalation_ticket and tells the model that refunds are on hold. When developers retrieve an interaction with client.interactions.get, the system_input steps appear in order with user inputs and model outputs, which Google says makes agent traces easier to audit.
The feature carries no extra fee. Tokens in system_input steps are billed at the model’s standard input rate, and earlier turns still qualify for cached-token pricing. Google says support for the Gemini Enterprise Agent Platform is coming soon but gave no date.
The end of a costly workaround for agent builders
Until now, developers had two imperfect options, according to Google. They could put new rules in a user message, which kept the cache but gave the rules less weight than real system instructions and let users try to imitate them. Or they could rewrite the system prompt or tool list, which forced the model to reprocess the whole conversation and added cost and latency.
Gemini’s cache pricing shows what the second option cost. According to Google’s caching documentation, cached input tokens cost 95% less on Gemini 4 models, which use implicit caching only. A cache invalidated late in a long agent session therefore means paying roughly 20 times more for the history than a cache hit would. The same documentation says a request needs at least 4,096 input tokens to be cached, and that cache entries have a best-effort lifetime of up to 24 hours with no guarantee they are kept. Long agent sessions easily pass that threshold.
Cached input tokens cost 95% less on Gemini 4 models, so a broken cache late in an agent session is expensive.
This works because caching depends on an identical prompt prefix. As aiholics explained in its guide to prompt caching, a single change near the top of a prompt invalidates everything after it. Anthropic’s documentation, cited in that guide, says editing tool definitions invalidates the tools, system and message layers of the cache. Google’s approach avoids this by appending changes at the current turn instead of editing the start of the prompt.
The feature also fits Google’s recent push to cut token spending in the Interactions API. On November 23, Google added file slicing controls, which let developers load only specific pages, sheets or media segments. In that announcement, Vercel and LiteLLM said the controls reduced prompt tokens by as much as 14 times and 67%, respectively.
What Google leaves to developers and does not measure
Google says plainly that these controls guide the model but do not enforce security. Applications should still authorize every function call on the backend before running it and keep untrusted content out of system_input. Removing a tool from the model’s list does not stop a backend from executing it.
The announcement gives no numbers on how reliably the model follows newer instructions over older ones, or on how much a typical session saves in practice. The claim that system_input outranks user messages has not been independently tested against prompt injection. The feature is also still in preview, so its behavior and interface may change before general release.
Sign Up for the Daily AI Pulse
One email a day. All the stories that matter.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Alex CarterAI News & Big Tech CorrespondentAlex Carter writes for Aiholics, keeping readers updated on the fast-paced world of AI and Big Tech.



