# Gemini API keeps cache intact when instructions and tools change mid-conversation

> Google has released in preview a feature that preserves the prompt cache in the Gemini API's Interactions API even when system instructions and tools are changed partway through a conversation.

- **Publisher**: New Web Media
- **Section**: AI
- **Published**: Dec 4, 2026, 04:43 KST (2026-12-03T19:43:29.029Z)
- **Updated**: 2026-12-03T19:47:39.756Z
- **Credit**: Edited by Seung Kim
- **Canonical URL**: https://newweb.media/en/a/261204-5j35id
- **Markdown URL**: https://newweb.media/en/a/261204-5j35id.md
- **Korean Original**: https://newweb.media/a/261204-5j35id

## Why it matters
- It eases the burden on long-running agents, which had to reprocess the entire conversation, with the cost and delay that entails, whenever rules or permissions changed.

## Key details
Developers send new instructions or tool changes by inserting a system_input step directly before user_input on each turn. This step carries the same authority as the top-level system instruction and takes precedence over user messages, and earlier turns stay in the cache. For tools, the top-level list is kept the same on every turn, and added_tools and removed_tools change which functions can be called. If both fields are in a single step, removals are processed first, so a definition can be replaced in place.

## Context
Until now, developers either put new instructions in a user message or rewrote the system instructions and tools. The former carries a different weight from top-level instructions, so users could imitate it, and the latter invalidated the cache. Each system_input persists until the session ends, and if they conflict, the model follows the most recent instruction. There is no separate charge, and system_input tokens are billed at the standard input token rate for the model in question. Turns before a change may be charged at the cached token rate.

## Outlook
The public preview is available through the v1beta endpoint on all Gemini 4 models in the Interactions API. Tool updates support function tools only, and MCP server tools are not covered. Google said this step is a control for adjusting model behavior, and advised that applications approve function calls themselves on the backend and not include unverified external or end-user content.

## What's next
- Support for the Gemini Enterprise Agent Platform will be added soon.

## Key terms
- **Prompt cache**: A feature that stores and reuses the processing results for the repeated front part of a prompt, reducing cost and delay.
- **Interactions API**: An interface in the Gemini API that exchanges conversation turns in units of steps and continues a conversation using the previous turn's ID.

## Primary Sources
- [Google official blog](https://blog.google/innovation-and-ai/technology/developers-tools/gemini-api-mid-conversation-updates/)

---
Tags: Gemini API, prompt cache, AI agents, Google
