Patch Changes
-
c98715a: Add
allowSystemInMessagesoption toToolLoopAgent.This exposes the same option that exists on
streamTextandgenerateText, whetherrole: "system"messages are allowed in thepromptormessagesfields. When unset, system messages are rejected because they can create a prompt injection attack risk. Ideally, use theinstructionsoption instead. Set totrueto allow system messages, orfalseto explicitly reject them.const agent = new ToolLoopAgent({ model, allowSystemInMessages: true, }); await agent.generate({ messages: [ { role: "system", content: "Server context" }, { role: "user", content: "Hello" }, ], });
The option can also be returned from
prepareCallfor dynamic per-call configuration.