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
- Add system_input stepAdd a system_input step right before user_input
- Pass previous IDPass previous_interaction_id through the Interactions API
- Change tools if neededUse added_tools and removed_tools; removal runs before addition
- Newer instruction winsNewer instructions win when they conflict with older ones
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
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.
Long-running agents can apply account limits or permission changes mid-session without extra cost for reprocessing earlier turns.