Google lets developers change Gemini agents’ rules mid-conversation

A Gemini API preview keeps earlier turns cached, so long-running agents don't reprocess the whole chat.


Google lets developers change Gemini agents’ rules mid-conversation
Image Credits Credit: Google

Google has released a preview in the Gemini API that lets developers add system instructions and switch tools on or off during a conversation while earlier turns stay cached. New rules carry the same weight as the original system prompt. Google says apps should still check every action before it runs.

Google has given developers a way to hand AI agents built on Gemini new instructions and tools partway through a conversation, it said on Thursday. The feature is in preview in the Gemini API.

Agents can run for hundreds of turns, and their rules often change along the way, such as a new spending limit or permission. Until now, changing the main instructions forced the model to reprocess the whole conversation, adding cost and delay. Developers could slip new rules into a user message instead, but those carried less weight and users could imitate them.

The new option adds an instruction as its own step, with the same authority as the original system prompt. Earlier turns stay cached, so they are billed at cheaper cached rates. Developers can also switch tools on and off, such as removing a refund tool while an account is under review.

Old instructions are not deleted, and the model follows the newest one when rules clash. Google says the feature only steers the model, so apps should still check every action on their own servers before it runs. A researcher has already hijacked agents from Google and others with prompt injection.

It works with Gemini 4 models, including the recently launched Gemini 4 Neon, and costs nothing beyond normal token prices. Agent costs are a growing worry, with some firms’ AI bills tripling even as token prices fell. Anthropic added message threads to its API in November, though they save time rather than money.

Get the TNW newsletter

Get the most important tech news in your inbox each week.

Thanks! Check your inbox to confirm your subscription.

By subscribing you agree to our Privacy Statement.