Sandboxed tasks and buffered tasks debut in preview, mid-turn version skew for chat.agent, unstable_signals, 3 bug fixes, and many server improvements.
Highlights
Both features are in preview and must be enabled for your organization.
Sandboxed tasks
Use sandbox: true on a deployed task to restrict it to only its own payload and output. Sandboxed tasks cannot read other environment variables or interact with the platform beyond their own run, unless you explicitly grant permissions via sandbox.envVars and sandbox.scopes. The basic scope lets a sandbox inspect and manage its own run, and the oidc scope grants outbound OIDC tokens.
export const myTask = task({ id: "my-task", sandbox: true, run: async (payload) => { // Only has access to this run's payload and output },});
Control outbound network access with sandbox.network:
"restricted"(default): only Trigger.dev's services and domains from granted Vault variables, HTTPS port 443 only. Blocked requests return a403with anx-trigger-network-deniedheader.{ allow: ["api.example.com", "*.example.com"] }: restricted plus these additional HTTPS hosts."unrestricted": no network restrictions.
Upgrade the SDK, CLI, and (when self-hosting) server before adopting this option. trigger dev still runs locally with development credentials and is not an isolation boundary.
Buffered tasks
buffer.task() from @trigger.dev/sdk/preview lets you define a task that collects triggers over a time or count window and runs once with the full array of payloads collected in that window. Run tokens can buffer items too.
import { buffer } from "@trigger.dev/sdk/preview";import { z } from "zod";export const embedItems = buffer.task({ id: "embed-items", schema: z.object({ id: z.string() }), buffer: { maxItems: 100, maxDelay: "10s" }, run: async (items) => { // one run per window, with every item collected },});await embedItems.trigger({ id: "item_1" });
Improvements
- Add
versionSkew: "follow-mid-turn"tochat.agentandchat.createSession. Unlike"follow", this also moves a turn that is still running when its version falls below the skew threshold: the turn finishes its current step, then a run on the current deployment continues from the next step with no step running twice.chat.handOverAtStep(step)andchat.requestUpgrade()now also move the turn at the next step boundary rather than waiting for it to end. - Add
unstable_signals: broadcast a small message to every executing run in an environment that listens for its name. Send withunstable_signals.send(name, payload), receive withunstable_signals.on(name, handler), read the latest once withunstable_signals.latest(name), and clear withunstable_signals.clear(name). Names and behavior may change. runs.retrieve()now returns abufferfield on a buffered task's run: its buffer key, item count, and when and why the window closed.- Runs on a named
machine()can warm start again. A runner on a machine's image now only accepts runs for that same machine, so warm starts no longer need to be disabled for those runs. - Deployed Bun 1.4 tasks now see
NODE_ENV=productionwhen bytecode compilation is enabled. (#5164) - Resume a deployed task as soon as its run is restored after a wait. Runs suspended during
wait.for,triggerAndWait, a waitpoint token, or session input could take up to 5 seconds longer than needed to continue. TriggerChatTransportnow renews its session token only through youraccessTokencallback. ThepublicAccessTokenoption ofchat.writeTurnCompleteis deprecated and ignored.TriggerChatTransportno longer replays the previous answer when a chat is sent or reconnected without a savedlastEventId. Only the current turn's answer reaches the UI, and a reload mid-answer resumes it live.chat.agentchannel's final reply is now the turn's last non-empty run of text instead of every step's text joined together. Notes the model wrote before tool calls no longer end up in the posted reply.chat.customAgentandchat.createSessionloops can now hold Head Start tool calls that need approval: pass the tools and AI SDK 7'stoolApprovaltoconsumeHandover,chat.createSession, orapplyHandover.- With AI SDK 7's
useChat({ resume: true }), a chat that remounts while a reply is streaming (for example under React StrictMode in development) now rejoins the reply from its start instead of showing nothing until the next message. - The bundled chat agent skills now use
claude-sonnet-5-5in their examples. The previous model,claude-sonnet-4-5, is retired by Anthropic on November 30, 2026. - The MCP server's
trigger_tasktool now acceptsmetadata,idempotencyKeyTTL,concurrencyKey,concurrency,debounce,lockToVersion, andpriority. TTL behavior also changed: a run now gets the TTL you pass, then the task's default, then 10 minutes in dev or the server maximum elsewhere. Passttl: "10m"to restore the old behavior. trigger mcp --profile <name>now takes precedence over the profile in.trigger/mcp.json. Run traces are kept in memory and no longer written to disk.- The MCP server's
list_runstool now acceptsbeforeto page backwards through runs using the previous cursor. - JWT validation now accepts only HS256, the algorithm Trigger.dev tokens are signed with.
- The CLI and MCP server now report usage analytics when connected to Trigger.dev Cloud: which commands run and which MCP tools are called, never the arguments you pass. Turn it off with
--skip-telemetryorTRIGGER_TELEMETRY_DISABLED. - Upgrade the CLI's
zoddependency to 4.6.7.
Bug fixes
- Fix the type of the handle returned by
batch.triggerByTask(). It promisedruns,isCached, andidempotencyKey, which were never returned, so code likeresults.runs[0]compiled but threw at runtime. The handle is now typed correctly asbatchId,runCount, andpublicAccessToken. Usebatch.retrieve(batchId)to get run IDs, orbatch.triggerByTaskAndWait()for typed results. - Fix
AgentChatreturning another turn's reply, or several replies joined together, instead of the answer to the message you sent. Agents now mark where each turn starts on the output stream, so redeploy them on this version. Custom readers of the session output stream must skip control records they don't recognize. - Fix run metadata changes sometimes reaching the API only when the run finished, so realtime subscribers and parent runs didn't see progress mid-run. Also fixes a metadata
appendorincrementoccasionally being applied twice at the end of a run.
Server changes
These changes are included in the v4.9.0 Docker image and are already live on Trigger.dev Cloud:
- Session pages now have a Trace tab showing every run of a session on one timeline, with zoom, live updates, and search across runs.
- Set a skew protection threshold from a new Session upgrades page, an agent's page, or the API. Sessions on an older version move to the current deployment on next use. It's one-time: later deploys move nothing until you set it again.
- Ask Trigger can now search your environment's logs by message, level, task, run, or time range.
- Copy agent replies in the Ask Trigger chat and the AI reply on the Query page with a new copy icon.
- Add an Access page to organization settings where owners and admins choose which MCP tools require confirmation before they change anything.
- The remote MCP server can now trigger a batch of up to 20 runs in one call, list and manage batches, list and complete waitpoint tokens, manage queues and concurrency, list tasks with recent activity, manage sessions, and list environments, branches, and regions.
- The remote MCP server can now promote, roll back, or cancel a deployment; deploy from a connected GitHub repository; replay a run into another environment; redeploy a finished deployment; rename or delete a project; and list, resolve, ignore, or unresolve error groups.
- The remote MCP server can now read and edit custom dashboards, list Query page recent queries, browse the model catalogue, show and render prompts with variables, and download a run's full log as a file.
- The remote MCP server can now list, create, update, activate, deactivate, or delete schedules; and list, read, tag, and close sessions.
- AI agents connected to the MCP server can see which environment variables are set in each environment (and which are missing) without seeing their values.
- Admins can now invite team members, revoke pending invites, and resend their own invites. Only Owners can remove members or change roles.
- The New environment variable dialog now starts with "Secret value" on. Replacing existing values keeps each one's setting unless you change the switch. New variable names are limited to 256 characters.
- Span properties now have a Pretty view. JSON stored as text, like webhook bodies, is unpacked into a tree you can expand and collapse.
- Dev branch runs now inherit environment variables from their parent Development environment unless the branch overrides them.
- MCP tool errors are now plain text that names what went wrong and what to do next, instead of a raw JSON body. MCP tools now also refuse unknown arguments and name the field the agent most likely meant.
- MCP approval pages now show invisible characters and text-reordering control characters as visible escapes.
- The task name in the run inspector now opens the task's page. Picking tasks for an API key no longer clears the search after each pick.
- Retrieving a run with an empty-string payload or output now returns that value instead of omitting the field.
- Links from the docs can open a task's Test page with an example payload already in the editor.
- Accept
GITHUB_APP_PRIVATE_KEYwith escaped\nline breaks, so the key can be set as a single-line environment variable. - Fix
trigger devkeeping a task process alive and retrying forever when a run finished while the computer was asleep. - Fix queries that combine AND and OR: brackets and operator precedence were ignored, causing wrong rows to be returned.
- API requests no longer stall while Redis is unavailable; login attempts are refused rather than unlimited during that time.
- Self-hosted installs whose database schema name has capital letters or a hyphen no longer fail on some dashboard pages.
- Replaying a run with a large payload into a different environment now works.
How to upgrade
Update the trigger.dev/* packages to v4.9.0 using your package manager:
npx trigger.dev@latest update # npmpnpm dlx trigger.dev@latest update # pnpmyarn dlx trigger.dev@latest update # yarnbunx trigger.dev@latest update # bun
Self-hosted users: update your Docker image to ghcr.io/triggerdotdev/trigger.dev:v4.9.0.




