Home / Blog / Google introduces mid-conversation instructions in the…
Tech News

Google introduces mid-conversation instructions in the Gemini API

Google launched mid-conversation systeminput and tool updates in preview for Gemini 4 via the Interactions API, keeping prompt caches intact across turns.

By Dillip Chowdary • Dec 03, 2026 • Source: Google Keyword Blog

Google introduces mid-conversation instructions in the Gemini API
Image: Google Keyword Blog

At a glance

Product
Gemini API Interactions API
Feature
system_input, added_tools, removed_tools
Models
All Gemini 4 models (v1beta)
Release date
December 3, 2026
Pricing
Standard input rate; cache intact
Limitation
Function tools only, not MCP tools

Google launched mid-conversation system instruction and tool updates in public preview across all Gemini 4 models through the Gemini API Interactions API, according to Google Keyword Blog's report. Product managers Trey Nguyen and Daniel Kyme detailed how developers can inject a system_input step on any turn without breaking prompt caching.

Long-running AI agents often operate across dozens or hundreds of turns where workspace rules, account entitlements, and downstream tool availability shift mid-session. This guide explains how system_input, added_tools, and removed_tools work in the v1beta Interactions API, how prompt caching and pricing behave, and what backend authorization guardrails engineers must maintain.

01The Prompt Cache Tradeoff in Long Sessions

Previously, developers updating rules mid-session faced two flawed options in multi-turn agent pipelines. Placing updated instructions inside a user message preserved the prompt cache, but those instructions lacked top-level authority and left room for end users to imitate system directives.

Rewriting the top-level system_instruction or mutating the top-level tools list solved the authority problem at a steep performance penalty. Any change to the prompt prefix invalidated the prompt cache, forcing the model to reprocess the entire conversation history with higher latency and input-token cost.

The new system_input step resolves that tradeoff by separating static prefix configuration from turn-by-turn orchestration updates. Earlier turns remain identical byte-for-byte in the cache while new authoritative instructions take effect at the current turn boundary.

02Appending system_input Without Breaking the Prefix

To update instructions mid-conversation, developers pass the prior turn's ID via previous_interaction_id and keep the top-level system_instruction unchanged across turns. Inside the input array, a system_input object sits directly before user_input for that turn.

  1. Preserve the top-level prefix Keep system_instruction and the initial tools declaration identical on every call to client.interactions.create on the v1beta endpoint.
  2. Pass the prior turn ID Set previous_interaction_id to turn1.id so the Interactions API appends to the existing conversation chain instead of starting cold.
  3. Insert a system_input step Place one system_input item immediately ahead of user_input containing updated text instructions, tool additions, or tool removals.
  4. Inspect ordered audit traces Call client.interactions.get with the interaction ID to review each system_input, user_input, and model_output step in chronological order.

Each system_input step carries the same authority as the top-level system_instruction and overrides user messages. Rules covering distinct topics stay active together for the rest of the session, while newer system_input directives supersede conflicting earlier rules.

03Swapping Function Tools With added_tools and removed_tools

Advertisement

Tech Pulse Daily

Get tomorrow's pulse first

Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.

Because tool declarations sit at the front of the prompt, editing the top-level tools array between turns invalidates cached prefixes. Google recommends leaving the top-level tools parameter fixed and modifying active functions inside system_input using removed_tools and added_tools.

Field or behaviorScope in system_inputPrecedence and lifecycle
Top-level system_instructionRemains unchanged across turnsPreserves prompt prefix cache across long sessions
system_input text contentOne step before user_inputOverrides user messages; latest instruction wins conflicts
removed_tools arrayFunction tools onlyProcessed before added_tools in the same step
added_tools arrayFunction tools onlyActive until altered by a later system_input step

When a single system_input step contains both arrays, the Interactions API processes removed_tools before added_tools, enabling clean in-place tool replacement. Including a brief text explanation alongside removed_tools helps the model explain why an action such as issue_refund was disabled in favor of create_escalation_ticket.

Note: Mid-conversation updates via added_tools and removed_tools currently support function tools only and do not apply to MCP server tools.

04Security Boundaries and Dynamic Agent Workflows

Nguyen and Kyme emphasized that system_input, added_tools, and removed_tools steer model behavior as orchestration controls rather than hard security enforcement. Applications must still authorize every function call on the backend before execution and keep untrusted external or end-user text out of system_input.

With those boundaries enforced, five production patterns benefit immediately from mid-session steering:

  1. Session-dependent constraints Inject workspace rules, account entitlements, or spending caps discovered partway through an interaction.
  2. Long-horizon reinforcement Reassert formatting, tone, or compliance policies deep into multi-turn threads as context grows.
  3. Dynamic mode switches Enable write or account-action tools only after authentication or plan approval, then strip them during read-only review.
  4. Live operational fallbacks Disable failing downstream tools during outages with guidance and restore them once recovery finishes.
  5. Staged tool catalogs Start sessions with a minimal tool set and surface additional functions as workflows require them without bloating the prefix.

05Gemini 4 Preview Availability and Pricing

Mid-conversation system instruction and tool updates carry no separate API surcharge. Tokens inside system_input steps are billed at the standard input-token rate for the selected model, while preceding turns remain eligible for cached-token pricing.

The capability is live in public preview across all Gemini 4 models through the Gemini API v1beta Interactions API endpoint, demonstrated in Google's examples with gemini-4-neon. Support for the Gemini Enterprise Agent Platform is slated to follow.

Frequently asked questions

How does system_input preserve the Gemini API prompt cache?

Keeping top-level system_instruction and tools unchanged lets earlier turns stay cached while system_input appends at the current turn boundary via previous_interaction_id.

Can developers update MCP server tools with added_tools and removed_tools?

No, mid-conversation tool updates via added_tools and removed_tools currently support function tools only and do not support MCP server tools.

Does Google charge an extra fee for mid-conversation system instructions?

There is no separate fee; tokens in system_input steps are billed at standard model input-token rates while prior turns remain eligible for cached-token rates.

Which models and endpoints support mid-conversation updates today?

The feature is in public preview across all Gemini 4 models via the Gemini API Interactions API on the v1beta endpoint, with Gemini Enterprise Agent Platform support coming soon.

Sources

Dillip Chowdary

Author

Dillip Chowdary

Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.

Related on Tech Bytes

Advertisement

5-min tech signal

Weekday briefing for engineers who skip the noise.

No spam · Unsubscribe anytime

Advertisement

✈️ CareerPilot

Your AI job-search copilot

Match your resume against live Ashby, Greenhouse & Lever openings — fit scores, job-specific resume optimization and email alerts.

Find matching jobs →

Free Tools

Browse all tools →