Vibeleaderboard
← All Intel
Intel / blog

Introducing mid-conversation instructions in the Gemini API

Source
blog.google
Publisher
Google
Date
Why it matters

Long-running agents can now update system instructions or tools mid-session without invalidating the prompt cache. This removes the workaround of injecting rules as user messages, which carry less weight and can be imitated by users.

Key takeaways · AI-distilled
  • A system_input step placed directly before user_input appends at the current turn , so all earlier tokens stay identical and cached. Google says it carries the authority of the top-level system and outranks user messages.
  • Google recommends keeping the top-level tools list unchanged and using added_tools and removed_tools instead. Removals apply before additions, so a tool can be redefined in place. Only tools are supported, not tools.
  • Each system_input stays active for the rest of the session alongside the top-level instruction. Rules on different topics stack, and when instructions conflict the model favors the most recent one.
  • Google frames these as orchestration controls, not security: applications should still authorize every function call on the backend and keep untrusted user or external content out of system_input.
  • There is no separate fee: system_input tokens bill at standard input rates and earlier turns stay eligible for cached-token rates. The feature is in public preview for all Gemini 4 models through the v1beta Interactions API.
Terms in this piece · Glossary
  • Instruction — A statement in the context that tells the model how to behave or what to do; module 3's first layer.
  • Boundary — A point in a program where one part finishes its job and hands its result to another.
  • Function — A named block of instructions that takes inputs, called arguments, and hands back a result, called its return value.
  • MCP server — A program that provides tools, resources and prompt templates to an MCP client; it may run on the same machine as the application or remotely.

Get the Brief

A cited digest of what matters for people building with AI, every morning. Unsubscribe anytime. See today’s edition

Read the source blog.google
Tools in this story
Recommended reads