Google Gemini API Adds Mid-Conversation Instructions and Dynamic Tool Updates
Google introduces mid-conversation system instructions and dynamic tool updates in the Gemini API preview, allowing agents to adjust rules and tools while keeping prompt caches intact.

Google has introduced mid-conversation system instructions and tool updates in preview for the Gemini API via the Interactions API. Announced by Gemini API Product Manager Trey Nguyen and Google Cloud Product Manager Daniel Kyme on December 3, 2026, the update allows autonomous agents to modify instructions, security rules, and available tools in the middle of an active session without resetting prompt caches or driving up latency and reprocessing costs.
Long-running AI agents frequently execute across dozens or hundreds of conversation turns, during which available permissions, system constraints, or operational tools may change. Previously, developers faced two distinct workarounds to adapt agent behavior. The first involved inserting modified rules into standard user messages, but this approach lacked the authority of top-level system instructions and created security risks where end users could attempt to imitate system prompt formatting. The second involved updating the top-level system instructions or tools list directly between turns, which broke prompt caching and forced the model to reprocess the entire dialogue context from the start.
Updating rules and tools mid-session without breaking cache
The new feature addresses these limitations through a new system_input step added to the Interactions API using the v1beta endpoint. By referencing the previous turn's ID with previous_interaction_id and keeping the initial top-level system instruction constant across turns, developers can insert a system_input step directly before a user_input step in the input array.
When sent, the system_input appends to the conversation history as its own dedicated step without altering prior tokens, allowing earlier turns to remain cached at lower rates. The new instruction carries the same weight as top-level instructions and takes precedence over user messages. When rules cover different topics, earlier and newer instructions remain active together; if a conflict arises between instructions, the model automatically favors the most recent system_input.
Developers auditing multi-turn conversations can retrieve complete traces via client.interactions.get. The output returns system_input, user_input, and model_output steps in their exact sequence, making complex multi-turn workflows straightforward to inspect and debug.
Dynamic tool management with added_tools and removed_tools
Tool declarations typically sit at the beginning of an API prompt, meaning any modification to top-level tool declarations breaks prompt caching across turns. To modify tool capabilities mid-session without resetting the cache, Google recommends keeping the top-level tools list constant throughout the session and leveraging added_tools and removed_tools within system_input steps.
Currently, this dynamic updating capability supports function tools only and does not extend to MCP server tools. When a single system_input step contains both fields, the API processes removed_tools before added_tools, enabling developers to swap function definitions in place. Developers can also include text notes alongside tool changes to provide the model with context on why specific tools were removed.
Despite these orchestration controls, Google emphasizes that system_input, added_tools, and removed_tools are strictly model steering mechanisms. Applications must continue to authorize every function call on the backend prior to execution and ensure untrusted user or external input remains separated from system_input fields.
What it means for developers
This release enables several key architectural patterns for multi-turn agent development:
- Session-dependent constraints: Rules such as spending caps, account entitlements, or workspace configurations can be applied dynamically mid-conversation.
- Long-horizon reinforcement: Key formatting, tone, or safety rules can be re-emphasized as the conversation context grows larger over time.
- Dynamic permissions and mode switches: Write permissions or account-action tools can be added after user authentication or plan approval, and removed when reverting to read-only diagnostic modes.
- Live operational responses: Tools can be disabled immediately if downstream dependencies or external services experience downtime, and restored once operational.
- Large tool catalog management: Agents can start sessions with a lightweight set of tools and progressively add specific tools only when required by the workflow, avoiding large upfront tool declarations.
Mid-conversation system instructions are available in public preview across all Gemini 4 models via the Interactions API (v1beta endpoint). Support for the Gemini Enterprise Agent Platform is scheduled to follow soon. Mid-conversation instruction steps incur no separate platform fees; tokens within system_input steps are billed at standard input token rates, while prior conversation turns remain eligible for prompt caching rates.
For teams building multi-model pipelines across different providers, developers can try top AI models cheaply through one API at https://apixoai.online.
Source: Introducing mid-conversation instructions in the Gemini API — Google AI blog. Written by the Apixo team from that report.
One key for Claude, GPT, GLM, DeepSeek and more. Pay per token with crypto.
Get your API key

