Gemini API now lets developers change system instructions mid-conversation

Developers can update system instructions or tools mid-session without breaking the prompt cache. The feature is in public preview.

GoogleProducts & Tools
AI assisted

Google has added mid-conversation system instruction and tool changes to the Gemini API through the Interactions API. Until now, giving a model new system instructions or changing tools partway through a long session invalidated the cache, forcing it to reprocess the full history and adding cost and latency.

How it works

  • system_input: Developers can send a system_input step right before user_input at any turn. It carries the same authority as the top-level system instruction and takes precedence over user messages.
  • Cache intact: New instructions append at the current turn boundary, so earlier turns stay cached.
  • Tool changes: added_tools and removed_tools update which functions the model can call; only function tools are supported, not MCP server tools.
  • Conflicts: When a newer instruction conflicts with an earlier one, the model favors the most recent.

Google notes that these fields steer behavior only. Apps should still authorize every function call on the backend and keep untrusted content out of system_input.

Pricing and support

There is no separate fee. Tokens in system_input steps are billed at the model’s standard input rate, and earlier turns stay eligible for cached-token rates. The feature works across all Gemini 4 models in the Interactions API via the v1beta endpoint.

Google says Gemini Enterprise Agent Platform support is coming soon but has not given a date.

Source