Chat about this article with your favourite AI tool
Google has introduced mid-conversation system instructions and tool changes in the Gemini API, letting developers update an agent’s rules and available tools during a session without invalidating the prompt cache. The feature is in preview through the Interactions API.
Google said long-running agents often work across dozens or even hundreds of turns, during which rules, permissions and tools change. Until now, giving the model a new system instruction or updating tools broke the cache.

The problem with the old workarounds
According to Google, developers have relied on two approaches. The first was to send new instructions as a user message, which preserves the cache but carries less weight than top-level system instructions and lets users try to imitate them. The second was to rewrite the system instruction or tools, which forces the model to reprocess the whole conversation and adds cost and latency.
How the new step works
The Interactions API now accepts a system_input step at any turn. Google said it carries the same authority as the top-level system instruction and takes precedence over user messages, while earlier turns stay cached.
Developers pass the previous turn’s ID in previous_interaction_id and place the system_input step directly before user_input in the input array. The top-level system instruction should remain unchanged across turns so the cached prefix stays valid.
Each system_input stays active for the rest of the session alongside the top-level instruction. Rules on different topics apply together, and when a newer instruction conflicts with an earlier one, the model favors the most recent. Each step also shows up in order when an interaction is retrieved, which Google said makes multi-turn agent traces easier to audit and debug.
Updating tools mid-session
Because tool declarations sit at the start of the prompt, changing the top-level tools list breaks the cache. Google recommends keeping the same tools list on every turn and using added_tools and removed_tools inside system_input to change which functions the model can call.
Updates persist until a later system_input changes them. If one step contains both fields, removals are processed before additions, so a tool definition can be replaced in place. Google suggests adding a short text note when removing a tool so the model can explain why an action is unavailable.
Only function tools are supported for these updates at present, not MCP server tools.
Suggested uses
- Applying constraints discovered mid-session, such as account entitlements or spending limits.
- Reinforcing formatting, tone or policy rules deep into long sessions.
- Enabling write tools after authentication and removing them for read-only review.
- Disabling a tool when a downstream dependency goes offline, then restoring it.
- Starting with a small tool set and adding more as the task requires.
Security guidance
Google said system_input, added_tools and removed_tools steer model behavior and act as orchestration controls, not security boundaries. Applications should still authorize every function call on the backend and keep untrusted external or end-user content out of system_input.
Pricing and availability
There is no separate fee. Tokens in system_input steps are billed at the standard input rates for the model being called, and earlier turns remain eligible for cached-token rates when rules or tools change.
The feature is in public preview across all Gemini 4 models in the Interactions API via the v1beta endpoint. Google said support for its Gemini Enterprise Agent Platform is coming soon.
Source: Google (The Keyword)

