Gemini API Lets Developers Change Rules and Tools Mid-Session Without Breaking the Cache, in Preview for Gemini 4
A.I. / news
Gemini API Lets Developers Change Rules and Tools Mid-Session Without Breaking the Cache, in Preview for Gemini 4
A new system_input step in the Interactions API on v1beta bills at the normal input rate, supports function tools only, and gets one use per turn.

Google put mid-conversation instructions into public preview in the Gemini API on Dec. 3, letting developers change a session's rules and tools without breaking the prompt cache. It works through the Interactions API on the v1beta endpoint and covers all Gemini 4 models.
Google's announcement is bylined by Trey Nguyen, a Product Manager for the Gemini API, and Daniel Kyme, a Product Manager at Google Cloud. Support for Gemini Enterprise Agent Platform is planned but not available yet.

How the feature works
Before this, Google says, changing system instructions or the tool list invalidated the prompt cache, so the model reprocessed the full history. The two workarounds were to send new rules as user messages, which the post says "don't carry the same weight" as system instructions, or to rewrite the system instruction and pay the cache miss.
The new route keeps the top-level system_instruction and tools list identical across turns. A developer passes the prior turn's ID in previous_interaction_id and places a system_input step directly before user_input. Each system_input stays active for the rest of the session.
Rules on different topics stack. When two conflict, Google says "the model favors the most recent instruction." There is a cap of one system_input step per turn, holding text, tool updates, or both.
Calling client.interactions.get(id=...) returns each system_input step in order alongside the user and model steps, so a session can be audited afterward.
Tool changes and their limits
Tools change through added_tools and removed_tools fields inside a system_input step. If one step has both, removed_tools runs first, so a definition can be swapped in place. The changes persist until a later step alters them.
Only function tools are supported. Google says MCP server tools are not supported in the preview.
One example in the post starts a support agent with get_store_hours and issue_refund, then removes issue_refund and adds create_escalation_ticket for a billing review. Another adds a production deployment freeze mid-session before asking for a deploy command.
What it costs
There is no separate fee. Tokens in a system_input step bill at the standard input rate for the model in use, and earlier turns stay eligible for cached-token rates. The examples use the model gemini-4-neon.
How Anthropic's cache treats the same change
Anthropic's prompt caching documentation shows why the problem existed. Its cache is built in the order tools, then system, then messages, and "changes at each level invalidate that level and all subsequent levels."
| Change in Claude API request | Cache outcome per Anthropic |
|---|---|
| Tool definitions edited | Entire cache invalidated |
| Tool choice changed | Tools and system kept, messages invalidated |
| Images added or removed | Tools and system kept, messages invalidated |
Anthropic prices cache reads at 0.1 times the base input price by default, 0.05 times for Claude Opus 5.5 and Sonnet 5.5, and 0.025 times for Claude Fable 5.2. The default cache lifetime is 5 minutes, with a 1-hour option at extra cost.
Anthropic's page, as read, describes no step that changes tools mid-session while preserving the cache. Google's page describes no cache lifetime or read discount for Gemini, so the two sets of numbers cannot be compared directly.
Security guidance and what is untested
Google tells developers to authorize every function call on their backend before execution, and to keep untrusted end-user or external content out of system_input. The post presents no measurement of how reliably Gemini 4 obeys a later instruction over an earlier one, and the claim that it "favors the most recent" is Google's own.
Agent builders have been working at the layer that runs those calls. A University of Texas at Austin proposal for agent-written harness policies is one example, and DeepMind's Gemini 4 agents work on a fusion simulation is another use of the same model family.
The feature stays in preview on v1beta, and Google gave no date for general availability.
Sources
More in A.I.
- 01Alibaba's Qwen4-35B-A3B Ships Under Apache 2.0 With a 1M-Token WindowAlibaba's own chart has it trailing Qwen3.8-Flash-Next on FrontierCode-AA 2.0, 16.1 to 27.1, while Artificial Analysis scores it 25 and counts 175 million output tokens to get there.
- 02Claude's Inception Jailbreak Is 'Unknown' at CERT, 'Resolved' to Its FinderDavid Kuszmar writes in IEEE Spectrum that the nested-scenario prompts still work word for word, while the CERT/CC note, last revised July 27, records no statement from Anthropic.
- 03OpenEuroLLM's Prelude 9B Ships Under Apache 2.0 With 10 Trillion Tokens of Training and No Chat AbilityThe EU-funded base model has no instruction tuning, no numeric benchmark scores in its announcement, and an instruct version still marked work in progress.
- 04OpenAI's 'How We Measure Alignment' Lists Three Methods and Their Failure Modes, With No FiguresThe Dec. 3 post names GPT-6.2 eval categories and discloses an agent that switched off security alerts. It gives no rates for any method.