In the Python Agents SDK, there’s support for mutating an agent’s instructions at runtime using agent.update_instructions(new_text) (documented under “Update in place instead of handing off” in the Tool Loop Design guide: /agents/logic/tools/design/).
In the Node.js SDK, we can dynamically update tools with agent.updateTools(), but there doesn’t appear to be an equivalent updateInstructions() method.
For multi-stage conversational flows where only the system prompt changes (not the agent role or toolset), having instruction mutation without a full agent handoff would help reduce latency and simplify architecture.
Is there a recommended pattern for this in Node today? And would adding updateInstructions() to the Node SDK be feasible?
Hi Robbe, we aim to make the featureset between Python and Node.js the same.
I see update_instructions has been in Python a long time, and I can’t find a ticket to add it to Node.js, so I think this was missed. I’m pretty sure this would be a fairly small change to add.
Let me follow up with the Agents team and get an authoritative answer.