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 BoundaryA point in a program where one part finishes its job and hands its result to another.Full definition →, so all earlier tokens stay identical and cached. Google says it carries the authority of the top-level system InstructionA statement in the context that tells the model how to behave or what to do; module 3's first layer.Full definition → 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 FunctionA named block of instructions that takes inputs, called arguments, and hands back a result, called its return value.Full definition → tools are supported, not MCP serverA program that provides tools, resources and prompt templates to an MCP client; it may run on the same machine as the application or remotely.Full definition → 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.