Skip to content

AI SDK Workflow beta.101: system messages in prompts now rejected by default

Vercel's WorkflowAgent now blocks system messages inside prompt or messages arrays, aligning with generateText and streamText behavior.

Vercel’s WorkflowAgent just stopped accepting system messages where they don’t belong. As of @ai-sdk/workflow@1.0.0-beta.101, passing a role: 'system' message inside prompt or messages throws by default.

What the patch (commit b402b95) changes:

  • Rejects system messages nested inside prompt or messages arrays
  • Matches the existing behavior of generateText and streamText in the core AI SDK
  • Adds an allowSystemInMessages: true escape hatch to restore the old behavior

The fix closes a quiet footgun. System prompts belong in the dedicated system parameter — when they leak into the message array, providers handle them inconsistently and you get drift between what you think the agent sees and what actually reaches the model. The rest of the SDK enforced this; WorkflowAgent was the outlier.

NOTE

If your workflow agent was relying on inline system messages — intentionally or not — upgrading to beta.101 will throw at runtime. Either move them to the top-level system field or set allowSystemInMessages: true while you migrate.

For anyone building multi-step agent workflows on the AI SDK, the practical move is: audit any place you’re constructing messages arrays programmatically (chat history replay, tool-call loops, message stitching across steps) and confirm no system roles are slipping through. Most codebases won’t hit this, but the ones that do tend to be the complex orchestration cases where the bug was hardest to spot anyway.

Upgrade is a single bump in package.json — the package is still in beta, so breaking-by-default changes like this are expected before 1.0 stable.