On this page

On December 3, 2026, Google opened public preview access to mid-conversation system instruction and tool updates inside the Gemini Interactions API (v1beta). On paper it looks like a small schema addition, yet anyone who has operated a 50-turn agent knows the headache it targets: policies, account states, and permitted tools routinely change mid-session, and until now every workaround forced an ugly trade-off.

Teams previously chose between two flawed patterns. Stuffing policy updates into a user message kept the prompt cache warm, but robbed those rules of top-level system authority and invited users to spoof them. Rewriting the top-level system_instruction or tools array preserved authority, but mutated the prompt prefix—invalidating the cache and forcing the model to reprocess the full history with extra latency and input token cost. The new system_input step removes that dilemma by letting developers append authoritative state updates at the current turn boundary.

How system_input keeps the prompt cache intact

The pattern relies on a strict invariant: freeze the top-level prefix across every turn, and express state changes purely as turn-boundary deltas.

  • Hold top-level fields constant: Using genai.Client(http_options={'api_version': 'v1beta'}), pass the exact same top-level system_instruction and tools payload on every call to client.interactions.create, chaining state through previous_interaction_id.
  • Prepend one system_input step before user_input: At any turn where rules or tools change, place a single system_input item directly ahead of user_input inside the input list. It can carry text guidance, tool deltas, or both.
  • Full authority plus auditable traces: The model treats system_input with the same precedence as the top-level system_instruction—outranking user prompts—without touching any earlier tokens, so cached prefixes stay hot. Calling client.interactions.get(id=...) returns each system_input step in exact chronological order alongside user_input and model_output, giving on-call engineers clean audit traces.
Figure 1: Legacy mid-session workarounds vs. Interactions API (v1beta) system_input prefix-preserving architecture
Figure 1: Legacy mid-session workarounds vs. Interactions API (v1beta) system_input prefix-preserving architecture

Image source: DigIntoAI diagram based on Google Developers Blog (Dec 3, 2026)

Dynamic tool swaps: execution order and the MCP exclusion

Google illustrates tool updates with a billing-review support flow. Turn 1 declares get_store_hours and issue_refund in top-level tools. By Turn 2, the account enters billing review: the backend keeps the identical top-level tools array to preserve cache hits, then sends a system_input step that removes issue_refund via removed_tools, attaches create_escalation_ticket via added_tools, and includes a brief policy note explaining why refunds are paused.

  • Removals execute first: When a single system_input both removes and adds declarations, removed_tools is processed before added_tools.
  • Pair tool removals with a short explanation: Giving the model a concise reason lets it tell the customer why a previously available action is temporarily unavailable instead of hallucinating errors or retrying the removed function.
  • Hard current limit — function tools only, no MCP: Google explicitly states that added_tools and removed_tools currently apply only to standard function tools and do not support MCP server tools. Orchestrators that swap MCP toolsets mid-flight will still need application-side gating for now.
Figure 2: Dynamic function tool swap workflow, preview model coverage, and four security/operational boundaries
Figure 2: Dynamic function tool swap workflow, preview model coverage, and four security/operational boundaries

Image source: DigIntoAI diagram based on Google Developers Blog and Gemini Interactions API v1beta docs

Rule accumulation, reversals, and non-negotiable security boundaries

Four operational rules separate reliable deployments from subtle bugs once you wire system_input into a state machine:

  • Rules accumulate; reversing one must be explicit: Every system_input remains active for the remainder of the session alongside the top-level instruction. Orthogonal rules coexist; direct conflicts resolve in favor of the latest step. Because earlier turns stay in context, lifting a production deploy freeze or ending a billing review requires sending a fresh system_input explicitly stating what changed and instructing the model to supersede the earlier directive.
  • Supported models vs. Gemini Live: The v1beta Interactions API preview covers the Gemini 4 text/multimodal lineup—gemini-4-carbon, gemini-4-neon, and gemini-4-hydrogen. Real-time streaming sessions on gemini-4-live handle mid-session context changes through a separate Live API primitive, send_context_update.
  • Model guidance is not backend authorization: Removing issue_refund from the model's visible tool list reduces wasted turns, but your backend must still validate caller permissions and account locks on every tool execution. Never treat prompt-level tool hiding as a security boundary.
  • Never interpolate untrusted text into system_input: Because system_input carries top-level authority, templating raw user input, scraped web pages, or untrusted webhook payloads into it hands an attacker direct privilege escalation. Restrict system_input generation to deterministic server-side templates and vetted policy enums.

When to adopt it

Short three-turn Q&A bots gain little from migrating to a v1beta preview endpoint. Where this feature pays off immediately is long-horizon agents—multi-stage support desks, incident-response copilots that enter and exit deployment freezes, or workflows carrying bulky tool catalogs where a single prefix reset destroys cache economics. Before switching production traffic, benchmark cache hit rates across state transitions on gemini-4-neon and write automated regression tests specifically for rule reversals.