List your AI tool on AI Orion for free. Submit a tool

Gemini API lets agents take new instructions mid-conversation

Gemini API lets agents take new instructions mid-conversation

Developers can change system instructions or tools partway through a session without breaking the prompt cache. In preview in the Interactions API.

What happened

Google has added mid-conversation instructions to the Gemini API, it announced on 3 December. Developers can now change an agent's system instructions or tools partway through a session without paying to reprocess the whole conversation. The feature is in preview through the Interactions API.

The problem it fixes

Agents that run for many turns often need new rules or tools along the way. Until now, developers had two poor options, Google says:

  • Put the new rule in a user message. That keeps the prompt cache, but the rule carries less weight and users can imitate it.
  • Rewrite the system instruction or tools. That breaks the cache, so the model reprocesses the whole history, which costs more and takes longer.

How it works

Developers send a new system_input step before the user's next message. Google says it carries the same authority as the top-level system instruction and takes precedence over user messages, while earlier turns stay cached.

Each new instruction stays active for the rest of the session. If a newer instruction conflicts with an older one, the model favours the newer one. Every instruction appears in order in the conversation history, which makes it easier to audit what the agent was told.

Google's example: an infrastructure assistant is told mid-session that a deployment freeze is on, so it refuses a request to deploy a new release.

What it means for you

If you build agents on Gemini, you can change permissions or tools as a session goes on, for example when a user signs in or a freeze starts, without the cost of starting over. It is a preview, so expect changes before general release.

You can try the Gemini API in Google AI Studio. For Google's newest model, see our Gemini 4 Neon story.

Tools in this story

Source: Google blog