RadarShare

Gemini API now lets developers change an AI agent's instructions and tools mid-conversation

A new preview lets developers update rules and switch tools on or off while a conversation is underway, with earlier turns cached and the same authority as the original system prompt.

By MOBAEO Newsroom··2 min read

Follow
bird's eye view of train rails
Photo: Mike Enerio / Unsplash

Google has released a preview feature in the Gemini API that lets developers add new system instructions and turn tools on or off in the middle of a conversation with an AI agent. The company announced it on Thursday, and the earlier steps of the conversation stay cached.

According to The Next Web, in a report published on December 3, the change addresses a common problem with agents: they can run for hundreds of turns, and the rules often change along the way, such as a new spending limit or a new permission.

Until now, changing the core instructions forced the model to reprocess the entire conversation, which drove up both cost and latency. The workaround was to slip the new rules into a user message, but in that format they carried less weight and could be mimicked by users themselves.

How the new instruction works

With the update, the instruction enters the conversation as a step of its own, with the same authority as the original system prompt. Earlier turns remain cached, so they are billed at the lower rates that apply to cached content.

Developers can also enable and disable tools during the conversation. The example given is removing the refund tool while an account is under review.

Older instructions are not deleted. When rules conflict, the model follows the most recent one.

Limits and cost

Google says the feature only guides the model and that applications should keep checking every action on their own servers before it is carried out. The report notes that a researcher has already hijacked agents from Google and other companies through prompt injection.

The feature works with Gemini 4 models, including the newly launched Gemini 4 Neon, and carries no charge beyond standard token pricing. Agent costs are a growing concern: at some companies, the AI bill has tripled even as token prices have fallen. Anthropic added message threads to its API in November, a feature that saves time but not money.

For brands running agents built on Gemini, the feature makes it possible to adjust rules and tools mid-session without reprocessing the whole conversation, while paying less for the turns already completed. Google's own guidance, however, is to keep verifying every action on the server, since the new instruction guides the model and does not replace that control.

Key questions

What does the new Gemini API feature let developers do?

Add new system instructions and turn tools on or off in the middle of a conversation with an agent, without having to reprocess the earlier turns.

Does the feature cost extra?

No. It works with Gemini 4 models and carries no charge beyond standard token pricing, and earlier turns are billed at cache rates.

Does the new instruction remove the need for other checks?

No. Google says the feature only guides the model and that applications should check every action on their own servers before carrying it out.

Source: The Next Web.