AIAIAI.FYI
LIVE

Google adds mid-conversation system instructions to Gemini API in public preview

Developers can change rules and tools mid-session through the Interactions API without breaking the prompt cache, and the new tokens bill at standard input rates.

Step by step

How to change instructions mid-conversation in the Gemini API

  1. Add system_input stepAdd a system_input step right before user_input
  2. Pass previous IDPass previous_interaction_id through the Interactions API
  3. Change tools if neededUse added_tools and removed_tools; removal runs before addition
  4. Newer instruction winsNewer instructions win when they conflict with older ones
Per Google AI Blog (The Keyword)

What happened

Google now lets developers change an AI agent's rules or tools while a chat is already running. Before, a change forced the model to re-read the whole conversation, which cost more and ran slower. The new feature, called system_input, avoids that.

Why it matters to you

Companies that run long AI agent sessions, such as customer support bots, can adjust permissions on the fly without paying to reprocess everything.

The takeaway

AI agents built on Gemini can now switch rules mid-chat at a lower cost.

What it means for you

If you build software

Keep the top-level system_instruction and tools list unchanged across turns, authorize every function call on the backend, and keep untrusted user content out of system_input.

If you run a business

Long-running agents can apply account limits or permission changes mid-session without extra cost for reprocessing earlier turns.

Get stories like this every morning