Skip to content

AI SDK TUI Beta 18: Sandbox Mode and Flexible Agent Types

Vercel's @ai-sdk/tui beta 18 adds a sandbox option for tool execution and loosens generic constraints on runAgentTUI.

Vercel shipped @ai-sdk/tui@1.0.0-beta.18 with two targeted fixes to how agents run inside the terminal UI.

The patch covers:

  • Sandbox option for runAgentTUI — a new sandbox parameter gets forwarded to every agent stream call, isolating tool execution from the host environment. If your agent calls shell commands or file-system tools, this is the guardrail you were missing.
  • Flexible agent generics — runAgentTUI now accepts any AI SDK Agent generic combination, not just a narrow subset. Previously, passing agents with custom tool sets or non-default model types could require awkward type casts. That friction is gone.

Both changes are small in diff size but practical in impact. The sandbox option matters most: the TUI package is designed for interactive terminal agents — exactly the context where an LLM might invoke destructive tools. Forwarding a sandbox flag to every stream call means you set it once and every tool invocation respects it, rather than wiring isolation per-call.

The generic fix is a developer-experience cleanup. The AI SDK is provider-agnostic by design — it works across OpenAI, Anthropic, Google, and custom providers. Locking runAgentTUI to a narrow generic signature contradicted that flexibility. Now the TUI layer matches the rest of the SDK’s type surface.

NOTE

This is a beta release (1.0.0-beta.18). The API surface can still change before the stable 1.0.0 cut. Pin your version if you’re shipping to users.

Install with npm i @ai-sdk/tui@1.0.0-beta.18. If you’re already running terminal agents with the AI SDK, the sandbox option is worth adopting immediately — one line of config for tool-execution isolation across every stream call.