Sandbox sessions now emit started, expiring and stopped events with stop reason and CPU and network usage. Agents can extend a session one minute before timeout, so long agent runs need less polling and fewer silent kills.
Key takeaways · AI-distilled
Vercel SandboxAn enforced restriction that confines a process to specified files, network destinations and other resources, applied by the operating system, a container or a virtual machine.Full definition → now emits sandbox.SessionOne conversation or piece of work as a harness keeps it: a record of messages, tool calls and observations that can be saved and resumed.Full definition →.started, expiring and stopped webhooks. Stopped events include the stop reason (requested, snapshot, timeout, exited or error) plus session duration, active CPU time and network transfer.
The expiring event arrives 1 minute before timeout by default, or at the lead time set by expiryNotificationLeadTime, with a fresh warning after each extension. An AgentA system in which a model repeatedly chooses operations, a harness carries them out, and the results return to the model to inform its next choice.Full definition → can listen through Vercel Model Context Protocol (MCP)A published agreement for an AI application to discover what a separate program offers and ask it to run one of those offerings.Full definition → and call extend_session_timeout.
Vercel notes an event can be delivered more than once, so handlers should key on the session ID, and on sandbox.expiresAt for expiring events.
With the Workflow SDK, a workflow can wait on these lifecycle events and extend its sandbox session while the agent is still working, without polling.
Terms in this piece · Glossary
Sandbox — An enforced restriction that confines a process to specified files, network destinations and other resources, applied by the operating system, a container or a virtual machine.
Session — One conversation or piece of work as a harness keeps it: a record of messages, tool calls and observations that can be saved and resumed.
Model Context Protocol (MCP) — A published agreement for an AI application to discover what a separate program offers and ask it to run one of those offerings.
Agent — A system in which a model repeatedly chooses operations, a harness carries them out, and the results return to the model to inform its next choice.