Gemini 4: Guidelines Change Without Losing the Cache

Google has opened a public preview allowing modifications to system instructions and tools during a session across all Gemini 4 models via the Interactions API. Previous exchanges remain cached, while new directives hold higher authority than user requests. However, this control does not exempt the application from overseeing the actions executed.
Pricing and Security Controls
No additional charges specific to this feature are planned: tokens added in system_input are billed at the usual entry rate of the chosen model. After modifying the rules or available functions, previous turns remain eligible for the cached token rate. Access is through the v1beta endpoint; its extension to Gemini Enterprise Agent is announced for the near future, with no specified timeline.
The scope of these settings remains that of orchestration: they guide the model but do not replace application permissions. Before any execution, each function call must always be authorized on the server side. Unreliable external content or content from end users should not be inserted into system_input.
Rights and Rules Adapted During the Session
In exchanges that can involve dozens or hundreds of turns, permissions, rules, and accessible functions do not necessarily remain fixed. Google specifically offers to apply workspace settings, account rights, or spending limits discovered during the conversation. The system can also serve to remind of presentation, tone, or policy requirements as the context expands.
Among the proposed uses is the opening of writing functions after authentication or validation of a plan, followed by their removal when reverting to consultation only. A function could also be suspended during the unavailability of a service it depends on, with appropriate advice, before its restoration. Finally, a catalog could be enriched according to the task's needs rather than being fully declared at the outset, without losing the cache.
The troubleshooting scenario provided by Google introduces a deployment prohibition after the start of the dialogue. When faced with a request for production, the assistant refuses and suggests controls without modifying the system.
Another scenario: a support assistant initially has get_store_hours for hours and issue_refund for refunds. In the next turn, the application removes issue_refund and adds create_escalation_ticket, intended to forward the case to support, without altering the initial list. The directive then indicates that the account is under billing review, that refunds are suspended, and that a transmission to support should be proposed, even as the user requests a refund for order 12345.
The AI brief the pros read every evening
The 7 best AI stories, the essentials in 5 min. Free.
Included when you join: our pick of the best AI guides & comparisons.
Choose your rhythm
Free · No spam · Unsubscribe in 1 click
Functions Evolve Without Rewriting Their Initial List
Function declarations appear at the beginning of the prompt: modifying their initial list between exchanges invalidates the cache. Google recommends maintaining this list and transmitting changes with added_tools or removed_tools in system_input. This step can associate text with function modifications or contain only one of these categories.
Changes remain applicable until a new intervention by system_input. If a single step involves both removals and additions, the API first performs the deletions, then the insertions: a definition can thus be replaced on the spot. Google advises accompanying the removal with a brief explanation so that the model can justify the unavailability of the action.
This capability currently applies only to function tools. It does not allow modifications to tools provided by MCP servers.
How to Add Instructions and Manage Their Priority
Until now, changing system instructions or tools required invalidating the cache and reprocessing the entire dialogue, resulting in increased cost and latency. A workaround was to slip new rules into a user message. However, their authority was lower, and a user could attempt to mimic them; system_input receives the rank of the initial system instructions, above user requests.
To employ it, the application references the previous turn in previous_interaction_id and inserts system_input just before user_input. Only one such step is allowed per turn. The initial field system_instruction must remain unchanged to preserve the cached prefix; the troubleshooting example uses gemini-4-neon with v1beta.
Each addition constitutes a distinct entry in the history and remains applicable until the end of the session with the initial instructions. Rules concerning different subjects accumulate; when they contradict each other, the most recent one transmitted by system_input takes precedence. Since the content is added at the current turn level, previous tokens remain unchanged, and the cache can be reused.
To examine the course of a session, client.interactions.get returns the system_input steps in their place among user entries and model outputs. This return allows tracking changes in instructions during an audit or debugging.
Brief AI — AI news in French
The essentials of artificial intelligence news, decoded and explained every day.